Jump to content

[SOLVED] Problem with Width: 100%


Bongeh

Recommended Posts

Hi guys,

 


<div id="headshell">

<div id="head">


	<div id="logo">
		<div id="logo2">
			<img src="logo.jpg" alt="">
		</div>

		<div id="date" style="text-align:center">
			Date script
		</div>
	</div>

	<div id="bancon">

		<div style="float:right">
		Nav Nav Nav Nav Nav Nav
		</div>
	</div>

</div>
</div>

</body>
</html>

 


body		{
	margin: 0;
	padding: 0;
	}

#head
	{
	float:left;
	width: 100%;
	border-top: solid 1px #99adc2;
	background-color:red;
	min-width: 860px;
	}


#logo		{
	float:left;
	border-top: solid 1px #99adc2;
	border-left: solid 1px #99adc2;
	border-right: solid 1px #99adc2;
	margin-left: 5px;
	margin-top: 5px;
	padding: 0px 0px 0px 0px;
	}


#logo2		{
	height: 101px;
	width: 213px;
	margin: 0px 0px 0px 0px;
	padding: 0px 0px 0px 0px;
	}

#date		{
	margin: 0px 0px 0px 0px;
	padding: 0px 0px 0px 0px;
	border-top: solid 1px #99adc2;
	border-bottom: solid 1px #99adc2;
	text-align: center;
	}

#bancon		{
	margin-top: 5px;
	margin-left: 1px;
	float:left;
	height: 122px;
	border: solid 1px #99adc2;
	background-image: url('banner.jpg');
	background-repeat: no-repeat;
	background-color: #1a2558;;
	}

 

Basically, I'm trying to create a banner for the top of a site, that spans to the edge of the page with any resolution browser.

 

I can make it so that i almost have what i want, but once i add width:100% to #bancon to make the box with the nav text in it reach the edges, the div drops below the logo breaking the banner.

 

Perhaps im using the wrong css, is there another way to tell a div to use all available space on the width, but without breaking my design?

 

Thanks in advance.

 

 

 

Link to comment
Share on other sites

Sorry if I was brief, I wish to have a banner at the top of my site, with a logo fixed in the top left (with the date underneath). To the right of the logo and date is where I want a div that stretches to the edge of the page (right), regardless of resolution (with my nav on that bar).

 

It nearly works, except when I add the width 100% to the bar that needs it, it bumps it down below the logo.

 

dropfaith, i tryed to float it so it would stick to div to the left of it.

 

Does that help anyone understand what im trying to acheive?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.