Personal Webpage is due tonight at 11:59PM!
From lecture, we learned Cascading Style Sheets (CSS) are used to define the way a browser will display a webpage.
A wonderful resource to look at is w3schools.com because they lay out for you the different pieces that make up CSS.
If you can't remember the name of a specific attribute or what options there are for one, look it up! We don't expect you to memorize every single one, but commonly used ones are good to know.
Remember, you can also look at website's CSS if you're ever curious what they did for cool elements. Be warned, some of these files aren't organized well.
Having a separate file for CSS helps the organization of your code and reduces redundancy for your webpages. Let's add some CSS to our recipe page.
All of your CSS code will go in here. However, it will need to be linked to your HTML file.
Typically, CSS references are within a "head" tag. Within "head", add a "link" tag and insert the following into your
Let's change the font style of our recipe. In your new CSS file, add the following:
This will tell the browser that the preferred font is Arial Serif. If it's not available, it will display using Helvetica Serif.
Now, let's change the background color.
Change the color into anything you want. (CSS color picker)
Headings are great on their own, but adding a bit of CSS can make them pop out!
If your "h1" instance is not in your "header" tag, replace "header" in the above code with the correct element tag.
Define similar elements with the "class" attribute. Anything in the same class with be formatted and display with the same style. "id" is used to define an element with a unique style. Both id and class can also be used for similar and unqie actions, respectively, with JavaScript.
If you wanted to specify the ingredients list of your recipe differently than the instructions you need to specify the id/class in the CSS file: