Day 6 - CSS basics pt.3, functions, classes
by Nino · 19 things on Twos
- img {width: 100;} = fits image to full width
- padding-left: 5%; = can use percentage
- display: flex; = tells the container to use flexbox
- justify-content: center;
- height: auto;
- Child elements
- non-transferrable properties: border, padding, margin
- transferrable properties (inheritance): color
- change an inherited property by overriding it
- you can write multiple classes to combine multiple styles in HTML
<p class="color italic bold"></p>
- p, button, .offer {font-family: courier;} = styling multiple elements with the same rule, separated by comma
- class vs id
- .announcement>a {
color: white;
}
// wtf is this
- Adding gradient in another way (ask ChatGPT)
- background: linear-gradient(90deg, #46477A 25%, #6A6CBA 75%);
- background-image: linear-gradient(to right, #46477A 25%, #6A6CBA 75%);
- —-
- Mimo: semi-completed (8. CSS Classes)