tldr; I am trying to put the aside-section to the left of the article-section (like a sidebar/sidecolumn however my "float" does not seem to work at all. How do I do this without editing the HTML-code? I only want to edit it in the CSS-file. I am a beginner so I appreciate the help!
* {
box-sizing: border-box;
}
section {background-color: cornsilk;overflow:auto;float: right;}
article {color: black;float: right;}
article footer {font-style: italic;font-size: 15px;color: black; background-color: cornsilk;text-align: left;}
#wrapper {width: 960px;
margin: 0 auto;}
h1 {
background-color: #666;
text-align: center;
font-size: 35px;
color: white;
}
footer {
background-color: #666;
text-align: center;
font-size: 35px;
color: white;
font-family: "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", "DejaVu Sans", Verdana, "sans-serif";
float: right;
}
aside {
float: left;
}
<div id="wrapper">
<header><h1>text</h1></header>
<article>
<section>
<header><h2>Om CSS</h2></header>
<p>text</p>
<p>text</p>
<p class="linktext">Här är en artikel om CSS på Wikipedia</p>
<footer>text</footer>
</section>
<section>
<header><h2>Om märkspråk</h2></header>
<p>text</p>
<p>text</p>
<p class="linktext">Här är en artikel om HTML5 på Wikipedia</p>
<footer>text</footer>
</section>
</article>
<aside>
<h1>Bildgalleri</h1>
<img src="images/html5.png " alt="html5">
<img src="images/css.png" alt="css3">
</aside>
<footer>©</footer>
</div>
Here's a solution where your HTML is completely unchanged (which I actually would not recommend at all, since the order of elements in there isn't ideal, and neither is the HTML structure in general).
The main thing is that I used display: flex with flex-direction: row-reverse on the #wrapper and applied position: absolute to the header and footer, plus some paddings and margins on other elements to create space for that header and footer. I also deleted all floats. Other details/settings see below.
* {
box-sizing: border-box;
}
html, body {
margin: 0;
}
#wrapper {
width: 100%;
max-width: 960px;
margin: 0 auto;
display: flex;
flex-direction: row-reverse;
justify-content: flex-end;
position: relative;
}
section {
background-color: cornsilk;
padding-bottom: 50px;
}
article {
color: black;
padding: 60px 0;
}
article footer {
font-style: italic;
font-size: 15px;
color: black;
background-color: cornsilk;
text-align: left;
}
header h1 {
background-color: #666;
text-align: center;
font-size: 35px;
color: white;
margin: 0;
}
aside h1 {
margin-top: 60px;
margin-right: 20px;
}
#wrapper > header {
position: absolute;
width: 100%;
height: 40px;
margin-right: 20px;
}
section:first-of-type > header {
margin-top: 40px;
}
footer {
background-color: #666;
text-align: center;
font-size: 35px;
color: white;
font-family: "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", "DejaVu Sans", Verdana, "sans-serif";
position: absolute;
width: 100%;
bottom: 0;
left: 0;
}
<div id="wrapper">
<header>
<h1>text</h1>
</header>
<article>
<section>
<header>
<h2>Om CSS</h2>
</header>
<p>text</p>
<p>text</p>
<p class="linktext">Här är en artikel om CSS på Wikipedia</p>
<footer>text</footer>
</section>
<section>
<header>
<h2>Om märkspråk</h2>
</header>
<p>text</p>
<p>text</p>
<p class="linktext">Här är en artikel om HTML5 på Wikipedia</p>
<footer>text</footer>
</section>
</article>
<aside>
<h1>Bildgalleri</h1>
<img src="images/html5.png " alt="html5">
<img src="images/css.png" alt="css3">
</aside>
<footer>©</footer>
</div>
I removed all your CSS to simplify it. Of course you can start to re-style everything.
The best overall solution in terms of compability will be the sue of flex-box. CSS-Grid would do the trick too but has limited support for IE11 & 13.
First at all, your main issue is the use of float which should not be sued for styling purpose. float is only intended to be used to float images within a paragraph (simliar to word or newspapers). Unfortunatly it still is repeatly tought as it was a hack befor HTML5 and the development of flexbox and css-grid in 2012. Since 2015 both flexbox and css-grid are a well established technique and there is no further reason to mis-use the float-hack.
Next issue is, your HTML structure. You have multiple footer and headerelements and nested them within the structure. This requires the of the > selector to call only a specific footer or header element and not all of them.
The enxt structure issue is the ordering. Semantically you will display the elements either from top to bottom or from left to right. However your <aside> element is supposed to come befor the <article> element while it comes last within the structure. This requires the use of order(flex-order) within the CSS to change the order.
So what I did was to use #wrapper { display: flex; flex-wrap: wrap } this applies flexbox to the container and tells the elements to wrap instead of nowrap (initial value). The intention is, that the ehaderr gets a width of 100% and the other elements should then be displayed below it instead of overflowing to the right.
Then you see, that the <header>, <footer>, <aside> and <article> elements got order property and value which allows me to reorder the structure within CSS as explained above.
If you need further explantion or information, feel free to ask.
* {
box-sizing: border-box;
}
#wrapper {
width: 100%;
max-width: 960px;
margin: 0 auto;
display: flex;
flex-wrap: wrap;
}
#wrapper > header {
width: 100%;
border: 1px solid red;
order: 1;
}
#wrapper > aside {
width: 30%;
border: 1px solid green;
order: 2;
}
#wrapper > article {
width: 70%;
border: 1px solid blue;
order: 3;
}
#wrapper > footer {
width: 100%;
border: 1px solid yellow;
order: 4;
}
<div id="wrapper">
<header>
<h1>text</h1>
</header>
<article>
<section>
<header>
<h2>Om CSS</h2>
</header>
<p>text</p>
<p>text</p>
<p class="linktext">Här är en artikel om CSS på Wikipedia</p>
<footer>text</footer>
</section>
<section>
<header>
<h2>Om märkspråk</h2>
</header>
<p>text</p>
<p>text</p>
<p class="linktext">Här är en artikel om HTML5 på Wikipedia</p>
<footer>text</footer>
</section>
</article>
<aside>
<h1>Bildgalleri</h1>
<img src="images/html5.png " alt="html5">
<img src="images/css.png" alt="css3">
</aside>
<footer>©</footer>
</div>
I think you want to do like this
* {
box-sizing: border-box;
}
section {
background-color: cornsilk;
overflow: auto;
float: right;
}
article {
color: black;
float: right;
}
article footer {
font-style: italic;
font-size: 15px;
color: black;
background-color: cornsilk;
text-align: left;
}
#wrapper {
width: 960px;
margin: 0 auto;
}
h1 {
background-color: #666;
text-align: center;
font-size: 35px;
color: white;
}
footer {
background-color: #666;
text-align: center;
font-size: 35px;
color: white;
font-family: "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", "DejaVu Sans", Verdana, "sans-serif";
float: right;
}
aside {
position: absolute;
top: 0;
float: left;
}
Related
that's my first site with html and css. I'm doing a personal website and i have problems:
1) right positioning of words in the header
2) footer positioning
the code is:
<head>
<meta cherset='UTF-8'/>
<title>HOME</title>
<link rel='stylesheet' href='styles.css'/>
</head>
<body>
<header class='header'>
<ul class='header__menu animate'>
<li class="header__menu__item">HOME</li>
<li class="header__menu__item">HOBBY E PASSIONI</li>
<li class="header__menu__item">CURRICULUM</li>
<li class="header__menu__item">CONTATTI</li>
</ul>
</header>
<br><br><br><br><br>
<h1>Gabriele Minosa</h1>
<br><br><br>
<div class='img'>
<img src="1111.png">
</div>
<figcaption> text...
</figcaption>
<br><br>
<footer class='footer'>
<p>© 2020 Gabriele Minosa. TUTTI I DIRITTI RISERVATI</p>
</footer>
</div>
</body>
</html>
CSS**********
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
margin: auto;
height: 1200px;
font-size: 18px;
font-family: sans-serif;
color: #000000; /*colore scritte*/
background: #eee; /*COLORE ESTERNO PAGINA WEB*/
}
a:link,
a:visited {
color: #5D6063; /*COLORE SCRITTE INTESTAZIONE*/
text-decoration: none;
}
a:hover {
background: #fff;
padding: 10px;
}
.header {
position: fixed;
width: 100%;
display: flex;
padding: 30px;
background: #d6d6d2;
}
.header__menu__item {
display: inline-block;
}
h1 {
color:#949da6;
font-size:40;
text-align: center;
}
figcaption, footer {
text-align: center;
}
.img {
text-align: center;
}
.footer {
background: #333;
padding: 20px;
color: #fff;
}
if anyone could tell me, apart from those two questions, what other changes I can make and what other mistakes I made I would be grateful..that's my first time...
In order to align the menu to the right inside a flex container, you can change the justification of the flex items by using justify-content: flex-end; - this positions the elements horizontally at the end of the container.
.header {
position: fixed;
width: 100%;
display: flex;
justify-content: flex-end;
padding: 30px;
background: #d6d6d2;
}
In regards to your second question regarding footer positioning, what are you attempting to achieve?
In the below code snippet, which I believe achieves your desired results, there's a couple of changes I've made;
I wrapped your page content (the stuff in between the header and footer) in a <main> tag. This tag is given a min-height value of 80vh - or 80% of the height of the viewport. This will make sure that your footer is towards the bottom of the page. If you have a page with less content you may want to change this to 90 or even 100.
The display property for header__menu <ul> has been set to flex. Justify content is used here but this time setting the value to space-between.
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
margin: auto;
font-size: 18px;
font-family: sans-serif;
color: #000000; /*colore scritte*/
background: #eee; /*COLORE ESTERNO PAGINA WEB*/
}
main{
min-height: 90vh;
}
a:link,
a:visited {
color: #5D6063; /*COLORE SCRITTE INTESTAZIONE*/
text-decoration: none;
}
a:hover {
background: #fff;
padding: 10px;
}
.header {
position: fixed;
width: 100%;
display: flex;
padding: 30px;
background: #d6d6d2;
}
.header__menu {
display: flex;
justify-content: space-between;
width: 80%;
margin: 0 auto;
}
.header__menu__item {
display: inline-block;
}
h1 {
color:#949da6;
font-size:40;
text-align: center;
}
figcaption, footer {
text-align: center;
}
.img {
text-align: center;
}
.footer {
background: #333;
padding: 20px;
color: #fff;
}
<header class='header'>
<ul class='header__menu animate'>
<li class="header__menu__item">HOME</li>
<li class="header__menu__item">HOBBY E PASSIONI</li>
<li class="header__menu__item">CURRICULUM</li>
<li class="header__menu__item">CONTATTI</li>
</ul>
</header>
<main>
<br><br><br><br><br>
<h1>Gabriele Minosa</h1>
<br><br><br>
<div class='img'>
<img src="1111.png">
</div>
<figcaption> Gabriele Minosa (Taranto, 12 Gennaio 1991) è un perito informatico con la passione per l’informatica fin da bambino.<br>
Dopo aver imparato,da autodidatta, a gestire l'hardware ed il software dei pc, allarga la sua curiosità al mondo dell'innovazione <br>
e della programmazione web. Non essendo particolarmente stimolato dal contenuto troppo generalizzato del percorso universitario, <br>
dopo alcune esperienze lavorative e svariati concorsi, è attualmente uno studente di Front End Development di start2impact, una <br>
startup di Roma che propone percorsi innovativi sulla programmazione e sulle nuove tecnologie e rende potenzialmente più immediato <br>
e diretto l'inserimento nel mondo del lavoro.
</figcaption>
</main>
<br><br>
<footer class='footer'>
<p>© 2020 Gabriele Minosa. TUTTI I DIRITTI RISERVATI</p>
</footer>
I have a two column layout the main content area renders down the page. Not even with aside. I wonder if I need a wrapper div?
or maybe my CSS not right?
I did not post of the CSS just what Thought maybe important
#charset "utf-8";
body {
font: 100%/1.4 Verdana, Arial, Helvetica, sans-serif;
background: #FFF;
background-image:url(../assets/bg1.png);
margin: 0;
padding: 0;
color: #000;
}
.sidebar h4 {
padding-bottom: 0;
font-size: 13px;
color: #fff;
text-transform: uppercase;
font-weight: normal;
padding: 7px 7px;
border-bottom: 1px solid #A31923;
background-color: #DE2D3A;
}
/* ~~this fixed width container surrounds the other divs~~ */
/*#container {
width: 960px;
margin: 20px auto;
padding: 10px;
box-shadow: 0 5px 5px 5px #CCCCCC;
background-color: #fff;
}*/
.container {
width: 1260px;
margin: 20px auto;
padding: 10px;
background: #FFF;
box-shadow: 0 0 5px 5px #B8B8B8;
/*margin: 0 auto; the auto value on the sides, coupled with the width, centers the layout */
}
.sidebar {
float: left;
width: 180px;
margin-top: 10px;
}
.sidebar h4 {
padding-bottom: 0;
font-size: 13px;
color: #fff;
text-transform: uppercase;
font-weight: normal;
padding: 7px 7px;
border-bottom: 1px solid #A31923;
background-color: #DE2D3A;
}
.footer {
padding: 10px 0;
background: #CCC49F;
position: relative;
clear: both;
}
.fltrt {
float: right;
margin-left: 8px;
}
.fltlft {
float: left;
margin-right: 8px;
}
.clearfloat {
clear:both;
height:0;
font-size: 1px;
line-height: 0px;
}
.clear {
clear: both;
}
<body>
<div class="container">
<header>
<h2>our website slogan here with header image</h2>
</header>
<nav>
<ul>
<li>X</li>
<li>X</li>
</ul>
</nav>
<aside class="sidebar">
<ul>
<li>
<h4>X</h4>
<ul>
<li>X</li>
<li>X</li>
</ul>
</li>
</ul>
</aside>
<main>
<section>
<article>
<h2>CCCC</h2>
<p>CCC</p>
</article>
<article>
<h1>xXX<h1>
<h2>XXX</h2>
<p>XX</p>
</article>
<article>
<h2>XXX</h2>
<p>V</p>
</article>
</section>
</main>
<div class="clear"></div>
<footer>
<p>XXX.</p>
</footer>
</body>
</html>
I wonder if I need a wrapper div?
Not really, you can achieve it without an additional wrapper.
or maybe my CSS not right?
That is the question, your CSS could be much better. You are using float, and unless there is a good reason behind its use, we are on 2017: use flexbox instead and forget float elements for a time.
Your example hasn't the full code, so I will do a simple code snippet with a full width header, a 180px aside with the main content next to it, and a full width footer. All of this within only one wrapper: the .container element.
span{
display: block;
color: white;
padding: 1rem;
}
.container{
display: flex;
flex-wrap: wrap;
}
header{
width: 100%;
min-height: 50px;
background-color: #e74c3c;
}
aside{
flex-basis: 180px;
min-height: 300px;
background-color: #f1c40f;
}
main{
flex: 1;
min-height: 300px;
background-color: #f39c12;
}
footer{
width: 100%;
min-height: 80px;
background-color: #2ecc71;
}
<div class="container">
<header>
<span>Header</span>
<!-- Put your content here -->
</header>
<aside>
<span>Aside</span>
<!-- Put your content here -->
</aside>
<main>
<span>Main</span>
<!-- Put your content here -->
</main>
<footer>
<span>Footer</span>
<!-- Put your content here -->
</footer>
</div>
I'm helping working on a website for a friend. I'm very new to this and can't get the white container to stretch to the very bottom of the browser page.
Here is the link
html, body {
background-color: transparent;
text-align:center;
text-rendering: optimizelegibility;
margin: 0px;
}
#wrapper {
width: 100%;
max-width: 1088px;
margin: 0 auto;
}
#sitecontainer {
position: relative;
background-color: rgba(255,255,255,0.84);
width: 80%;
max-width: 1038px;
margin: 0 auto;
height: 100%;
padding-right: 30px;
padding-left: 30px;
top: 0;
min-height: 100%;
}
main {
width: 100%;
height: 100%;
margin: 0 auto;
line-height: 1.4;
position: relative;
}
a {
font-family: 'roboto', sans-serif;
font-weight: 500;
color:#3d7109;
text-transform:uppercase;
text-decoration: none;
}
a #footer{
font-family: 'roboto', sans-serif;
font-weight: 300;
text-decoration:none;
text-transform:none;
}
a:hover {
opacity: 0.7;
}
header img {
width: 100%;
max-width: 300px;
font-style: none;
padding-top: 30px;
}
header h2 {
font-family: 'roboto', sans-serif;
font-weight: 500;
font-size: 14px;
text-align: center;
}
h1 {
font-family: 'roboto', sans-serif;
font-weight: 300;
text-transform: uppercase;
text-align:center;
font-style:normal;
}
/* ===================
Nav
=================== */
nav {
margin: auto;
margin-bottom: 30px;
max-width: 700px;
width: 100%;
text-align: center;
margin-bottom: 30px;
}
#menu {
padding: 0;
margin-right: 10px;
margin-left: 10px;
}
#menu li {
display: inline-block;
margin-right: 30px;
margin-bottom: 5px;
font-size: 17px;
text-align: center;
}
#menu li:last-child {
margin-right: 0;
}
/* ===================
Content
=================== */
p {
font-family: 'roboto', sans-serif;
font-weight: 300;
text-align:center;
}
.indexpage article {
margin-bottom: 85px;
}
article:before {
content: "";
display: block;
background: #3f474c;
width: 6px;
height: 1px;
margin-bottom: 16px;
}
.permalinkpage article:before {
margin: 0 auto 16px;
}
.permalinkpage .post {
margin: auto;
font-size: 14px;
letter-spacing: 0.9px;
}
.permalinkpage p {
margin: 24px 0;
}
/* Text */
.permalinkpage .text .post {
width: 100%;
max-width: 500px;
margin: auto;
}
<div id="wrapper">
<div id="sitecontainer" height="100%">
<!---------- HEADER / LOGO ---------->
<header class="wrapper clearfix">
<section id="blog-title">
<h1 style="margin-top: 0px; margin-bottom: 0px;">
<img src="files/images/logo.gif" alt="Healing by Andrea"/>
</h1>
</section>
</header>
<!---------- NAV START ---------->
<nav>
<ul id="menu">
<li>
Home
</li>
<li>
Crystals
</li>
<li>
Bio
</li>
<li>
Rates
</li>
<li>
Gallery
</li>
<li>
Testimonials
</li>
<li>
Contact
</li>
</ul>
</nav>
<!---------- NAV END ---------->
<main class=" permalinkpage">
<!---------- CONTENT ---------->
<div class="grid-sizer"></div>
<article class="text">
<section class="post">
<h1 class="post-title" >"What is Reiki?"</h1>
<article class="type_description"><div class="article-content">
<div class="boxed">
<p>The word Reiki is made of two Japanese words - Rei which means "God's Wisdom or the Higher Power" and Ki which is "life force energy". So Reiki is actually "spiritually guided life force energy."
</p>
<p>A treatment feels like a wonderful glowing radiance that flows through and around you. Reiki treats the whole person including body, emotions, mind and spirit creating many beneficial effects that include relaxation and feelings of peace, security and wellbeing. Many have reported miraculous results.
<br>
Reiki is a simple, natural and safe method of spiritual healing and self-improvement that everyone can use. It has been effective in helping virtually every known illness and malady and always creates a beneficial effect. It also works in conjunction with all other medical </p>
</div>
</div>
</article><!-- Javascript Assets --><p>
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js" type="text/javascript"></script><script src="http://static.tumblr.com/e6lc7yi/7rPn0ryx1/gobig-plugins.js" type="text/javascript"></script></p>
<section class="post-meta">
</section>
</section>
</article>
</main>
</div>
</div>
Any ideas?
html, body {
height: 100%;
}
#wrapper {
height: 100%;
}
Adding these will help you achieve what you are after
This is probably a silly question but I can't seem to figure out how to auto center my section
live demo: http://iam.colum.edu/students/jordan.max/algorerhythm/index.html#
I have tried to add
margin: 0 auto;
to my div#content, with no luck.
The only way I was able to get it be centered was manually entering in
margin-left: xxpx
but I want it to be centered based on what content is in it. Any thoughts? Thanks in advance.
Rest of CSS
body
{
background: #C1CDC1;
}
h1
{
}
h2
{
margin-top: -40px;
margin-left: 120px;
}
h1.mainT
{
width: 590px;
font-family: 'Montserrat', sans-serif;
margin-left: 10px;
font-size: 2.5em;
}
h2.subT
{
width: 130px;
font-family: 'Open Sans Condensed', sans-serif;
}
h3
{
display: inline-block;
font-family: 'Open Sans Condensed', sans-serif;
}
footer
{
color: #FCFCFC;
text-align: center;
font-family: 'Montserrat', sans-serif;
font-size: .85em;
}
section#nav
{
width: auto;
margin-left: 550px;
margin-top: -80px;
padding: 5px;
word-spacing: 80px;
}
div#navContainer
{
height: 100px;
background: #FCFCFC; /* grey99*/
box-shadow: 2px 3px 5px #333;
}
div#content
{
height: 100px;
width: auto;
background: #FCFCFC; /* grey99*/
box-shadow: 2px 3px 5px #333;
display: inline-block;
}
section#contentContainer
{
float: none;
padding-top: 20px;
margin: 0 auto;
}
HTML
<script>
$(document).ready(function () {
$('section#contentContainer').hide();
var $as = $('a.contentDown').click(function () {
//show back button, move it from left +300
$('section').show();
}); //closes click for contentDown
}); //closes ready
</script>
</head>
<body>
<div id="navContainer">
<h1 class="mainT"> Al Gore Rhythm Labs </h1>
<h2 class="subT"> Chicago, IL </h2>
<section id="nav">
<h3> Assignments </h3>
<h3> Writings </h3>
<h3> Presentations </h3>
</section>
</div>
<section id="contentContainer">
<div id="content">
<p> hello motto
</p>
</div>
</section>
</body>
<footer>
<p> Jordan Max 2014</p>
</footer>
</html>
Maybe this is the solution (don't forget to remove style="display: none;" for your section#contentContainer)
Result:
Add text-align center; to your section#contentContainer
section#contentContainer
{
float: none;
padding-top: 20px;
margin: 0 auto;
text-align: center;
}
Good Luck!!
Add 'align="center"' to your section element.
As follows:
<section id="contentContainer" align="center">
This is not the preferred way but if you want to do it only in CSS, you would need to do 'text-align: center' on the element to center align it's internal 'inline-block' element.
CSS: text-align: center
I have coded the layout below, but when tested the 'Login or Signup' link is not positioning to the right side of the page. Any help is appreciated.
HTML
<header>
<h1>Heading</h1>
<p>A clean, minimal, grid-based layout focusing attention on your work.</p
Login or Signup
</header>
CSS
body {
font-family: 'open sans';
color: #333;
}
header {
padding: 20px 20px 20px 50px;
}
a {
color: #333;
text-decoration: none;
}
h1, h2 {
font-weight: 300;
}
Desired Outcome
Here is a working solution:
DEMO
html
<header>
Login or Signup
<h1>Heading</h1>
<p>A clean, minimal, grid-based layout focusing attention on your work.</p>
</header>
css
body {
font-family: 'open sans';
color: #333;
}
header {
padding: 20px 20px 20px 50px;
}
header a {
color: #333;
text-decoration: none;
float: right;
padding-top: 30px;
}
h1, h2 {
font-weight: 300;
}
First thing, please write html in correct way and write css with class name.
here is your answer :
HTML :
<header>
<h1>Heading</h1>
Login or Signup
<p>A clean, minimal, grid-based layout focusing attention on your work</p>
</header>
CSS :
* {
padding: 0;
margin: 0;
}
body {
font-family: 'open sans';
color: #333;
}
header {
padding: 20px;
}
a {
color: #333;
text-decoration: none;
float: right;
}
h1, h2 {
font-weight: 300;
margin :0;
padding: 0;
}
header h1{
width: 70%;
display: inline-block;
}
header a{
width: 30%;
display: inline-block;
padding-top: 10px;
}
Demo Link
Some small changes. the H1 and p have full width so a must be below p. Change the css to
a {
color: #333;
text-decoration: none;
float: right;
margin-right: 70px;
}
p{width: 70%;float: left;}
h1, h2 {
font-weight: 300;
width: 70%;
float: left;
}
Will work fine.
First of all there is a missing > at the end of <p>...</p>
Then try this :
CSS
a
{
color: #333;
text-decoration: none;
display : block;
float : right;
}
HTML
<header>
Login or Signup
<h1>Heading</h1>
<p>A clean, minimal, grid-based layout focusing attention on your work.</p>
</header>
And the jsFiddle http://jsfiddle.net/HxWNh/
<div class="wrapper" style="margin:auto; width:960px:">
<div class="header" style="height:80px;">
<div style="float:left">
<h1 style="float: left;">Heading</h1>
</div>
<div class="login" style="float:right">
Login or Signup
</div>
</div>
<div class="DisplayArea" style="float:left;">
<p>A clean, minimal, grid-based layout focusing attention on your work.</p>
</div>
</div>
.wrapper{
margin:auto;
width:960px;
}
See if this helps...
i always find it easy to easy n convenient to position elements using .