CSS Flashcards
(39 cards)
This describes how HTML documents are to be rendered on screen.
CSS (Cascading Style Sheets)
CSS makes use of _________ (except in inline style) to specify which element/s to apply style to.
selector
in selector
to select id
. in selector
to select class
main.text
combination of both id and class
main .text
refers to the child element of ‘main’ that have the class ‘text’
main > .text
refers to the direct child element of main that has class text.
class=”one two”
has two class name = one, two
.one.two
select tags that have both the one and two class name.
.one, .two
refers to multiple elements that have either one or two as class name.
3 ways to declare CSS in HTML
- Inline styling
- Internal style sheets
- External style sheets.
How to add an external stylesheet to html?
<link rel”stylesheet” type=”text/css” href=”style.css
CSS allows several style sheets to ________________ of a document (hence Cascading).
influence the presentation
Factors in Cascading:
- Importance and Origin.
- Specificity
- Source Order
The style of any element has 3 possible origins:
- Author
- User
- User-Agent
This origin of CSS is provided by the webpage author.
Author
This origin of CSS is due to browser settings as configured by the ______.
User
This origin of CSS is the default type sheet of the rendering engine.
User Agent.
By default, styles originating from the author take _______ over User and User Agent Styles.
precedence
________ declarations take precedence over non-important ones.
!important
For conflicting rules of similar weight, the ________ is applied.
last rule (source order)
!important declarations also ___________ the order of precedence by origin.
order
Specificity is determined by ____________________ of tags ,classes, id, attributes, etc., in the selector.
counting the number
The most ________ selector takes precedence
specific