Jump to content
Stef's Coding 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
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

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...