On Github rwagner00 / Wounded-Warrior-Part-3
Ryan Wagner
Fancy Definition: A div is the basic structural element of any web page. It's used to define a division in a document.
Source: w3schools.com
Talk briefly about w3 schools, great resource.Courtesy: http://www.qualityquotes.co.za/
<div> <h1>This is a header!</h1> <p>This is some text under the header!</p> </div> <div> <h2>This is a sub header.</h2> <p>The sub header is less impressive.</p> </div>
Technical Definition: The <span> tag is used to group inline-elements in a document.
My mother has blue eyes.
My mother has<span style="color:blue">blue</span> eyes.Note here that they've just seen their first bit of CSS. The style="color:blue" is an inline style that changes the color of the text.
Using Divs, headers, paragraphs, and spans, create a basic page that looks like this:
Cascading Style Sheets is a style sheet language used for describing the presentation semantics of a document written in a markup language
Credit: hyperboleandahalf.blogspot.com
Discuss briefly how CSS makes things pretty.In practice, CSS is a sheet(s) that provides styling to specific elements on a page.
CSS needs to be able to target the element, and it does so generally through one of three ways.An ID takes the following form:
<div id="hero">This is really important!</div>
Use an ID on something you only intend to have one of per page.
A CSS class looks a lot like an ID:
<div class="tinted"> This Div is probably tinted. </div>
Classes are used in cases where you intend to use that styling multiple times.
ID's and Classes can be combined for fun and profit. You can even have multiple classes on the same element.
<div id="important" class="tinted bordered transparent"> The content of this div will have the CSS from all of the classes and the ID on it. </div>Spans can have all the same classes and divs applied to them that Div's can.
A type selector is simply targeting everything of a specific type. <h1>, <p>, <div>, and <span> are all examples of things that can be universally targeted.
Paragraphs are very common universal targets of styling. Other examples.Using the previous example, apply the hero id to the first div, and then apply the classes tinted and bordered to the divs in any combination you want.
<style> #hero { color: orange; } .tinted { background-color: gray; } .bordered { border: 1px solid black; } div { margin: 10px; } </style>Note that there are many, many CSS properties you could apply, provide examples. Note the different properties here. We can now set a background color, a text color, a border, and opacity.
Importing an external sheet is the most popular way to get CSS onto a page.
<link rel="stylesheet" type="text/css" href="my-styles.css">
Create a new document called "my-styles.css", and use the code
<link rel="stylesheet" type="text/css" href="my-styles.css">to import it to your page. When done, populate the sheet with the following:
#hero { color: orange; } .tinted { background-color: gray; } .bordered { border: 1px solid black; } div { margin: 10px; }
Using everything you've learned so far, create the following.
Hint: The borders are 5px and divs have a 10px margin.
Remind the class to look for things that are the same as well as things that are unique.