abhinav
abhinav

Reputation: 537

Div element not going to new line in css

Div Tag with ID=content is not going to new line. It is going into header line like this. enter image description here

Can anyone please explain why this is happening ?? , and how to put that in new line ?

<html>

<head>
<title> Home Page </title>

<style>

#wrapper
{
    width:70%;
    margin: 0 auto;
}

#header .Nav  
{
    width:60%;
    float:right;
}

#header .Nav ul a
{
    margin: 0 3%;
    float:right;
    text-decoration:none;
}

#header .logo
{
    width=40%;
    float:left;
}

.title
{
    float:left;
    width:30%;
}

.main_content
{
    float:right;
    width:70%;
}


</style>


</head>

<body>

<div id="wrapper" >

    <div id="header">

        <a href="/" class="logo"><img src="./logo.gif" alt="Zach Woomer" /></a>

        <div class="Nav">


        <ul>

            <a href="./contact.htm">Home</a> 
            <a href="./contact.htm">About US</a> 
            <a href="./contact.htm">Products</a>
            <a href="./contact.htm">Contact US</a> 
        </ul>

        </div>

    </div>

    <div id="content">

        <div class="title" >
            <h1>This text wraps on the left side and side and side and side </h1>
        </div>

        <div class="main_content">

        </div>

    </div>


</div>

</body>

</html>

Upvotes: 2

Views: 7464

Answers (2)

user2628521
user2628521

Reputation:

FIDDLE

I have fixed your problem bro, i hope you can reach something with that.

The width: 30%; to min-width: 30%;.

Upvotes: 1

jvperrin
jvperrin

Reputation: 3368

Try adding this code to your inline style tag to make the content div appear on its own line:

#content {
  clear: both;
}

You also have a width=40% in your css, so you should fix that as well.

Upvotes: 6

Related Questions