Jump to content

Auto tag is not working in my css.


shavers313

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>

Link to comment
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.

Link to comment
Share on other sites

  • 2 weeks later...

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...