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
What is the purpose of a CSS selector?
Selectors are used for declaring the HTML elements to which a style will apply
What are the most common selectors?
1) All elements with a specific HTML tag (e.g., p,h1)
2) Elements specified by the following attributes:
ID (these are preceded by # in CSS)
class (these are preceded by . in CSS)
What is a declaration block and what does it contain?
A declaration block is a list of declarations contained within braces. Each individual declaration consists of a property, a colon :, and a value.
Note: If there are multiple declarations then they must be separated by a semi-colon
What is the internal priority for CSS?
element (1 pt) .class (10 pt) #id (100 pt)
Width and height styling elements can be expressed in ?
Pixels and percentage. If you are working with static content, then px is suitable, but if you are working with responsive design, you will want to use %
What is the purpose of styling element overflow?
Content inside of a container is too much for the container size. You can, hide, show no matter what, or scroll bar
What are some of the background properties that can be modified?
background-color, background-image, background-position, background-size, background-repeat