Genthorn
Genthorn

Reputation: 21

HTML Wrapper Div Tag Not Working?

I know this question has been asked on this forum before but none of the answers helped, so I'm here to ask again, my html5 and css website has a wrapper (as most do), but its not resizing with the contents, I've checked everything that I think that could have gone wrong, here's the code for all who want to try to see what's up, thanks!

HTML

<html lang="en">
    <head>
        <meta charset="utf-8" />
        <title>Home</title>
        <link rel="stylesheet" href="style.css">
    </head>

    <body>
        <div id="wrapper">


            <div id="header">
                <ul>
                    <a href="index.html"><li>Home</li></a>
                    <li>&nbsp;|&nbsp;</li>
                    <a href="blog.html"><li>Blog</li></a>
                    <li>&nbsp;|&nbsp;</li>
                    <a href="videos.html"><li>Videos</li></a>
                    <li>&nbsp;|&nbsp;</li>
                    <a href="#"><li>Contact-Me</li></a>             
                </ul>   

                <h1>Zormion's Blog</h1>
            </div>


            <div id="content">
                <h2>Latest Blog Post:</h2>
            </div>


            <div id="sidebar">
                <h3>Tweets:</h3>
                    <a class="twitter-timeline"  href="https://twitter.com/Zormion" data-widget-id="537398875540455424">Tweets by @Zormion</a>
                    <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
            </div>


        </div>
    </body>
</html>

CSS

* {
    margin: 0;
    padding: 0;
}

body {
    background-color: #DFC1B0
}

#wrapper {
    margin: 20px auto;
    width: 1000px;
    text-align: left;
    background-color: #CCCCCC;
}

#header {
    width: 100%;
    height: 40px;
    background-color: #000;
}

#header h1 {
    margin-left: 10px; 
    color: white;
}

#header ul {
    padding-top: 10px;
    float: right;
    margin-right: 20px;
}

#header ul li {
    display: inline-block;
    list-style: none;
    color: #fff;
    font-size: 16px;
}

#content {
    width: 63%;
    height: 150px;
    background-color: grey;
    float: left;
    margin: 10px;
    padding: 20px;
}

#content h2 {
    text-align: center;
    font-size: 32px;
}

#sidebar {
    width: 25%;
    float: left;
    background-color: grey;
    margin: 10px;
    padding: 20px;
    border: 1px black;
}

#sidebar h3 {
    text-align: center;
    color: black;
    font-size: 32px;
    margin-bottom: 10px;
    margin-top: -10px;

}

.twitter-timeline {
    height: 500px;
}

Upvotes: 0

Views: 1908

Answers (1)

Bhojendra Rauniyar
Bhojendra Rauniyar

Reputation: 85545

Use like this:

#wrapper {
    margin: 20px auto;
    width: 100%;
    max-width: 1000px;
    text-align: left;
    background-color: #CCCCCC;
}

Upvotes: 1

Related Questions