Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
centering 3 divs inside a container problem
Old 12-02-2008, 10:58 AM centering 3 divs inside a container problem
Webmaster Talker

Posts: 611
Trades: 0
i have 3 divs centered in the page called "leftrectangle" "centerrectangle" and "leftrectangle" inside a container div, and i get white space to the left of "rightrectangle" inside the container div. any help greatly appreciated. here is the code. derek

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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
#wrapper {
  width: 760px;
  margin-right: auto;
  margin-left: auto;
  border-right: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  }
  #box{
   
  margin-right: auto;
  margin-left: auto;
  background-color:orange;
  width: 50px;
  height: 50px;
  padding: 0 px;
  }
  #rectangle{
  position: relative;
  margin-left: auto;
  margin-right:auto;
  margin-top: 0px;
  background-color: orange; 
  width: 760px;
  height: 50px;
   padding: 0px;
   }
  #leftrectangle{
   
   float:left;
  
  background-color: blue;
  width: 33.3%;
  height: 50px;
  padding: 0px;
  }
   #centerrectangle{
  float:left;
  
  background-color: red; 
  width: 33.3%;
  height: 50px;
   padding: 0px;
   }
  
  #rightrectangle{
  float:left;
  
  background-color: green; 
  width: 33.3%;
  height: 50px;
   padding: 0px;
   }
   
  </style>
</head>
 
<body>
<div id="wrapper">
  <div id="box" > </div>
  <div id="rectangle"></div>
  <div id ="leftrectangle"></div>
  <div id = "centerrectangle"></div>
  <div id ="rightrectangle"></div>
</div>
</body>
 
</html>

Last edited by silverglade; 12-02-2008 at 11:06 AM..
silverglade is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 12-02-2008, 11:08 AM Re: centering 3 divs inside a container problem
Webmaster Talker

Posts: 611
Trades: 0
Nevermind, it wasnt showing up right in dreamweaver, but it shows up perfectly in internet explorer. but if you see any errors in my code please help. thank you .derek
silverglade is offline
Reply With Quote
View Public Profile
 
Old 12-09-2008, 04:03 AM Re: centering 3 divs inside a container problem
Super Talker

Posts: 143
Trades: 0
can you find a online example of this successfully programmed? Examine their source code.
__________________

Please login or register to view this content. Registration is FREE
specialk is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to centering 3 divs inside a container problem
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.11762 seconds with 12 queries