CSS Basics and Setup Flashcards
In the CSS folder what do you put to stylistically change the tag?
(Tag Name, e.g. span) {
(Style Attribute: choice; , e.g. color: red;)
}
How do you link an HTML sheet to a CSS sheet?
Put “” in the “ “ tags.
How do you write a comment in CSS?
/Comment goes here./
How do you put CSS in an HTML document without using inline CSS?
Use style tags “ “ (different from the style attribute) in the head tags “ “ and put CSS in them. Note: You do not need a CSS Link
What do you do if you want a more complicated color like medium dark red or light magenta?
Use a hexadecimal value instead of a color.
Make sure you use the pound (aka hashtag sign) before the value.
For example: color: #ff0000;
Note: The values are case-insensitive so F = f.
Find the one you need here: http://bit.ly/36KFwk
What do you do if you want text to adjust to the screen instead of staying the same size?
Use “em” instead of “px”.
Note: 1em is the same as the default text size on the machine on which it is being read.
What fonts can all devices see?
serif - Sort of like D’Nealian
sans-serif - Sort of like block
cursive - It is, of course, cursive
How do you put backup fonts in CSS?
You separate the with commas in order from most preferable to least preferable.
Note: Always use the default you want some where in there
For Example:
color: Veranda, Futura, sans-serif;
What three properties should divisions have?
background-color, height, and width Ex. div { background-color: #ff0000; height: 50 px; width: 50 px; }
What property can you use to set borders and how do you use it?
border: #px solid/dashed color Ex. table{ border: 2px dashed #ff0000; }
What property do you have to change so you can customize links and how do you change it?
Set the property "text-decoration" to "none" Ex. a { color: #ff0000; text-decoration: none; }
What do you do to have your selector be only things nested in certain HTML tags?
List them in order of broad to the specific one you want.
Ex. div p span {
color: red;
}
This only effects span in paragraphs in the division tags.
What selector can you use to select everything?
- (astrus)
Ex. * {
background-color: #ff0000
}
What happens if you have a general selector (ex. p) telling paragraphs to do something and a specific selector (ex. div p) telling them to do something else?
CSS will follow the most specific selector, however it does follow the general selector when it does not coincide with the more specific one.
Ex. p would apply to all paragraphs except for ones in dividers if div p was another selector
What do you need to select a tag directly inside of a tag instead of any type of that tag that is inside of that tag?
Ex. <ul> (“<div>”) <p> (</p><div>) (</div>) <p> (“</p></div>”) </ul>
ul div gets what is in parentheses, however you just want what is in quotations, directly after ul
> (the greater than mark)
Ex. ul > div {
background-color: #ff0000;
}