CSS Flashcards
Inline, Internal, External CSS
Inline - defined in the same HTML tag
Internal - defined in the HTML header and within style (open+close) tag.
External - External stylesheet linked to HTML in the header.
External CSS is the way to go, Internal and Inline CSS are frowned upon.
Priority
Inline CSS»_space; Internal CSS»_space; External CSS
Debugging CSS
Usually its an exercise between looking at browser console and checking if the elements that you are targeting are changing appearances.
Most of the time, its either syntax error, or pointing to the wrong file location.
CSS selectors
class = “some-class -here”
id=”some-id-here”
HTML tag itself.
These are defined in HTML (not in CSS) and can be used to target specific elements in CSS.
To target class - .some-class-here { }
To target id - #some-id-here { }
To target a HTML tag - body { }
Favicons
Inserted at the header of HTML.
Used to give your web page an icon that shows besides your web page title.
Also uses a ‘link’ tag with a rel=”icon” tag after it.
Positioning
Static, Relative, Absolute, Fixed and Sticky.
display property CSS
Block, Inline-block, Flex, none.
color font-weight line-height font-size letter-spacing text-transform
All of these affect the fonts in HTML.
z-index
Manually declare height of an HTML element when they have been POSITIONED.
Media query
@media (query-without-brackets) and (condtions-w/o-brackets) and so on
{ code here }
Combining selector
.class-name1 .class-name2 - this selects the class with class-name2 inside class-name1
HTMLtag.class-name - this selects the HTML tag with the class name as ‘class-name’
.class-name1 ~ .class-name2 - Selects all the class with name .class-name2 coming after .class-name1.
Selector Priority
id»_space; class»_space; HTML tag.