blue-genie
asked on
css help for div layout required
i'm using this
.wideBox {
clear: both;
width: 90%;
text-align: center;
margin: 70px;
padding: 10px;
background: #FFFFFF;
border: 1px solid grey;
}
.loginBox {
width: 20%;
margin: 70px;
height: auto;
float:left; /* add this */
border: 1px solid grey;
padding: 10px;
}
.newsBox {
border: 1px solid grey;
width: 65%;
overflow: hidden; /* if you don't want #second to wrap below #first */
display: block;
font-size: 1.2em;
padding: 10px;
}
to try and get the boxes to line up as per the image. it's not happening.
the top one (widebox) is fine.
the bottom 2 i want to be the same size (combined with gap in the middle) as the wide box - and they must be aligned on top.
help please.
Try this code it might help you resolve the issue.
When you use div tags be careful with padding and margins, because they vary depending on the browser you choose
I viewed this code in Chrome ..
Out put viewed as attached image
When you use div tags be careful with padding and margins, because they vary depending on the browser you choose
I viewed this code in Chrome ..
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Untitled Page</title>
<style>
.wideBox {
clear: both;
width: 90%;
text-align: center;
margin: 70px;
padding: 10px;
background: #FFFFFF;
border: 1px solid grey;
}
.loginBox {
width: 20%;
margin: 70px;
height: auto;
float:left; /* add this */
border: 1px solid grey;
padding: 10px;
}
.newsBox {
border: 1px solid grey;
width: 65%;
overflow: hidden; /* if you don't want #second to wrap below #first */
display: block;
font-size: 1.2em;
padding: 10px;
}</style>
</head>
<body>
<div class="wideBox"></div>
<div class="loginBox"></div>
<div class="newsBox"></div>
</body>
</html>
You can adjust width and height based on your requirements. I just used your code to make sample.Out put viewed as attached image
ASKER
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks alot - i'll be back once i get a little further in my css journey :-)
in .newsBox add float: right; and margin-right: 100px;
Open in new window