CSS Flashcards
Css syntax
Selector {attribute:value;attribute:value;}
Synthax to add a comment
/* comment text */
Simple selector
An HTML element (i.e. div)
Id selector
idname{
declaration;
declaration;
}
Class selector
.classname{
Declaration;
Declaration;
}
How to select a class of an element?
p.classname{
declaration;
}
Is it possible to apply more than one class?
Yes
<p></p>
Universal selector
*{
Delclaration;
Declaration;
}
The rule will affect every html element on the page
Group selectors
h1,h2,h3,p {
Text-align:centre;
}
How many ways are there to insert CSS?
EXTERNAL CSS style sheet
In case of rule conflict which one applies?
Last rule read will apply
Dependind on the order, usually:
- Stylesheet
- Style tag
- Inline style
Browser default shall apply where the above are missing
Attribute color
Changes font color
Attribute background-color
Modifies background color
Attribute border
Border:2px solid color
Color: r g b a
What alpha determines?
Determines transparency
Values 0.0 to 1.0
Border-style values
Dotted Dashed Solid Inset (form) Outset (button) Mixed (...)
How to set border width?
Border-width:value in px/cm/em;
Define border color
Border-color: value;