Before learning CSS, it is important to understand how HTML is structured. HTML is made up of elements that describe the structure of the content on a web page.
HTML elements describe the structure and content of a web page. Tags are used to indicate the beginning and end of elements. The syntax is as follows:
For example, a paragraph would be marked up as follows:
Tags often have attributes for further defining the element. Attributes come in name-value pairs:
For example, an important paragraph might be marked up as follows:
Block elements are elements that separate a block of content. For example, a paragraph (<p>) element is a block element. Other block elements include:
Inline elements are elements that affect only snippets of content and do not block off a section of a page. Examples of inline elements include:
Strong knowledge of HTML makes working with CSS much easier, but with the basic knowledge covered above, you should be able to get a good start with CSS.