CSS Flashcards
How to add CSS styles
How to add CSS styles
place text in center of page
text-align: center;
place text in center of page
text-align: center;
CSS syntax
h1 {
color: aquamarine;
}
CSS commands
Color: ; background-color: ; text-align: ; font-weight: ; text-decoration: ; letter-spacing: ;
how to add a font type in CSS
font-family: add a few in case browser doesn’t support
how to add opacity in rgb for a background color
rgba(255, 255, 255, 0)
last number is 0-1
how to add opacity to an entire element
{
opacity: 0.3;
}
(opacity is 0 to 1?)
how to add opacity to a bakcground color in hexidecimal
last part of hexidecimal is from 00 for completely transparent to FF for not transparent at all
designate position on document and options for position
position: relative
relative, static, absolute, right, left
position that keeps an element in the same area regardless of other things like margins etc
static
allows you to put top and left relative to where it normally would be…
relative
to remove element from normal doc flow and no spaces for element & position relative to closest ancestor (means that it stacks the element on top of anything else that may be there)
absolute
to remove element from normal doc flow and no spaces for element & position relative to initial containing block (so if you scroll on page, it will stay for example floating at top of screen)
fixed