CSS Basics Flashcards
What does CSS stand for
Cascading Style Sheets
What is CSS
CSS is a language for describing how documents are presented visually.
Write a CSS Rules
selector {
property: value;
}
How do you make all H1 elements on a page purple?
h1 {
color: purple;
}
Make all image elements 100pixels wide and 200 pixels tall
img {
width: 100px;
height: 200px;
}
What is best practice to connect CSS file to html?
element is used to link css to html. It goes in the head section of html file.
Name a few ways to represent color (text) property in CSS
color: indigo;
color: #56ff00;
color: rgb(255,255,100);
What is background-color? How would you change the h1 element background to red?
Changes the background color of selector.
h1 {
background-color: red;
}
For RGB what would be the code for white? black?
White = rgb (255, 255, 255) Black = rgb (0, 0, 0)
How do you represent Hexadecimal (hex) colors?
red = #ff0000 green = #00ff00 blue = #0000ff
How do you set the horizontal alignment of text in an element?
text-align: left/right/center/justify;
*sets the alignment of text within an element.
How do you control the boldness or lightness of a given piece of text?
font-weight: normal (400);
font-weight: bold (700);
font-weight: 100;
How do you manipulate the appearance of decorative lines on text?
text-decoration: underline; text-decoration: underline solid; text-decoration: underline dotted red; text-decoration: green wavy overline; text-decoration: double line-through; text-decoration: none;
How to change the height spacing between text?
line-height: normal;
line-height: 2.5;
line-height: 150%;
line-height: 35px;
How do you control spacing between letters?
letter-spacing: 10px;
letter-spacing: normal;