3.3 SAMPLE CSS FILE

Shown in Figure 3.2 is a sample CSS file that is generic. The CSS applies from top to bottom.

 

A snippet from a sample CSS file

 

Fig. 3.2 A snippet from a sample CSS file

 

It is related to the HTML tags in the sense that the style definitions apply to a particular tag. For example the <body> tag is styled as per the body style definition described in the CSS file. Likewise, all content within <p> tags in the HTML file will follow that defined by the style within “p { …}” in the CSS file.

In addition to the tag, there could be classes or “id”s in the HTML file that can relate to the CSS style definitions. In an HTML page each “id” attribute is unique; ...

Get Web Technology: Theory and Practice now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.