Jump to content
Killersites Community
shavers313

Auto tag is not working in my css.

Recommended Posts

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>

Share this post


Link to post
Share on other sites

I think the <head> element is reserved for meta data. You have heading tags (<h1>,<h2>) inside your head.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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. 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×