Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <title>Howard - CSS: classes and ids</title>
- <style>
- /* Classes are used multiple times to enhances elements that may already have a rule applied to it. Class selectors are identified by a period followed by the classname.
- We will name a class warm to emphasize fire words. We will name a class cool to emphasize ice words.
- Ids are special and used only one time to enhance an element. Ids are identified by the hash symbol followed by the id name.
- Use an id to center the content on the page adn away from the edges of the user window. Use a different id to emphasize what is important for the user to focus on. We will name these IDs #wrapper #poem.
- Divs are boxes. Divs needs styles. Divs contain elements.
- Span is an element. The only purpose for span is to call up a class. */
- body {
- background-color:gray;
- font-family:"Times New Roman", serif;
- font-size:1.25em;
- }
- header {
- background-color:red;
- background:linear-gradient(red, yellow);
- padding:1%;
- letter-spacing:4px;
- line-height:250%;
- text-outline:white;
- }
- footer {
- background-color:white;
- background:linear-gradient(#75A9D1, white, #75A9D1);
- text-align:center;
- padding:10px;
- }
- p {
- font-size:1.25em;
- }
- h1,h2,h3 {
- font-family:"Arial", sans-serif;
- vertical-align:china;
- }
- h2 {
- align:left;
- }
- #wrapper {
- background-color:#FFF;
- width:600px;
- margin-left:25%;
- margin-right:25%;
- }
- #poem {
- line-height:50px;
- margin:5%;
- text-size:1.5em;
- }
- .warm {
- color:red;
- background-color:yellow;
- }
- .cool {
- color:blue;
- background-color:darkblue;
- }
- </style>
- <head>
- <body>
- <div id="wrapper">
- <header>
- <h1>Fire and Ice</h1>
- <h2>Robert Frost</h2>
- </header>
- <div id="poem"><p>
- Some say the world will end in <span class="warm">fire,</span><br/>
- Some say in <span class="cool">ice.</span><br/>
- From what I've tasted of desire<br/>
- I hold with those who favor fire<br/>
- But if it had to perish twice,<br/>
- I think I know enough of hate<br/>
- To say that for destruction ice<br/>
- Is also great<br/>
- And would suffice.<br/></p>
- </div>
- <footer>
- <p>CSS practice by Jacob Howard © 2016</p>
- </footer>
- </div>
- </body>
- </html>
Advertisement