CSS Flashcards
where does CSS go ?
in a separate file.
how to link CSS in a separate file?
put in the head
<link></link>
what is the whole thing called? :
p {
color:red;
font-weight:bold;
}
a rule
in :
p {
color:red;
font-weight:bold;
}
what is p called?
the selector (the element we want to style.)
in:
p {
color:red;
font-weight:bold;
}
what is whats between the brackets called?
a declaration block composed of declarations
what is a declaration composed of?
a property and value pair.
what does the Cascade mean ?
CSS is read from top to bottom but what is below can override what is above.
what does CSS stand for ?
Cascading Style Sheet.
why do you use many fonts in css ?
backup
where do we link our google fonts?
before our stylesheet
how to turn code into comment on CSS?
select and ctr+/
how to underline text on css ?
text-decoration : underline;
how to change the size of a text in CSS?
font-size: ?px;
how to select an element that is the direct descendant of another element?
parent > child
how to select an element thats is the child but not the direct descendant of an element?
parent child
how to select an element that is the direct sibling of another element?
element + element (it only works if it has a sibling above it)
how to select one distinct element?
id syntax: #id (elements can only have one id, there can oly be one id of the same value in the document.)
what are classes for?
they are for selecting multiple elements syntax : .className
what is specificity
tags classes ids and other have points, to override a rule with a certain specificity you need the same or more value
how many points of specificity does tags classes and ids have?
tag: 1 classes: 10 ids:100 other(inline !important):1000
what is the box model ?
every element is a box composed of the element + padding+border and a margin bully to push it around
how to apply margin or padding on the top and botom only?
padding 10px 0; it read clockwise starting from the top
how to center an element?
margin: 0 auto;
how to clear an element for floats?
clear:both;
- element, allows a list to appear in reverse order.