CSS Flashcards
How do you create a new font to use in a website?
@font-face {
font-family: emulogic;
src: url(“../fonts/umulogic.ttf”);
}
NOTE: If using firefox, the font has to be in the same folder as the css.
Having created a new font called emulogic, how would I apply it to all elements on the page?
- {
font-family: emulogic;
}
What is the order of applying stylesheets?
External, internal, then inline style elements
What are the two types of element that are often used to apply CSS to content of a webpage?
span and div
What CSS attribute would you use to make text indent a little?
p {
text-indent: 2em;
}
What is the difference between p.first and p .first?
p.first means choose a paragraph that has the class first.
p .first means choose an element within a paragraph that has the class first.
What does ex and em measure?
ex typically measures the height of an item in a web browser (ex is height of lower case x)
em typically measures the width of an item (em is the width of an uppercase M).
Suppose a 1px black box is placed around text, padding adds space where?
Inside the content box
Suppose a 1px black blox is placed around text, margin adds space where?
Around the outside of the content box
What are the four kinds of positioning in CSS?
Absolute, relative, float and fixed
Why would you set the containing div as a relative?
Because it needs to be a positioned block to qualify as a container - this must be either Relative or Absolute
Why do you not have to specify the top / left position in an outer containing block if you have set it to relative?
By setting it to relative, it behaves like a “static” block, but positioned. So it will automatically take the 0, 0 position on the page - then just specify width / height
Absolute on an object means the positions are relative too…
the boundaries of the containing object.
What attribute can I specify to set the order of rendering on a page?
z-index: 10;
Is relative positioning good for laying out blocks of text?
Not really - absolute positioning is probably better.