Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-10-2009, 04:55 PM   PM User | #1
char
Regular Coder

 
Join Date: Apr 2008
Posts: 115
Thanks: 11
Thanked 0 Times in 0 Posts
char is an unknown quantity at this point
Three colum layout in css its so hard ?

i am trying to do an three column layout in css i have had some luck but i just cant seem to get it an 100% right as some of the text is over lapping and i cant fit in all the stuff i need


and cant seem to work out the best way two do this layout in just css

here is the html code i have done so fare
Code:
<!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>
<link href="sheet2.css" rel="stylesheet" type="text/css" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
</head>
<body>
<div id="main">
<div id="logo_header">
  <img src="images/logo.png" width="250" height="100" />
  <div id="banner">
  <div class="in_banner_links">
register a hotel find a hotel
  </div>
    <img src="images/banner.png" width="830" height="319" />
  </div>
</div>
   <div id="top_menu">
  <ul>
   <li>menu</li>  <li>BED &amp; BREALFASTS</li> <li>INNS &amp; PUBS</li> <li>WEEKENDS EVENTS &amp; TOURS</li><li>PLACES TO VISIT</li>
   </ul>
   </div>
   <div id="right_menu">
     <p>least events</p>
     <div class="rightmenu_box">
 <img src="images/hotel.jpg" width="140" height="99" /></div>
</div>
   <div id="left_menu">
 <ul>
 <li>Home</li>
 <li> shop</li>
 <li>news</li>
 </ul>
   </div>
   <div id="main_content">
   <div class="main_content_box">
     <p> Welcome to eu arcu vulputate convallis. Donec enim purus, varius vel egestas in, eleifend malesuada tortor.In volutpat metus sit amet augue pharetra nec mattis libero condimentum. Integer viverra urna ac risus elementum at dictum nisi iaculis.</p>
     <p> Suspendisse volutpat urna nec turpis gravida tristique. Suspendisse leo purus, consequat vitae imperdiet vitae, bibendum a nunc. Vestibulum placerat neque nec nibh rutrum aliquam. Nullam ut lorem sed nibh fringilla iaculis et sit rmentum</p>
   </div>
   </div>
   <div id="fotter">
   <ul>
   <li>ABOUT US</li>
    <li>CONTACT US</li>
   <li>TERMS & CONDITION</li>
   </ul>
   </div>
</div>
</body>
</html>
and here is my css

Code:
@charset "UTF-8";
/* CSS Document */

body{
	background-color:#000;
	font:Verdana, Geneva, sans-serif;
	color:#F00;
	background-image:url(images/background.jpg);
background-repeat:repeat-x;
}

#main{
	margin:auto;
	width:1000px;
	height:auto;
}
#logo_header{
	background-image:url(images/logo.png)
	height:auto;
	width:auto;
}
#banner{
	width:830px;
	height:333px;
margin-left:auto ;
 margin-right:auto;

}

.in_banner_links{
	color:#F00;
	float:right;
	font-size:12px;
	font-family:"TrajanPro", Arial, Helvetica, sans-serif;
	text-align:center;
}


.in_banner_links:alink{
	font-size:16px;
	padding:4px;
	color:#F00
	
}
#top_menu{
	margin-right:auto;
	margin-left:auto;
	width:800px;
	color:#F00;
	font-size:10px;
	font-family: Trebuchet, Arial, Helvetica, sans-serif;
	text-decoration:none;
}

#top_menu ul{
 list-style:none;
 color:#F00;
 text-decoration:none;
 }
#top_menu li {
	text-decoration:none;
	display:inline;
	padding-right:20px;
	padding-left:20px;
	text-align:center;
}


#top_menu:alink{
	color:#F00;
	font-size:10px;
	font-family:"TrajanPro", Arial, Helvetica, sans-serif;
	margin-bottom:40px;
	text-decoration:none;
	margin-right:20px;
}
a:link{
	color:#F00;
	text-decoration:none;
	
}
#right_menu{
	float:right;
	width:200px;
	height:auto;
	margin-left:140px;
}
#left_menu{
	float:left;
	width:190px;
	height:auto;
	font-size:18px;
}
#left_menu ul{
 list-style:none;
 color:#F00;
 text-decoration:none;
 font-size:10px;
 }
#left_menu li {
	text-decoration:none;
	font-size:18px;
}
#main_content{
	margin-top:50px;
	width:600px;
	height:auto;
	margin-right:160px;
	margin-left:150px;
	text-align:center;
	font-family:Trajan Pro, Geneva, sans-serif;
	font-size:15px;
	font
}
.main_content_box{
	width:660px;
	background-color:#000;
	color:#ffffff;
	text-align:center;
	margin:auto;
	font-family:Trajan Pro, Geneva, sans-serif;
	font-size:15px;
}

.rightmenu_box{
	width:140px;
	border:#F00 double;
	text-align:center;
}

#fotter{
	clear:both;
	width:650px;
	background:#000;
	color:#F00;
	margin:auto;
	text-align:center;
}

#fotter ul{
 list-style:none;
 color:#F00;
 text-decoration:none;
 font-size:10px;
 }
#fotter li {
	text-decoration:none;
	display:inline;
	padding-right:20px;
	padding-left:20px;
	text-align:center;
}

here is an link to my coding live on the web http://tazfan.co.cc/923/

here is an demo of what i am aming for http://tazfan.co.cc/923/demo.jpg

thank you for your help
char is offline   Reply With Quote
Old 12-10-2009, 05:14 PM   PM User | #2
Excavator
Master Coder


 
Excavator's Avatar
 
Join Date: Dec 2006
Location: Alaska
Posts: 9,410
Thanks: 22
Thanked 1,765 Times in 1,749 Posts
Excavator has a spectacular aura aboutExcavator has a spectacular aura aboutExcavator has a spectacular aura about
Hello char,
Looks like you have a good start there but your box model is off.
You have a 200px wide #right_menu but only 160px of right margin on #main_content.

Try replacing your CSS with this (be sure to back your's up!)
Code:
@charset "UTF-8";
/* CSS Document */

body{
	background-color:#000;
	font:Verdana, Geneva, sans-serif;
	color:#F00;
	background-image:url(images/background.jpg);
/*background-repeat:repeat-y;*/
}

#main{
	margin:auto;
	width:1000px;
	height:auto;
}
#logo_header{
	background-image:url(images/logo.png)
	height:auto;
	width:auto;
}
#banner{
	width:830px;
	height:333px;
margin-left:auto ;
 margin-right:auto;

}

.in_banner_links{
	color:#F00;
	float:right;
	font-size:12px;
	font-family:"TrajanPro", Arial, Helvetica, sans-serif;
	text-align:center;
}


.in_banner_links:alink{
	font-size:16px;
	padding:4px;
	color:#F00
	
}
#top_menu{
	margin-right:auto;
	margin-left:auto;
	width:800px;
	color:#F00;
	font-size:10px;
	font-family: Trebuchet, Arial, Helvetica, sans-serif;
	text-decoration:none;
}

#top_menu ul{
 list-style:none;
 color:#F00;
 text-decoration:none;
 }
#top_menu li {
	text-decoration:none;
	display:inline;
	padding-right:20px;
	padding-left:20px;
	text-align:center;
}


#top_menu:alink{
	color:#F00;
	font-size:10px;
	font-family:"TrajanPro", Arial, Helvetica, sans-serif;
	margin-bottom:40px;
	text-decoration:none;
	margin-right:20px;
}
a:link{
	color:#F00;
	text-decoration:none;
	
}
#right_menu{
	float:right;
	width:200px;
	height:auto;
}
#left_menu{
	float:left;
	width:190px;
	height:auto;
	font-size:18px;
}
#left_menu ul{
 list-style:none;
 color:#F00;
 text-decoration:none;
 font-size:10px;
 }
#left_menu li {
	text-decoration:none;
	font-size:18px;
}
#main_content{
	margin-top:50px;
	height:auto;
	margin-right:220px;
	margin-left:190px;
	text-align:center;
	font-family:Trajan Pro, Geneva, sans-serif;
	font-size:15px;
}
.main_content_box{
	background-color:#000;
	color:#ffffff;
	text-align:center;
	margin:auto;
	font-family:Trajan Pro, Geneva, sans-serif;
	font-size:15px;
}

.rightmenu_box{
	width:140px;
	border:#F00 double;
	text-align:center;
}

#fotter{
	clear:both;
	width:650px;
	background:#000;
	color:#F00;
	margin:auto;
	text-align:center;
}

#fotter ul{
 list-style:none;
 color:#F00;
 text-decoration:none;
 font-size:10px;
 }
#fotter li {
	text-decoration:none;
	display:inline;
	padding-right:20px;
	padding-left:20px;
	text-align:center;
}
You might want to have a look at a good 3-column layout example here.
__________________
Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

Last edited by Excavator; 12-10-2009 at 05:17 PM..
Excavator is offline   Reply With Quote
Old 12-14-2009, 11:45 AM   PM User | #3
char
Regular Coder

 
Join Date: Apr 2008
Posts: 115
Thanks: 11
Thanked 0 Times in 0 Posts
char is an unknown quantity at this point
sorry for the late reply thank you
Excavator

and i am checking out that three colum box module site you sent me now

cheers

thank you very much for your help
char is offline   Reply With Quote
Old 12-15-2009, 11:57 AM   PM User | #4
LE1
New Coder

 
Join Date: Nov 2009
Posts: 47
Thanks: 4
Thanked 1 Time in 1 Post
LE1 is an unknown quantity at this point
I always try and call divs with the names like "column1 column 2" etc helps keep basics easier.
LE1 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:15 PM.


Advertisement
Log in to turn off these ads.