COMP 10 CSS - Copy
COMP 10 CSS - Copy
COMP 10 CSS - Copy
p.three { p.four {
border- border-
style: dotted; style: dotted;
border- border-
width: 2px; width: thick;
} }
CSS Border Color
The border-color property is used to set the color of
the four borders.
The color can be set by:
•name - specify a color name, like "red"
•HEX - specify a HEX value, like "#ff0000"
•RGB - specify a RGB value, like "rgb(255,0,0)"
•HSL - specify a HSL value, like "hsl(0, 100%,
50%)"
•transparent
p.two {
p.one {
border-
border-
style: solid;
style: solid;
border-
border-color: red;
color: green;
}
}
p.three {
border-
style: dotted;
border-
color: blue;
}
Specific Side Colors
The border-color property can have from
one to four values (for the top border, right
border, bottom border, and the left border).
p.one {
border-style: solid;
border-color: red green blue yellow; /* red top, green right, blue bottom and yellow left */
}
CSS Border - Shorthand Property
With CSS, you have full control over the margins. There
are properties for setting the margin for each side of an
element (top, right, bottom, and left).
CSS Margins
p{
margin-top: 100px;
margin-bottom: 100px;
margin-right: 150px;
margin-left: 80px;
}
Margin Shorthand
p{
margin: 25px 50px 75px 100px;
}
CSS Padding
The CSS padding properties are used to generate
space around an element's content, inside of any
defined borders.
With CSS, you have full control over the padding.
There are properties for setting the padding for each
side of an element (top, right, bottom, and left).
CSS Padding
div {
padding-top: 50px;
padding-right: 30px;
padding-bottom: 50px;
padding-left: 80px;
}
Padding Shorthand
div {
padding: 25px 50px 75px 100px;
}
Criteria
Coding 5%
Validation
Cascading Style 5%
Sheet
Content 5%