SadUnicorn
SadUnicorn

Reputation: 65

My content wont go into a wrapper

I can't get my content to go into a wrapper, it just shows on the left side

<div id="middle">   
    <div class="wrapper">
    <div id="image_rose"><img src="assets/rose.jpg"/></div>
    <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci.</p>
    <img src="assets/leef.png" />
    <p>Text Input:</p>

CSS:

.wrapper{
    background-color:#666666;
    width:900px;
    margin:0px auto;
    text-align:left;
}

#middle{
    background-color:#666;
    width:900px;
    float:left;}

Upvotes: 0

Views: 102

Answers (4)

user1899225
user1899225

Reputation:

If the content is showing beyond the div, you might try adding an overflow: hidden; or a different overflow setting to that specific div in your css.

Upvotes: 1

Avio
Avio

Reputation: 29

You can clear your float as shown below: clear:both

Upvotes: 1

Murali Murugesan
Murali Murugesan

Reputation: 22619

Try this layout for centering your middle content

HTML

<div id="wrapper">

   <div id="middle">

   </div>

 </div>

CSS

#wrapper
{
width:100%;
padding:0px;
margin:0px;
}

#middle
{
 margin:0 auto;
 width: 600px;
}

Upvotes: 0

cjk
cjk

Reputation: 46415

You're putting your content and wrapper into #middle, which floats left. wrapper is the same size and middle, so will just site on the left.

Upvotes: 3

Related Questions