CSS Notes For RH
CSS Notes For RH
Types of selectors
There are three main types of selectors: Element HTML tags such as: <p>, <h3>, <div>, <body>, <img> The body tag <body> is a key element. It sets the default style for the whole page. .Class Creates a special look for blocks of HTML text. On your HTML page, you can use a .class tag within a <div> tag to give a special look to a section of content. Or, you can use it within a <p> tag to give a special look to a paragraph. #ID Is set up and applied like the .class tag, but can only be used once on each HTML page
Grouping selectors
You can group selectors (separate each with a coma) and set their properties at the same time:
h1, h2, h3, h4 { color: #000099; }
<p style= "font-family: Times New Roman; font-size: 12pt; color: fuchsia" > Now is the time for all good men to come to the aid of their country </p>
Span tags
<span> tags affect local text, like the character tags used in FM. Example of a span tag used in HTML code:
<p>Stop if you see a <span class= "warning">Danger</span> sign.</ p>
Result on HTML page: Stop if you see a Danger sign. How the class style maybe defined in the CSS:
span.warning { color: #CC0000; }
Heres the result on the HTML page displayed by the browser: The sun was shining on the sea, Shining with all his might. But if you wrap your HTML text in a special element tag named <pre>, all the white space, including spaces, tabs, and returns, is included on the output HTML page. Example of a <pre> tag in used in HTML code view of the text:
<pre> The sun was shining on the sea, Shining with all his might. </pre>
The sun was shining on the sea, Shining with all his might.
2.
3.