CSS comments

Enclose CSS in HTML comment tag

it is recommended that you enclose your CSS declarations in a HTML comment tag because with browsers that don’t recognize <style></style>, the tags within them might not get ignored completely and could cause potential problems for the HTML file. <style type="text/css"> <!-- @import url(sheet2.css); h1 {color: maroon;} body {background: yellow;} --> </style> By Bryan Xu

@import directive

@import url(sheet2.css); Just like link, @import can be used to direct the web browser to load an external style sheet and use its styles in the rendering of the HTML document. The only major difference is in the actual syntax and placement of the command. @import is found inside the style container. It must be […]

“link” tag

<link rel=”stylesheet” type=”text/css” href=”sheet1.css” media=”all” /> – allows HTML authors to associate other documents with the document containing the link tag. Alternate style sheets: <link rel=”stylesheet” type=”text/css” href=”sheet1.css” title=”Default” /> <link rel=”alternate stylesheet” type=”text/css” href=”bigtext.css” title=”Big Text” /> <link rel=”alternate stylesheet” type=”text/css” href=”zany.css” title=”Crazy colors!” /> It is also possible to group alternate style sheets […]

Element definitions

Replaced elements – the element’s content is replaced by something that is not directly represented by document content. For example, <img> Nonreplaced elements – their content is presented by the user agent (generally a browser) inside a box generated by the element itself. For example, <span>hi there</span> is a nonreplaced element, and the text “hi […]