Cascading Style Sheets Flashcards
What are the two aspects to adding style to a web page via CSS?
Declaration & Selector
Tells the browser to apply the declared style to the HTML <body> element.
Selector
The most basic kind of CSS selector. It selects every instance of the corresponding HTML element.
Simple type selectors
Selects all elements on a page and can be used in combination with other selectors.
Wildcard selector
You can apply the same declaration to a group of selectors by listing all of the desired selector names separated by commas.
Grouping selectors
What are the two naming options for an HTML element?
ID names & Class names
The syntax is similar of that to Grouping selectors, but without the commas.
Descendant (Nested) selectors
The associated style selectors.
Hyperlink (or “anchor) pseudo-class selectors
What is the correct order when styling hyperlinks?
a.link
a.visited
a.hover
a.active
Lo Ve H A
A more specific selector beats out a less specific selector.
Cascading
What if there is a “tie” regarding how specific the selectors are?
In a tie, the last-defined selector wins.
How/Where do we add the style declaration to our HTML files?
- Internal Stylesheet
- External Stylesheet
- Inline Style
Put the style declarations in the <head> of HTML text file. Also known as “Embedded” or “Global”.
Internal Stylesheet
Put the style declarations in a separate text file and then import that text file into your HTML file.
External Stylesheet
Simply put the style declaration within the HTML tag when it is used.
Inline Style
Refers to the layout of the items on your page. Also refers to the “position” descriptor in CSS rules.
Positioning
Controls the transparency of an element and determines how much of a hidden element’s content is visible.
Opacity
We can make an element’s background partially transparent but keeping the text inside visible by setting the element’s opacity property to a value between _ & _ ?
0 and 1
Is used to specify the space between the content of an element and its borders.
Padding
It is a technique for creating page numbers for a website, which allows users to easily navigate between large amounts of content.
Pagination
To create a pagination element in HTML, you can use either of these two elements.
<div> or <ul>
</ul></div>
Determines the appearance of the mouse cursor when hovering over an element to which this property is applied.
Cursor property
Is used to set the color of the text.
Color property
The default text color for a page is defined where?
Body selector