Basic CSS Steps
BASIC CSS STEPS
Here is how you can start using CSS!
Fist to create a CSS file, simply go to "save as...". Save the file as .css.
Be sure to save the CSS file with your HTML files!
To link the CSS file to your HTML file, type this inside your head tag: link rel=â€stylesheet†type=â€text/css†href=â€styles.cssâ€
^^ Remember to put arrows around it! Every page that will use CSS has to have that header! ^^
The syntax in CSS is different than what it is in HTML. HTML uses arrows, while CSS uses curly brackets and semi-colons are used at the end of each line.
CSS is pretty straightforward. Here is how you can make your website unique:
- Select a section of your website that you would like to add CSS to.
- Go to your CSS page and write the name of the section. For example: body, p, head, div class, etc.
- Put curly brackets: { }
- Inside of the curly brackets, state what you would like to change. For example: (text) color, border color, border style, background color, etc.
- Put a color after the statement.
- State what color, size, style, etc you would like.
- Place a semi-colon at the end before the ending bracket.
- Optional: make the code look neat!
Now you can experiment! Let's Practice!
Here are some challenges:
- Try to make the background green!
- Make something have a blue solid border around it!
- Make the border dotted!
- Make a background color have an opacity of 0.3!
Below are the answers: