CSS Flashcards
CSS makes a website ___
Pretty (the designer of the website)
Colors, font, spacing
CSS stands for ___
Cascading Style Sheet
100% when using CSS you need to have this tag
selector (element you want to change {property (color, etc.): value (what you want to change it to);}
IT MUST ALWAYS BE IN THE HEAD
Give an example of using color for h1 using css
h1 { color: red; font-family: arial;}
How to get more spacing in paragraph lines?
p {line-height: ;}
what does:
background-image:url(file.type);
background-repeat: no-repeat;
Background image and no repeat for text/css (mostly used for the body)
Four characteristics of elements (box model):
text, padding, margin, border
How many styles can a link have?
4 link styles for the different states. the states are:
1) Link
2) visited
3) hover
4) active
How do you make a css rule just affect one part of an element?
<span> text </span>
In the head, you give span it’s style properties
How do you create unique styles for elements? How to give different styles to div?
using CSS, use ID’s
In header, use #IDNAME to create an ID
Then go to element, and add id = “IDNAME”;
What does this represent in CSS: p > a?
paragraph is the parent and a is the child
How do you apply style to only a specific part of an element?
You’ll have to use pseudo elements
p: first-letter {}
How do you link to an external style sheet?
Note: Useful for multiple pages. GET RID OF STYLE TAGS WHEN USING. Remember the saved file you are referencing should be a .css file.
What is the difference between absolute vs relative positioning?
Absolute is from the top left and relative is from the original position relative
How to create a basic form>
Name:
What are the three ways of attaching CSS to a document?
Inline, Internal, External. Inline and internal CSS are considered to be bad practices.
What is a stylesheet?
List of rules. Each rule or ruleset consists of one or more selectors and a declaration block