I'm struggling to design a basic CSS layout for my website built using ASP.NET
. However, I'm encountering some challenges in aligning the Divs
as desired.
My goal is to achieve the following layout:
Please take note that the content on the right side, including the text in .container
and .wrap
, should extend all the way to the right without any gaps.
Below is the snippet of my html
code:
<div id="container">
<div class="header">
<img src="http://wiki.myexperiment.org/images/MyExperiment_logo_5016x960_trans.png" id="logo" /><div id="name">Welcome, John Smith</div>
<div id="logout"><a href="logout.aspx"><img src="http://s3.postimg.org/kpgjd1wi7/logout.png"/></a>
</div>
</div>
</div>
<div class="container">
<div id="left">Left Wrap</div>
<div id="wrap">
<div id ="topWrap"> Top Wrap
</div>
<div id="leftWrap"> Left Wrap
</div>
<div id="rightWrap"> Right Wrap
</div>
</div>
</div>
And, this is my corresponding CSS
styling:
@import url(http://fonts.googleapis.com/css?family=Open+Sans:300);
html {
width: 100%;
height: 100px;
font-family: 'Open Sans', sans-serif;
color: white;
}
body {
background-image: url('http://s27.postimg.org/48jitw07n/Background_3_Darker.jpg');
background-repeat: no-repeat;
}
.header {
left: 0px;
top: 0px;
position: fixed;
height: 76px;
background-color: black;
margin-bottom: 25px;
width: 100%;
opacity: 0.5;
}
#logo {
float: left;
margin-left: 5px;
padding-top: 9px;
width: 300px;
height: 50px;
}
#name {
float: right;
margin-right: 100px;
display: inline-block;
}
#logout {
float: right;
padding-top: 19px;
display: inline;
margin-right: 35px;
}
.container {
margin-top: 50px;
width: 100%;
height: 100%;
}
.left {
position: relative;
float: left;
margin-top: 50px;
width: 10%;
height: 400px;
background-color: #B9D7D9;
margin-bottom: 10px;
}
#wrap {
margin-left: 12%;
width: 100%;
height: 400px;
position: relative;
}
#topWrap {
width: 100%;
height: 50%;
}
#leftWrap {
width: 50%;
height: 50%;
margin-left: 5px;
display: inline-block;
}
#rightWrap {
float: right;
margin-right: 5px;
display: inline-block;
}
Unfortunately, the output is not turning out as I expected it to be.
Here's the current output.
Can anyone provide any tips on how I can properly align the divs
?