- CSS is not intuitive. So, give it time and welcome to the party.
- CSS is cascading. Meading the last style overwrites everything before it. CSS goes in order from top to bottom
- tag
divwould select alldiv - class
.cakewould change all elements of<div class="cake"></div> - id
#chocolatewould only select one<div class="cake" id="chocolate"></div>
- select
.cake > .layerwould select on the layer in the cake
<div class="table">
<div class="cake">
<div class="layer">this one</div>
</div>
<div class="layer"></div>
</div>
- select
.cake + .layerwould select on the layer in the cake
<div class="table">
<div class="cake">
<div class="layer"></div>
</div>
<div class="layer">this one</div>
</div>
There are a few ways you'll see colors definded:
Literal
color: red;color: blue;color: green;
HEX (hexadecimal)
color: #f00; /* red */color: #001aff; /* blue */color: #2f0; /* green */
RGBA (red green blue alpha)
color: rgb(255, 0, 0); /* red */color: rgb(0, 26, 255); /* blue */color: rgb(34, 255, 0); /* green */
There is a method to the madness, but you'll be happy to know there are color pickers to help you.
Here are some of the lists of properties you'll see in the wild. You'll want to use these a good bit.
p {
font-size: 18px;
font-family: sans-serif;
color: #333;
line-height: 1em;
}
.service {
border: 1px solid #333;
padding: 10px 14px;
margin: 0;
width: 100%;
height: auto;
background-color: #fff;
}
Head to CodePen.io
stage 0 - Hello, World Wide Webstage 1 - Let's learn HTMLstage 2 - Beautiful pages with CSS- stage 3 - Sketch your idea
- stage 4 - Bootstrap for speedy design
- stage 5 - Build your site
