navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
FrontPage Alternative
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

 

CSS Layout questions

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> Cascading Style Sheets >> CSS Layout questions
Page: [1]
 
signs22

 

Posts: 5
Joined: 4/14/2006
Status: offline

 
CSS Layout questions - 4/14/2006 10:10:01   
Hi, I'm very new to CSS and have never used it before. I've been searching the web for some codes to copy and paste, and I'm having problems with laying out my page with CSS. I'm doing it in Dreamweaver, and it's showing up perfect in my WYSIWYG, but when i preview it in IE6, the format doesn't show. I have a 4 column page: Header, Navigation (left column), Content (right column) and Footer.

The problem I get in IE6 is that the columns positioned left and right are correct, it's just the starting point of the content column I have trouble with. The first words in my content area idoesn't start until the words in the nav columns end. In effect, I have a huge gap in my content area and have to scroll down to read the start of the content.

Here's my code:

<style type="text/css">
body {
background-color: black;
font-size:10px;
font-family:Verdana, Arial, Helvetica, sans-serif;
}
div#outer {
width: 800px;
background-color:pink;
margin-top: 6px;
margin-bottom: 6px;
margin-left: auto;
margin-right: auto;
padding: 0px;
border: none;
}

div#header {
padding: 0px;
margin: 0px;
text-align: left;
height: 100px;
width: 100%;
background-image: url(gradient.jpg);
background-position: top;
background-repeat: repeat-x;

}


div#menu {
padding: 0px;
margin: 0px;
text-align: center;
background-image: url(gradient.jpg);
background-position: top;
background-repeat: repeat-x;
}
div#title {
text-align: left;
padding: 0px;
margin: 0px;
}
div#nav {
top: 160px;
left: 15px;
width: 200px;
padding: 10px;
margin-top: 1px;
float: left;

}
div#content {
margin-left: 250px;
margin-right: 15px;
top: 0;
width: 550px;
padding: 5px;

}
div#footer {

padding: 5px;
margin: 0px;
border-top: thin solid #000000;
}
</style>


Can someone please help me?
Many thanks,
Tailslide

 

Posts: 6290
Joined: 5/10/2005
From: Out here on the raggedy edge
Status: offline

 
RE: CSS Layout questions - 4/14/2006 10:41:49   
Can you post your markup too - or preferably a URL where we can look at what's going on - much easier to troubleshoot.

But, that said - doing this:

top: 160px;
left: 15px; 

Won't work in a relatively positioned div. You can do margin-top or margin-left.

_____________________________

"My strategy is so simple an idiot could have devised it"
Little Blue Plane Web Design | Blood, Sweat & Rust - A Land Rover restoration project

(in reply to signs22)
signs22

 

Posts: 5
Joined: 4/14/2006
Status: offline

 
RE: CSS Layout questions - 4/14/2006 11:01:56   
Sure. I'm working offline, so it's not posted on the web, but I'll copy and paste the code for you:



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<style type="text/css">
body {
background-color: black;
font-size:10px;
font-family:Verdana, Arial, Helvetica, sans-serif;
}
div#outer {
width: 800px;
background-color:pink;
margin-top: 0px;
margin-bottom: 0px;
margin-left: auto;
margin-right: auto;
padding: 0px;
border: none;
}

div#header {
padding: 0px;
margin: 0px;
text-align: left;
height: 100px;
width: 100%;
background-image: url(gradient.jpg);
background-position: top;
background-repeat: repeat-x;

}


div#menu {
padding: 0px;
margin: 0px;
text-align: center;
background-image: url(gradient.jpg);
background-position: top;
background-repeat: repeat-x;
}
div#title {
text-align: left;
padding: 0px;
margin: 0px;
}
div#nav {
margin-top: 160px;
margin-left: 15px;
width: 200px;
padding: 10px;
margin-top: 1px;
float: left;

}
div#content {
margin-left: 250px;
margin-right: 0px;
top: 0;
width: 550px;
padding: 5px;


}
div#footer {

padding: 0px;
margin: 0px;
border-top: thin solid #000000;
}
</style>

</head>


<body>
<div id="outer">
<DIV id="header">
<h1>Header</h1>
</div>

<div id="menu"><h3><a href="">Hotmail</a> | <a href="">Google</a> | Generic</h3></div>
<div id="nav"><h4>Navigation</h4>
<ul><li>Let me not to the marriage of true minds</li>
<li>Admit impediments; love is not love</li>
<li>Which alters when it alteration finds</li>
<li>Which alters when it alteration finds</li>
<li>Which alters when it alteration finds</li>
<li>Which alters when it alteration finds</li>
<li>Which alters when it alteration finds</li>
<li>Which alters when it alteration finds</li>
<li>Which alters when it alteration finds</li>
<li>Which alters when it alteration finds</li>
<li>Which alters when it alteration finds</li>
<li>Which alters when it alteration finds</li>
<li>Which alters when it alteration finds</li>
<li>Which alters when it alteration finds</li>
<li>Which alters when it alteration finds</li>
<li>Which alters when it alteration finds</li>
<li>Which alters when it alteration finds</li>
</ul>
</div>

<div id="content"> <div id="title"><img src="Images/Home.jpg" width="551" height="82" />
</div>
<p>Main Content -- "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." </p>


<p>"Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?" </p>

<p>"But I must explain to you how all this mistaken idea of denouncing pleasure and praising pain was born and I will give you a complete account of the system, and expound the actual teachings of the great explorer of the truth, the master-builder of human happiness. No one rejects, dislikes, or avoids pleasure itself, because it is pleasure, but because those who do not know how to pursue pleasure rationally encounter consequences that are extremely painful. Nor again is there anyone who loves or pursues or desires to obtain pain of itself, because it is pain, but because occasionally circumstances occur in which toil and pain can procure him some great pleasure. To take a trivial example, which of us ever undertakes laborious physical exercise, except to obtain some advantage from it? But who has any right to find fault with a man who chooses to enjoy a pleasure that has no annoying consequences, or one who avoids a pain that produces no resultant pleasure?" </p>



<p>"At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet ut et voluptates repudiandae sint et molestiae non recusandae. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat." </p>

</div>
<div id="footer"><p><strong>Footer text -- Admit impediments... | Copyright | Contact me | Sitemap | Au Revoir</strong></p>

</div>
</div>

</body>
</html>



Thanks!!

(in reply to signs22)
Tailslide

 

Posts: 6290
Joined: 5/10/2005
From: Out here on the raggedy edge
Status: offline

 
RE: CSS Layout questions - 4/14/2006 11:08:20   
reduce the margin-left on the content div to about 210px and that allows enough room for the content to sit next to the nav.

_____________________________

"My strategy is so simple an idiot could have devised it"
Little Blue Plane Web Design | Blood, Sweat & Rust - A Land Rover restoration project

(in reply to signs22)
signs22

 

Posts: 5
Joined: 4/14/2006
Status: offline

 
RE: CSS Layout questions - 4/15/2006 0:40:52   
Thanks Tailslide, yeh I think it had something to do with the sizing of my columns. When I increased the outer container, it worked fine.

(in reply to signs22)
signs22

 

Posts: 5
Joined: 4/14/2006
Status: offline

 
RE: CSS Layout questions - 4/15/2006 1:08:59   
Question 2: CSS Layout Templates

I have a second question that relates to CSS Layouts.

I've drawn a wireframe for a webpage I'd like to design, but am not sure how many columns I need, so was wondering if anyone point me in the right direction to get templates for CSS layouts? Or better yet, would someone be able to tell me what columns I need to set up a page like this?

[image]image here[/image]

Attachment (1)

(in reply to signs22)
Tailslide

 

Posts: 6290
Joined: 5/10/2005
From: Out here on the raggedy edge
Status: offline

 
RE: CSS Layout questions - 4/15/2006 3:55:29   
If you want exactly what you've shown there with no footer then I'd do:

<div id="container">
  <div id="header">
     Logo and top nav goes here
   </div> <!-- end header -->
  <div id="sidebar">
      Sidebars stuff goes here
   </div> <!-- end sidebar -->
  <div id="main">
      Main content area here
  </div> <!-- end main -->
</div> <!-- end container -->


You can centre the container div if you want. Then float the sidebar left and the main div right they should then sit next to each other.

There are loads of CSS layout help sites out there - Google is your friend! Here's just one from many: http://www.ssi-developer.net/main/templates/index.shtml

You're after a very simple layout so when you look at all the various layout sites my advice would be to:
1. stay away from absolute positioning for any of your big layout divs - it's unecessary and can make your life difficult.
2. Stay away from hacks such as the "box model hack" for example if you can. If you absolutely must use IE hacks (and they mostly are IE hacks) then stick them in an IE only stylesheet and feed them just to IE using conditional comments http://www.quirksmode.org/css/condcom.html

_____________________________

"My strategy is so simple an idiot could have devised it"
Little Blue Plane Web Design | Blood, Sweat & Rust - A Land Rover restoration project

(in reply to signs22)
signs22

 

Posts: 5
Joined: 4/14/2006
Status: offline

 
RE: CSS Layout questions - 4/16/2006 5:29:10   
Great, thanks tailslide for the info!

(in reply to signs22)
Page:   [1]

All Forums >> Web Development >> Cascading Style Sheets >> CSS Layout questions
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts