At the end of October I published a post about CSS terminology which explained the basic usage of Cascading Style Sheets and technical terms used to identify and explain code parts.
Today we are going to do the same for HTML, because I feel that sometimes terms are not properly used, and we surely need to make things clear.
The following will be a short and undoubtedly not complete journey through the basic HTML programming. If you are a little bit experienced, you might find it boring... however, are we fully sure we use the correct terminology?
Follow me and see for yourself.
HTML stands for HyperText Markup Language and it is the programming language used to build web pages. The first version of HTML was defined in 1991. Today we often talk, write and discuss HTML latest version: HTML5.
The programming language is quite intuitive and it mainly consists of tags.
TagsTo show content on a web page we need to use tags. Basically every element in web page is composed by tags. An element is usually made of tag pairs. So here we go with the first terms! Let's try to explain tags with an example:
<p> is the start tag;
<p>Welcome to The Web Thought</p>
Welcome to the Web Thought is the content;
</p> is the end tag (made of a slash "/" and the tag name again);
<p>Welcome to The Web Thought</p> is an element.
There are HTML elements that do not have a start tag and an end tag. Those elements consists in only one tag (for example the <br> element).
AttributesEvery element might have attributes to better define its meaning. Attributes go in the start tag of an element and usually they consist of a name and a value enclosed in quotes.
Now, something you might not know: quotes around values are not always needed, infact if the value has no space or any special characters like " ' ` = < and >, we can remove the quotes.
Another thing: we can use double quotes or single quotes, it doesn't matter.
HTML basic structureThe basic structure of an HTML page is made of the following elements:
The head content is different from the body content. The body content is where we want to insert our page elements, while in the head we are going to insert the document metadata.
Document metadataThe document metadata consists in a collection of information for the HTML document. The head element usually contains the document title, the character settings, the document description, keywords, scripts and information on stylesheets.
Body contentIn the body we can insert all the HTML elements that will generate the document as displayed by the browser. The general HTML structure should always be clear and immediately recognisable while programming. Indentation, for example, should be used to preserve the flowing of page elements in code view while consistent closing tags should follow a nesting structure.
The above code represents a good way of creating a document structure. Or, being more strict:
<font color="#000000">Welcome to The Web Thought </font>
Remember that the more accurate is the coding process in terms of clarity, the easier it will be to understand and maintain the code itself.
Welcome to The Web Thought
Ok folks!, I think that's enough for today. I believe you've been bored enough.
Have a nice day and share your thoughts as usual!