CSS Flashcards
h1, h2, p {
text-align: center;
}
aligns to center of page
id value
selected to target a specific element with an id attribute
/* */
creates a comment
margin-left: auto;
margin-right: auto;
margin as invisible space around an element.
.class
another way to link <div> to css
background-image: url()
sets background image
.item p {
display: inline-block;
}
displays code on the same line even if they are different paragraphs
padding-left,right,bottom,top
gives some space between the content and the sides.
max-width
prevent width from growing too wide.
font-family
allows you to change the font
What is this doing?
font-family: Impact,serif;
Acting as a allbacks are used in instances where the initial is not found/available.
font-size
size of text
border-color
changes color of border
a:visited {
color: grey;
}
changes the color to grey when page is visited.
a:hover {
color: brown;
}
if you hover over a text it will change the color to brown
a:active{
color: white;
}
changes link color to white if link to clicked.
what do the inputs mean hsl(240,100%,50%)
hue of color wheel, saturation and lightness
rgb(200,13,45)
mixed of red green and blue on rgb wheel
linear-gradient(90deg,hex,rgb or hsl)
allows to add a gradient of two colors on each side and joins them together
opacity
transparently of an item 0% is solid and 100% see through.
border-left
shorthand property lets you to set the left border’s width, style, and color at the same time.
Here is the syntax:
border-left: width style color;
box-shadow
box-shadow: offsetX offsetY color;
property lets you apply one or more shadows around an element.
offsetX
a positive offsetX value moves the shadow right and a negative value moves it left
offsetY
a positive offsetY value moves the shadow down and a negative value moves it up
rem
The rem unit stands for root em, and is relative to the space inbetween new lines of while using the display: block in css html element.
1,2,3,em
In CSS (Cascading Style Sheets), em is a unit of measurement which indicates size relative to the size of the font. 1em means “equal to the current font size”, and 2em means 2 times the current font size.
vh
stands for viewport height, and is relative to 1% of the height of the viewport.
vw
vw stands for Viewport Width and represents a percentage of the width of the viewport. The number placed before vw is the percentage of the width of the viewport this length will be. For example if you wrote 10vw then this would represent a length of 10% of the width of your viewport.
unset
un does what was done in a different css style
p:last-of-type { }
That will select the last p element. Create a new selector that targets the last element of p
Overflow: hidden
changing the element back to its original dimensions.
filter: blur(2px);
adds a blur filter
transform: rotate(-0.6deg);
rotate it counter clockwise by 0.6 degrees.
box-sizing: can add border-box or content-box ;
does a box around your item you want
text-transform: uppercase, lowercase ;
allows you to change text to upper or lower case
Flexbox
display: flex;
Flexbox is a one-dimensional CSS layout that can control the way items are spaced out and aligned within a container.
flex-direction: row, row-reverse, column, column-reverse ;
The main axis is defined by the flex-direction property, which has four possible values:
row (default): horizontal axis with flex items from left to right
row-reverse: horizontal axis with flex items from right to left
column: vertical axis with flex items from top to bottom
column-reverse: vertical axis with flex items from bottom to top
Note: The axes and directions will be different depending on the text direction. The values shown are for a left-to-right text direction
flex-wrap: wrap, nowrap;
The flex-wrap property determines how your flex items behave when the flex container is too small. Setting it to wrap will allow the items to wrap to the next row or column. nowrap (default) will prevent your items from wrapping and shrink them if needed.
justify-content: center,left,right space-between;
allows you to align the flexbox
align-items property
The align-items property positions the flex content along the cross axis.
object-fit: cover;
object-fit property to determine how images should behave.
property and set it to cover. This will tell the image to fill the img container while maintaining aspect ratio, resulting in cropping to fit.
The gap property and its row-gap and column-gap
provide this functionality for flex, grid, and multi-column layout.
border-radius
smooth out edges
::after{}
The ::after pseudo-element creates an element that is the last child of the selected element.
*
used to select all elements
font-weight
makes font a lot darker
letter-spacing
property can be used to adjust the space between each character of text in an element.