shavers313 Posted January 31, 2018 Report Share Posted January 31, 2018 I don't know why my h1 and h2 won't stay in the center when I use the auto tag. Can anyone give me hints on why this may not be working? I hate being spoonfed I would like to work through why my css is not working. :-) .div1{ margin: 10px auto 10px auto; } <!DOCTYPE html> <html> <head> <link href="style.css" rel="stylesheet" > <div class= "div1"> <title>Tracey's Tribute Page</title> <h1>A tribute to Tracey Lynn Brown's life.</h1> <h2>Sunrise:December 21st, 1965</h2> <h2>Sunset:April 18th, 2013</h2> </div> </head> <body> <div id="centerDoc"> </div><!-- closing centerDoc --> </body> </html> Quote Link to comment Share on other sites More sharing options...
MNS45 Posted January 31, 2018 Report Share Posted January 31, 2018 I think the <head> element is reserved for meta data. You have heading tags (<h1>,<h2>) inside your head. Quote Link to comment Share on other sites More sharing options...
administrator Posted February 1, 2018 Report Share Posted February 1, 2018 On 1/30/2018 at 11:40 PM, shavers313 said: <div class= "div1"> <title>Tracey's Tribute Page</title> <h1>A tribute to Tracey Lynn Brown's life.</h1> <h2>Sunrise:December 21st, 1965</h2> <h2>Sunset:April 18th, 2013</h2> </div> Yes. You first need to remove the above code from the <head> section and put it into the body. Quote Link to comment Share on other sites More sharing options...
shavers313 Posted February 5, 2018 Author Report Share Posted February 5, 2018 On 2/1/2018 at 12:05 PM, administrator said: Yes. You first need to remove the above code from the <head> section and put it into the body. So what is the head mostly used for? I'm slightly confused on why we even have it. Quote Link to comment Share on other sites More sharing options...
administrator Posted February 19, 2018 Report Share Posted February 19, 2018 The head tag hold extra (meta data) about the page. Things like page title and links to external CSS and JS files. Here is a quick reference: https://www.w3schools.com/tags/tag_head.asp Let me know if you need a better explanation. Stef Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.