ul {
list-style-type: disc;
}
ul.problems {
font-size: smaller;
}
.optional {
color: gray;
font-style: italic;
}
p#copyright {
font-weight: bold;
color: red;
}
what would you do if you want to modify
emphasized text that is in headings but not elsewhere,
or only list items in ordered lists but not unordered ?
h2 a {
color: black;
}
ol li {
margin-top: 1em;
}
The selector "ol li"
will select any <li>
that is inside an <ol>
element but not other list items
a:link {
color: blue;
}
a:visited {
color: purple;
}
a:active {
color: red;
}
ol>li {
list-style-type: decimal;
}
ul>li {
list-style-type: circle;
}
this CSS will change the appearance of list items that are immediately within <ol>
s and <ul>
s
ul.ingredients li {
color: green;
}
ul.ingredients li.optional {
color: blue;
}
a:link.external {
color: yellow;
}
by far we have seen "color"
, "background-color"
, and "border-color"
which are using different color values, lets learn more about these values.
the physical paint (used to draw paintings) removes parts of the reflected light
(usually the original color of light is white!)
from the surface of the painting canvas,
main colors:
computer screens do not reflect the light, they produce it!
they start from black, and add colors to it to make the desired color,
main colors:
#
Code | Colour | Rationale |
---|---|---|
#000 | black | as dark as possible |
#fff | white | as bright as possible |
#f00 | red | only red light |
#0f0 | green | only green light |
#00f | blue | only blue light |
#060 | dark green | a little green, no red or blue |
#99f | light blue | more blue than the others, closer to white |