Paste the code below into your week3/index.html
<!DOCTYPE html>
<html>
<head>
<title>Week 3 - CSS Practice</title>
</head>
<body>
<div id="content">
<h1>My First CSS Styled Page</h1>
<hr />
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi et arcu ultricies, vehicula urna ut, lacinia metus. Aenean ac ante odio. Nullam mollis scelerisque urna, eget interdum velit posuere vel. Nullam eu leo ac ipsum tristique scelerisque. Nullam lobortis consequat arcu, id maximus erat sagittis eget.
</p>
</div>
</body>
</html>
Now that we're set up let's commit and push the changes to your repo.
Think of each element on your page as a box. The box model outlines the structure of each box or HTML element on your page, and various components available to you.
The padding is the space between the content of your box and the border.
The margin is the space between the border and the content around the box.
The border is the containing walls of the box.
The original IE box model calculated the width property of an element by including both padding and the border. The CSS box model, which came into favor, calculates the width of the content only. However, this can be frustrating, so CSS introduced a property called box-sizing that allows you to revert to the IE model by defining box-sizing: border-box;
h1 {
margin-bottom: 12px;
color: #fff;
}
There are three ways to apply CSS to your page.
Anything you add into your stylesheet could also be added into the style tags in head.
But style tags do not go in your stylesheet - they are HTML, only CSS rules go in your stylesheet.
Indicates which element(s) the rule applies to
If two or more rules apply to the same element the one that takes precedence is either:
Child elements, unless specificed in the styles, will usually inherit a style from their parent or container element. You can also declare inherit as a value to any property.
Add the following to your page in your <style> tags. Make sure to be specific about the tags you are targeting.
Add the following rules to your page styles (choose fonts here or use Google):
Can be added to the end of your selector for more control.
This references styling the parts included in the box model.
A property that controls what happens to content that doesn't fit inside of the box. By default, overflow: visible;
Set exactly like margins, except the property name is padding
Same principle as in HTML, you use these to write notes to yourself or anyone who is looking at your code.
/* CSS Comment Here */
Pick at least one story you've read/watched/interacted with this week and post it in the class Slack with a sentence or two about what you like or didn't like about it. It should be a piece that you appreciate beyond the topic or how well it's written (though that counts too!): Does it integrate photos well? Do you think it's confusing to use? Is it too bogged down with video? Did you like the way the chart explained a confusing topic?
Create rules for your color and font choices. These will be the starting points for your project (you can always change them later).
For example, if you want the background of your page to be blue, you would write:
body{ background-color: blue; }
Add/Commit/Push your changes and send me a DM in Slack with the link to the stylesheet on GitHub.
Use these properties to further perfect your design: