DotDragnet
February 07, 2012, 02:13:14 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Mobile users - Our forum is Tapatalk enabled. http://www.tapatalk.com/
 
   Home   Help Search Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: Simple HTML/CSS Layout Advice  (Read 712 times)
Granty
Hero Member
*****
Posts: 507



grantyh
View Profile Awards
« on: February 15, 2010, 09:53:24 PM »

Evening all. smile

I'm looking to steal some expertise if you will. I'm start by saying that I am by no means a designer and it has been quite some time since I tried.. wink

I'm looking to achieve something like the attached image below. It's not particularly easy on the eye but it would do a job for what I require.



My question to you is, how could this be best achieved? I currently have the following but suspect it is horrible..

Code: (html)
<html>
<head>
<link rel="stylesheet" type="text/css" href="StyleSheet.css" />
  <title>Example Layout</title>
</head>
<body>

<div id="header">
<a href="default.aspx" title="Title"><img src="./Images/banner.png" alt="Descriptive Title" /></a>
</div>

<div id="menu">
        <ul>
            <li><a href="./default.aspx">Home</a></li>
   <li><a href="./two.aspx">Two</a></li>
   <li><a href="./three.aspx">Three</a></li>
        </ul>
</div>

<div class="left-element">
</div>

<div class="right-element">
</div>

<div id="footer">
</div>

</body>
</html>

Code: (css)
body {
}

#header {
height: 90px;
background: #FFFFFF;
width: 95%;
border: 1px dashed;
margin: 0 auto;
}

#menu
{
width: 95%;
margin: 0 auto;
padding: 10px 0px 0px 0px;
}

#menu ul
{
list-style: none;
padding: 0px 0px 0px 0px;
margin: 0 auto;
}

#menu li
{
float: left;
margin: 0 0.15em;
}

#menu li a
{
background: url(Images/background.gif) #fff bottom left repeat-x;
height: 2em;
line-height: 2em;
float: left;
width: 9em;
display: block;
border: 0.1em solid #dcdce9;
color: #0d2474;
text-decoration: none;
text-align: center;
}

.left-element {
float: left;
height: 400px;
background: #FFFFFF;
width: 19%;
border: 1px dashed;
margin: 5px 0px 5px 30px;
text-align: center;
padding: 0px 0px 0px 0px;
clear: both;
}

.right-element {
float: right;
height: 400px;
background: #FFFFFF;  
width: 75%;
border: 1px dashed;
margin: 5px 30px 5px 0px;
padding: 0px 0px 0px 5px;
}

#footer
{
clear: both;
height: 40px;
background: #FFFFFF;
width: 95%;
border: 1px dashed;
margin: 0 auto;
text-align: center;
}

I appreciate that it is a bit of a big ask but would really appreciate some pointers. Along similiar lines, is it possible to prevent the div's from overflowing? i.e. Make the div's dynamic so that they are of a fixed size unless the content overflows?

As for the breadcrumb, I have not looked into this yet but would appreciate any recommendations.

Thanks guys and gals.
Logged
Jeep Stone
Hero Member
*****
Posts: 906



View Profile WWW Awards
« Reply #1 on: February 17, 2010, 11:29:19 AM »

You seem to be pretty much there

1) The breadcrumb can be done exactly as you have the nav. You can put a background image on the li to show the >
2) Set overflow:auto on the divs to prevent them from resizing and give them a specific height
Logged

Granty
Hero Member
*****
Posts: 507



grantyh
View Profile Awards
« Reply #2 on: February 18, 2010, 10:47:08 AM »

You seem to be pretty much there

1) The breadcrumb can be done exactly as you have the nav. You can put a background image on the li to show the >
2) Set overflow:auto on the divs to prevent them from resizing and give them a specific height
Thanks Pete. smile

What if I want the div to resize in line with content that is being pulled from a database? Is that possible with CSS alone?
Logged
Jeep Stone
Hero Member
*****
Posts: 906



View Profile WWW Awards
« Reply #3 on: February 18, 2010, 11:10:12 AM »

You don't need to give it a specific height in that instance. You could give it a min-height but it won't work in IE6 (you need to set it to height in a conditional stylesheet)
Logged

Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF | SMF © 2006-2008, Simple Machines Valid XHTML 1.0! Valid CSS!