can't get div to flush at the top of the page - html

I can't seem to get the right side/column of the page to flush at the top. I've included a picture to show you guys what I mean.
JSFiddle
http://jsfiddle.net/vDUE7/2/
Picture
http://oi57.tinypic.com/3128hew.jpg
Code
<div class="top-column">
<div class="image"><img src="http://www.hoax-slayer.com/images/blue-tiger- source.jpg" width="730" height="360"></div></div>
<div id="content">
<div class="middle-column">
<article class="in-column">
<img src="http://www.hoax-slayer.com/images/blue-tiger-source.jpg" width="150" height="100">
<b>Bengal Tiger</b></article>
</div>
<div id="side">
<li class="list">
<img src="http://www.hoax-slayer.com/images/blue-tiger-source.jpg" width="120" height="79" />
<p class="side-news">Bengal Tiger</p></a>
</li>
<li class="list">
<img src="http://www.hoax-slayer.com/images/blue-tiger-source.jpg" width="120" height="79" />
<p class="side-news">Bengal Tiger</p></a>
</li>
<li class="list">
<img src="http://www.hoax-slayer.com/images/blue-tiger-source.jpg" width="120" height="79" />
<p class="side-news">Bengal Tiger</p></a>
</li>
<li class="list">
<img src="http://www.hoax-slayer.com/images/blue-tiger-source.jpg" width="120" height="79" />
<p class="side-news">Bengal Tiger</p></a>
</li>
</div></div>
<div class="block">
</div>
</div>
CSS
img {
border: 0px;
display: block;
margin: 0 auto;
}
header#head {
padding-left: 20px;
position: relative;
border-left: 1px solid #dddddd;
border-right: 1px solid #dddddd;
border-bottom: 1px solid #000;
}
.image {
position: relative;
cursor: pointer;
float:left;
}
#container {
width: 1055px;
margin: 0 auto;
text-align: left;
background: #fff;
padding: 0;
margin-top:-26px;
}
#content {
overflow:hidden;
width:1053px;
height:100%;
border: 1px solid #dddddd;
}
#side{
width:312px;
height:100%;
float:left;
margin-top:-10px;
padding-left:10px;
background-color:#f3f3f3;
}
.block {
border-top: 1px solid #dddddd;
text-align: center;
background-color:#000;
width:1053px;
height:365px;
position:relative;
font-size:15px;
color: #fff;
}
.list{
width:300px;
border-bottom: 1px solid #dddddd;
display: inline-block;
margin-top:10px;
}
.middle-column {
width: 730px;
float: left;
border-right: 1px solid #dddddd;
}
article.in-column {
text-align: left;
padding: 15px;
border-bottom:1px solid #dddddd;
height:100%;
}
article.in-column img{
float:left;
margin-right:15px;
}
.list img{
float:left;
margin-right:15px;
border:1px solid #ddd;
margin-bottom:10px;
}
.top-column {
float: left;
width:730px;
height:360px;
border-right: 1px solid #000;
border-left: 1px solid #000;
border-bottom: 1px solid #000;
}

have removed the sidebar from the content div and placed it separately and instead of using float:left i've used display:inline-block. here's the updated fiddle,
http://jsfiddle.net/vDUE7/9/
hope this solves your problem.
HTML
<div class="top-column">
<div class="image"><img src="http://www.hoax-slayer.com/images/blue-tiger-source.jpg" width="730" height="360"></div></div>
<div id="side">
<li class="list">
<img src="http://www.hoax-slayer.com/images/blue-tiger-source.jpg" width="120" height="79" />
<p class="side-news">Bengal Tiger</p></a>
</li>
<li class="list">
<img src="http://www.hoax-slayer.com/images/blue-tiger-source.jpg" width="120" height="79" />
<p class="side-news">Bengal Tiger</p></a>
</li>
<li class="list">
<img src="http://www.hoax-slayer.com/images/blue-tiger-source.jpg" width="120" height="79" />
<p class="side-news">Bengal Tiger</p></a>
</li>
<li class="list">
<img src="http://www.hoax-slayer.com/images/blue-tiger-source.jpg" width="120" height="79" />
<p class="side-news">Bengal Tiger</p></a>
</li>
</div>
<div id="content">
<div class="middle-column">
<article class="in-column">
<img src="http://www.hoax-slayer.com/images/blue-tiger-source.jpg" width="150" height="100">
<b>Bengal Tiger</b></article>
</div>
</div>
<div class="block">
</div>
</div>
CSS
img {
border: 0px;
display: inline-block;
margin: 0 auto;
}
header#head {
padding-left: 20px;
position: relative;
border-left: 1px solid #dddddd;
border-right: 1px solid #dddddd;
border-bottom: 1px solid #000;
}
.image {
position: relative;
cursor: pointer;
float:left;
}
#container {
width: 1055px;
margin: 0 auto;
text-align: left;
background: #fff;
padding: 0;
margin-top:-26px;
}
#content {
overflow:hidden;
height:100%;
border: 1px solid #dddddd;
}
#side{
width:312px;
height:100%;
display:inline-block;
background-color:#f3f3f3;
}
.block {
border-top: 1px solid #dddddd;
text-align: center;
background-color:#000;
width:1053px;
height:365px;
position:relative;
font-size:15px;
color: #fff;
}
.list{
width:300px;
border-bottom: 1px solid #dddddd;
display: inline-block;
margin-top:10px;
}
.middle-column {
width: 730px;
float: left;
border-right: 1px solid #dddddd;
}
article.in-column {
text-align: left;
padding: 15px;
border-bottom:1px solid #dddddd;
height:100%;
}
article.in-column img{
float:left;
margin-right:15px;
}
.list img{
float:left;
margin-right:15px;
border:1px solid #ddd;
margin-bottom:10px;
}
.top-column {
float: left;
width:730px;
height:360px;
border-right: 1px solid #000;
border-left: 1px solid #000;
border-bottom: 1px solid #000;
}

Add a style to the side bar of
position:fixed;
top:0;
left:/*width of whatever width the stuff to the left of the side bar has*/
Hope I helped

Related

CSS BODY is unexpectedly wider than expected on mobile devices

The page looks as expected on desktop browsers e.g. Firefox, etc. The problem is with display on mobile devices.
When displayed correctly, the dark background of the "BODY" of the page should appear only as a thin frame, with the white background of the "mainFrame" div appearing as central with all contents inside it.
I have tied to change the width of the "mainFrame" class to 100% but it didn't help.
What changes should be made to the css to allow correct display on not desktop and mobile devices browsers?
Please see the CSS and HTML below.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html dir='ltr'>
<head>
<style>
html, body{height:100%;text-align: center;background:#646464;}
body{padding:0px;margin:0px; text-align: center;}
.mainFrame{
width: auto;
min-height:100%;
height: 100%;
background: white;
border: 5px solid #CCCCCC;
margin:auto;
}
html>body .mainFrame {width:auto; height: auto;}
th{
text-align: center;
padding: 9px 0px 9px 0px;
background: #E8E8FF;
font: bold 12px TAHOMA;
color: #404040;
}
td {
font: 11px Tahoma;
background: #DFEFFF;
padding: 8px 5px 8px 3px;
}
td.blank{
padding: 12px 0px;
background: WHITE;
}
.logosmallContainer {
position: relative;
width: 960px;
top: 22px;
}
.logosmallContainer1 {
position: relative;
width: 720px;
top: 22px;
}
.logosmall {
float:right;
}
.jobtabs{
position: relative;
top:40px;
width: 720px;
}
.upperTabs{
position: relative;
font-size: 12px;
width: 720px;
clear:both;
}
.uprTabs {
width:120px;
text-align:center;
padding:0px;
font: 12px tahoma;
float:right;
}
.uprTabs a {
width:120px;
height: 30px;
line-height:30px;
background-color: #EEEEEE;
text-decoration: none;
border-top: 1px #F5F5F5 solid;
border-left: 1px #F5F5F5 solid;
border-bottom: 1px #F5F5F5 solid;
border-right: 1px #F5F5F5 solid;
}
html>body .uprTabs a {width:118px; display:table; }
.uprTabs a:hover{
background-color: #C3E2DB;
text-decoration: none;
border-top: 1px solid #31557f;
border-left: 1px solid #31557f;
border-bottom: 1px solid #E6E6E6;
border-right: 1px solid #E6E6E6;
}
.lowerTabs{
position: relative;
font-size: 12px;
width: 720px;
border-top: solid #007FC0 5px;
clear:both;
}
html>body .lowrTabs a {width:118px; display:table;}
.lowrTabs {
width:120px;
background-color: #EEEEEE;
text-decoration: none;
text-align:center;
font: 12px tahoma;
float:right;
height: 27px;
line-height:27px;
}
.lowrTabs a {
width:120px;
height: 25px;
line-height:25px;
background-color: #EEEEEE;
text-decoration: none;
border-top: 1px #F5F5F5 solid;
border-left: 1px #F5F5F5 solid;
border-bottom: 1px #F5F5F5 solid;
border-right: 1px #F5F5F5 solid;
float:right;
}
.lowrTabs a:hover{
background-color: #C3E2DB;
text-decoration: none;
border-top: 1px #31557f solid;
border-left: 1px #31557f solid;
border-bottom: 1px #E6E6E6 solid;
border-right: 1px #E6E6E6 solid;
}
.vMsg2 {
font: bold 22px arial;
position: relative;
top: 78px;
width: 720px;
text-align: center;
direction:rtl;
clear:both;
}
.vMain {
position: relative;
top: 113px;
width:620px;
direction:rtl;
clear:both;
}
.vMainJobs {
position: relative;
top: 30px;
width:620px;
direction:rtl;
clear:both;
}
.pgn1 {
width: 330px;
top:30px;
position: relative;
}
html>body .pgn1 {display:table;}
.pgnbx {
width: 30px;
height: 20px;
line-height:20px;
float:right;
text-decoration: none;
text-align:center;
}
html>body .pgnbx a {display:table;}
.pgnbx a{
width: 30px;
border-width: 1px;
border-color: #ffe #aaab9c #ccc #fff;
border-style: solid;
background: #FFF;
background: #CDF6ED;
}
.pgnbx a:hover{
width: 30px;
background: #B3E1D7;
border-color: #fff #ccc;
text-decoration: none;
}
.mainXJobs {
height:55px;
clear:both;
}
.ad728Y{
position: relative;
width:728px;
border-top: double thick #D3D3D3;
border-bottom: double thick #D3D3D3;
}
</style>
</head>
<body topmargin='0' leftmargin='0' >
<div class="mainFrame" align="center">
<div class="logosmallContainer1">
<div class="logosmall"><img border="0" src="media/small.jpg" alt="logo"></div>
<DIV class=adtop2>
</div>
</div>
<div class="jobtabs">
<div class="upperTabs">
<DIV class=uprTabs><A href="?Category6">Category 6</DIV>
<DIV class=uprTabs>Category 5</DIV>
<DIV class=uprTabs>Category 4</DIV>
<DIV class=uprTabs>Category 3</DIV>
<DIV class=uprTabs> Category 2</DIV>
<DIV class=uprTabs>Category 1</DIV>
</div>
<div class ="lowerTabs">
<DIV class=lowrTabs>Category 7</DIV>
<DIV class=lowrTabs>Category 8</DIV>
<DIV class=lowrTabs>Category 9</DIV>
<DIV class=lowrTabs>Category 10</DIV>
<DIV class=lowrTabs> Category 11</DIV>
<DIV class=lowrTabs>Category 12</DIV>
</div>
</div>
<div class='vMsg2'><H1>
GENERAL LIST
</H1></div>
<br><br><br><br><br><div class="ad300" id="ad"></div><div class='vMainJobs' dir='ltr'> <table border='0' width='100%' dir='ltr' cellspacing='1'>
<tr>
<th width='100%' colspan='2'>DETAILS</th>
</tr>
<tr>
<td width='18%'height='18' valign='top'>LOCATION </td>
<td height='18'>LONDON</td>
</tr>
<tr>
<td width='18%'height='18' valign='top'>LINK</td>
<td height='18'><a href='https://www.example.com'>https://www.example.com</a></td>
</tr>
</table>
<table border='0'>
<tr>
<td class='blank'>
<a href='#top'>top of page</a>
</td>
</tr>
</table>
</div>
<div class="pgn1">
<div class='pgnbx'>
<a href='?jpage=2'>2</a>
</div>
<div class='pgnbx'>
<a href='?page=3'>3</a>
</div>
<div class='pgnbx'>
<a href='?jpage=4'>4</a>
</div>
<div class='pgnbx'>
<a href='?page=5'>5</a>
</div>
<div class='pgnbx'>
<a href='?jpage=6'>6</a>
</div>
<div class='pgnbx'>
<a href='?page=7'>7</a>
</div>
<div class='pgnbx'>
<a href='?jpage=8'>8</a>
</div>
<div class='pgnbx'>
<a href='?page=9'>9</a>
</div>
<div class='pgnbx'>
<a href='?page=10'>10</a>
</div>
<div class='pgnbx'>
<a href='?jpage=11'>11</a>
</div>
<div class='pgnbx'>
<a href='?page=12'>12</a>
</div>
</div>
<div class="mainXJobs"> </div>
<DIV class="ad728Y"> PUT item "Classicus" here HERE</DIV>
<br><br><br>
</div>
</body>
</font>
</html>
The reason your body does not adjust is because you are assigning width using px. Try to change it to "%" or "vw". You can always assign a max-width or min-width if you want to put a limit on how much you want the width to be.
If you need to have the children adjust to the parent container, assign the width: 100%.
You have to use media query for mobile devices.
For example if I want to add background color for the device of maximum 600px, it will show body background color as
lightblue
after 600px it will be the default.
#media only screen and (max-width: 600px) {
body {
background-color: lightblue;
}
}

Html column borders

How do I achieve the following look and feel using html and/or css?
I want to draw a border around column1.
Can this be done in a single table with a div or will I have to create a new table with a single td and multiple rows?
Hopefully this is what you need:
CSS:
.border1
{
border: 2px solid black;
border-bottom:0px;
}
.border2
{
border: 2px solid black;
border-bottom:0px;
border-top:0px;
}
.border3
{
border: 2px solid black;
border-top:0px;
}
table
{
border-collapse: collapse;
}
<table>
<tr>
<td>q</td>
<td class="border1">q</td>
</tr>
<tr>
<td>q</td>
<td class="border2">q</td>
</tr>
<tr>
<td>q</td>
<td class="border2">q</td>
</tr>
<tr>
<td>q</td>
<td class="border3">q</td>
</tr>
</table>
Note: There are other ways to do this but since you wanted to use a table here you go(no need for two tables!!).
You can do it without table:(to set items one each other use flex)
.wrap{
display:flex;
}
.wrap-container{
border:1px solid black;
text-align:center;
width:30%;
margin-right:5px;
}
.elem{
border:1px solid black;
margin:5px;
margin-left: 5.5%;
width:150px;
padding:5px;
}
.title{
}
<div class="wrap">
<div class="wrap-container">
<div class="title">Column1</div>
<div class="elem">value</div>
<div class="elem">value</div>
<div class="elem">value</div>
<div class="elem">value</div>
<div class="elem">value</div>
</div>
<div class="wrap-container">
<div class="title">Column1</div>
<div class="elem">value</div>
<div class="elem">value</div>
<div class="elem">value</div>
<div class="elem">value</div>
<div class="elem">value</div>
</div>
</div>
Here is a fiddle for you.
.option-wrapper {
border: 2px solid blue;
width: 150px;
text-align: center;
}
.option-title {
color: blue;
margin-top: 10px;
}
.options {
margin-top: 10px;
}
.option {
border: 1px solid grey;
margin: 10px;
padding: 6px 0px;
}
<div class="option-wrapper">
<div class="option-title">
column1
</div>
<div class="options">
<div class="option">
option 1
</div>
<div class="option">
option 1
</div>
<div class="option">
option 1
</div>
<div class="option">
option 1
</div>
</div>
</div>
I've created a table-less solution, hopefully, this is what you're looking for.
You can write code like this.
CSS:
<style>
body {
margin: 0px;
padding: 0px;
}
.wrapper {
border: 1px solid red;
padding: 10px;
width: 200px;
}
.wrapper>div {
border: 1px solid blue;
font-size: 14px;
margin-bottom: 10px;
}
.wrapper>div:last-child {
border: 1px solid blue;
font-size: 14px;
margin-bottom: 0px;
}
</style>
HTML:
<div class="wrapper">
<div>view1</div>
<div>view2</div>
<div>view3</div>
<div>view4</div>
<div>view5</div>
</div>

Unknown additional space on <div> top

I am creating a table madde with several divs, and I am having an extra space between the first row (styled as head) and the rest of them, only the fist two columns (divs). Here you can see very clear:
There is no style atribute causing this space, at least I am not able to find the reason of it.
I have reproduced it on jsfiddle and you can see that it also sets the extra space: DEMO
Here I bring HTML & Syle related code:
HTML:
<div class="tableWrap">
<div class="tableHeader">
<div class="contentColumn60">
<span class="tableHeaderText">Turno</span>
</div>
<div class="contentColumn20">
<span class="tableHeaderText">Tipo</span>
</div>
<div class="contentColumn10">
<span class="tableHeaderText">Editar</span>
</div>
<div class="contentColumn10">
<span class="tableHeaderText">Reactivar</span>
</div>
</div>
<div class="tableContent">
<div class="contentColumn60">
<span class="tableContentText">Mañana(17:00 - 21:00)</span>
</div>
<div class="contentColumn20">
<span class="tableContentText">Mañanas</span>
</div>
<div class="contentColumn10">
<div class="editIcon"></div>
</div>
<div class="contentColumn10">
<div class="discontinueIcon"></div>
</div>
</div>
<div class="tableContent">
<div class="contentColumn60">
<span class="tableContentText">Mañana(17:00 - 21:00)</span>
</div>
<div class="contentColumn20">
<span class="tableContentText">Mañanas</span>
</div>
<div class="contentColumn10">
<div class="editIcon"></div>
</div>
<div class="contentColumn10">
<div class="discontinueIcon"></div>
</div>
</div>
<div class="tableContent">
<div class="contentColumn60">
<span class="tableContentText">Mañana(17:00 - 21:00)</span>
</div>
<div class="contentColumn20">
<span class="tableContentText">Mañanas</span>
</div>
<div class="contentColumn10">
<div class="editIcon"></div>
</div>
<div class="contentColumn10">
<div class="discontinueIcon"></div>
</div>
</div>
STYLE:
.tableWrap{
width: 100%;
height:380px;
border:#ccc 1px solid;
border-radius:3px;
box-shadow: 0 1px 2px #d1d1d1;
margin: 10px;
background: -webkit-gradient(linear, left top, left bottom, from(#fbfbfb), to(#fafafa));
background: -moz-linear-gradient(top, #fbfbfb, #fafafa);
font-size:12px;
color:#666;}
.tableHeader{
height: 40px;
width: 100%;
background: -moz-linear-gradient(center top , #EDEDED, #EBEBEB) repeat scroll 0 0 rgba(0, 0, 0, 0);
border-bottom: 1px solid #E0E0E0;
border-left: 1px solid #E0E0E0;
border-top: 1px solid #FAFAFA;
display: inline-block;
font-weight: 600;
}
.tableHeaderText{
line-height: 40px;
padding: 0 10px;
}
.tableContent{
height: 40px;
width: 100%;
}
.tableContentText{
line-height: 40px;
padding: 0 0 0 20px;
}
.contentColumn60{
height: 40px;
width: 58%;
border-top:1px solid #fafafa;
border-bottom:1px solid #e0e0e0;
border-left:1px solid #e0e0e0;
display: inline-block;
}
.contentColumn20{
height: 40px;
width: 20%;
border-top:1px solid #fafafa;
border-bottom:1px solid #e0e0e0;
border-left:1px solid #e0e0e0;
display: inline-block;
}
.contentColumn10{
height: 40px;
width: 10%;
border-top:1px solid #fafafa;
border-bottom:1px solid #e0e0e0;
border-left:1px solid #e0e0e0;
display: inline-block;
}
.discontinueIcon{
width: 23px;
height: 23px;
background-size: 98%;
background-image: url(images/error.png);
background-repeat:no-repeat;
margin: 0 auto;
}
.editIcon{
width: 23px;
height: 23px;
background-size: 98%;
background-image: url(images/edit.png);
background-repeat:no-repeat;
margin: 0 auto;
}
Since the elements are inline-block, you could use vertical-align:top to align them as desired. It's worth noting that the default property value is baseline; this explains why they were behaving as they were. UPDATED EXAMPLE HERE
.contentColumn60 {
height: 40px;
width: 58%;
border-top: 1px solid #fafafa;
border-bottom: 1px solid #e0e0e0;
border-left: 1px solid #e0e0e0;
display: inline-block;
vertical-align: top;
}
.contentColumn20 {
height: 40px;
width: 20%;
border-top: 1px solid #fafafa;
border-bottom: 1px solid #e0e0e0;
border-left: 1px solid #e0e0e0;
display: inline-block;
vertical-align: top;
}
use overflow:hidden; for content column60,20,10 it works perfect
add a clearfix or use vertical-align:top and overflow:hidden
.contentColumn60:after {
content: "";
display: table;
clear: both;
}

Auto Adjust Div Height

I want the div that's on the right side to match the height of the div that's on the left. The div on the right should always be the same height as the div on the left. The div on the left auto adjust its height. Both divs should always have the same height. A picture is worth a thousand words so please take a look at the picture below.
Here's the image that explains my problem.
http://i44.tinypic.com/24pcpwj.jpg
JSFIDDLE
http://jsfiddle.net/zFqNH/
HTML
<div style="width:1053px;">
<section id="inside" style="overflow: hidden; width:310px; float:right; border-left:0;">
<ul>
<p class="title">Funny</p>
<li class="list">
<img src="http://cdn.dashburst.com/wp-content/uploads/2013/01/Grumpy-Cat.jpg" width="100" height="67" style="float:left;padding-right:15px;" /></a>
<h3 style="font-size:20px;">Grumpy Cat</h3>
</li>
</ul>
</section>
<section id="inside">
<h2 class="subheading">Grumpy Cat<br/><p style="font-size:14px; margin-top:0px; font-weight:normal;"></p></h2><h2 style="border-bottom: 1px solid #dddddd; padding-top:10px;"></h2>
<p class="section"></p>
<img src="http://cdn.dashburst.com/wp-content/uploads/2013/01/Grumpy-Cat.jpg" border="0" style="display:block; margin: 0 auto;" height="396" width="700">
<br/>
<img src="http://cdn.dashburst.com/wp-content/uploads/2013/01/Grumpy-Cat.jpg" border="0" style="display:block; margin: 0 auto;" height="396" width="700">
<br/>
<img src="http://cdn.dashburst.com/wp-content/uploads/2013/01/Grumpy-Cat.jpg" border="0" style="display:block; margin: 0 auto;" height="396" width="700">
<br/>
</div></div></section>
CSS
#inside {
width:700px;
border-right: 1px solid #dddddd;
border-left: 1px solid #dddddd;
min-height: 600px;
overflow: hidden;
padding-bottom:15px;
}
.title{
width:300px;
padding-top:3px;
padding-bottom:7px;
color:#fff;
height:20px;
margin-top:125px;
background:#2c2c2c;
font-size: 18px;
}
.section{
padding-left:30px;
padding-bottom:15px;
margin-bottom: 1px;
font-size: 28px;
color: #657B83;
}
.subheading {
background:#fff;
font-size:50px;
height:100px;
position: relative;
}
.bottom {
border-top: 1px solid #dddddd;
border-right: 1px solid #dddddd;
padding-top: 20px;
text-align: center;
padding-bottom: 10px;
width:1053px;
position:relative;
margin: 0 auto;
font-size:15px;
color: #fff;
}
.list{
width:300px;
border-bottom: 1px solid #dddddd;
padding-bottom:10px;
display: inline-block;
margin-top:20px;
}
Insert JavaScript below the two divs and use document.getElementById to get the height of the left div, then use document.getElementById to change the height of the right div.
<script>
var height = document.getElementById('div1').style.height;
document.getElementById('div2').style.height = height;
</script>
Documentation:
http://www.w3schools.com/jsref/prop_style_height.asp

CSS - issue with image during browser window resizing

In my example I need to keep header and main body to strech to a full screen when browser window is expanding (it works now). However, when browser window gets downsized, the orange image jumps down from the header and goes partially under black one. Any idea how to keep the orange image in place?
Here is my example: http://jsfiddle.net/RFMBM/
My CSS:
body {
background-color: #e8e8e8;
font-family: Arial, Helvetica, sans-serif;
font-size:12px;
padding: 0;
margin: 0;}
h1 {
padding: 0px;
margin: 0px;
}
#container {
margin:0px auto;
border:0px solid #bbb;
padding:10px;
min-width: 990px;
}
.white-box {
width: 180px;
margin: 0px;
}
#main-header {
border:1px solid #bbb;
height:98px;
padding:3px;
background-color: #fff;
min-width: 930px;
}
#main-content {
margin-top:10px;
padding-bottom:10px;
}
#main-body {
margin-left:10px;
width:666px;
height:150px;
}
#main-footer {
margin-top:10px;
margin-bottom:10px;
padding:10px;
border:1px solid #bbb;
}
.box {
padding: 8px;
border: 1px solid silver;
-moz-border-radius: 8px;
-o-border-radius: 8px;
-webkit-border-radius: 5px;
border-radius: 8px;
background-color: #fff;
}
.box1 {
width: 200px;
float: left;
}
.box2 {
margin-left: 224px;
}
div.left {
float: left;
}
div.right {
float: right;
margin-right:3px;
}
HTML:
<div id="main-header">
<div class="left"><img src="http://img89.imageshack.us/img89/2675/logoxnx.gif" border="0" alt=""></div>
<div class="right"><img src="http://img199.imageshack.us/img199/9759/banner2b.gif" border="0" alt=""></div>
</div>
<div id="container">
<div id="main-content">
<div class="box box1">
left
</div>
<div class="box box2">
<p>Main Body...</p>
</div>
<div style="clear:both;"></div>
</div>
<div id="main-footer">Main Footer</div>
</div>
You need to increase the min-width of #main-header to around 950px
http://jsfiddle.net/RFMBM/2/