CSS Flashcards
Advantages of seperate CSS stylesheet
- Much easier site maintance
- Greater typography and page layout control (general pro)
- Potentially smaller documents
- Can act as template for many webpages
Anatomy of CSS selectors
Stylesheets are composed of “Rules” that describe the styling to be applied.
Each rule has the following composition:
types of CSS selectors
– HTML element name selector
– class selector
– id selector
– contextual selector
block vs inline elements (+ examples)
block elements
— start on a new line
— take full width available
— browser sets margin between block elements
— < div >, < p >, < h1 >, < form >
inline elements
— do not start on a new line
— take only necessary width
— must be nested inside a block element
— < span >, < img >, < a >
float property
- a floating element is removed from the document flow
- it hovers inside a container; can be left, right, or none
- floating elements should have a width property, otherwise content may be unable to wrap around the floating element
clear property
disallows floating elements from overlapping this element; can be left, right, both, or none (default)
definiton of overflow property + 4 values
specifics what to do when element’s content is too large; can be auto, visible, hidden, or scroll
how to set up a multi-column layout
4 types of CSS positioning
static position: no special position; positioned according to the normal flow of the page and is unaffected by top, bottom, left, and right properties; the default
relative position: relative to its normal static position. Setting the top, right, bottom, and left properties of a relatively-positioned element will displace it from its normal static position.
absolute position: fixed position within containing element (nearest positioned ancestor). If no positioned ancestors, it uses the document body, and moves along with page scrolling.
fixed position: fixed position within browser window; sticky; element stays same place if page scrolled; can be top, right, bottom, and left; relative to viewport
what is optimal hierarchy in the process of layout
- alignment
- float
- position
Details about inline boxes
use it sparingly, because it can radically alter you webpage
how can we control the viewpoint and what is the effect
one tool for CSS troubleshooting
Online CSS Validation
What is Bootstrap?
A free front-end framework for faster and easier web development
Includes HTML and CSS based design templates, as well as optional JavaScript plugins
Easily create responsive designs
Why Use Bootstrap?
Easy to use: only basic HTML and CSS required
Responsive features: adjusting to phones, tablets, and desktops
Mobile-first: mobile-first styles are part of the core framework
Browser compatibility: Bootstrap is compatible with all modern browsers