HTML and CSS Reference
In-Depth Information
code {
color: gray;
10. To display the <dfn> elements in italic in Chrome and safari, amend the dfn style
rule like this:
dfn {
color: maroon;
font-style: italic;
11. By default, browsers display paragraph text at 16 pixels. Change the font size in the
paragraphs like this:
p {
font-size: 14px;
12. save the style sheet, and reload basic.html in a browser. As Figure 2-4 shows,
the text in the paragraphs is smaller, but the size of the headings and list items is
Figure 2-4. Changing the font size of the paragraphs doesn't affect the other text
You'll continue making improvements to the look of this page in the remaining exercises
Styling Links
Links are created using the <a> tag in HTML, so you can use a type selector to control the look of links. For
example, the following rule makes links bold and red:
a {
font-weight: bold;
color: red;
That's fine as far as it goes, but it means that links will look the same, regardless of whether they have been
visited or when the mouse passes over a link. The answer is to use pseudo-classes to define how you want links to
look dependent on their interactive state. You add the pseudo-class immediately after the type selector like this:
Search WWH ::

Custom Search