HTML Tutorial


 Forum HomeForum Home   FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
RegisterRegister - Not registered yet? Got something to say? Join HTML Code Tutorial!
Problems with Floats and Padding
Post new topic   Reply to topic    HTML Help Forum Index -> CSS
View previous topic :: View next topic  
Author Message
Choy



Joined: 16 Jun 2006
Posts: 2

PostPosted: Fri Jun 16, 2006 1:41 pm     Problems with Floats and Padding Reply with quote

Hi everybody, I was hoping someone could give me some advice on how to fix some problems with a layout I've been tinkering with.

You can view the page here: http://two.fsphost.com/soujiro116/index.html

In Camino/Firefox, the layout looks fine until I add padding to the content and menu floats. Then the floats become misaligned. In addition my height: 100% tag doesn't work.

In IE (OSX), the same thing happens with the exception that the the height stretches unlike in Camino/Firefox.

Thanks in advance for any help!

Source Code:

Code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title><$BlogPageTitle$></title>
<style type="text/css">

body
{ margin-top: 0;
  margin-bottom: 0;
  margin-left: 0;
  margin-right: 0;
  padding-left: 0;
  padding-right: 0;
  background-color: #999999;
}

#blog {
 margin: auto;
 height: 100%;
 width: 790px;
 background-color: #999999;
}

#title {
  width: 560px;
  height: 250px;
  margin-right: 230px;
  background-color: #999999;
}

#content {
  margin-right: 230px;
  height: 100%;
  width: 560px;
  padding: 10px;
  background-color: #FFFFFF;
}

#menu-top {
  float: right;
  width: 230px;
  height: 50px;
  margin-top: 200px;
  background: #CCCCCC url(http://geocities.com/choykun116/menutopbg.jpg)
  no-repeat top right;
}

#menu {
  float: right;
  height: 100%;
  width: 230px;
  padding: 0 20px 20px 20px;
  background: #CCCCCC url(http://geocities.com/choykun116/menubg.jpg)
  repeat-y;
}

#footer {
  clear: both;
  width: 790px;
  height: 15px;
  background-color: #000000;
}

</style>
</head>

<body>

<div id="blog">

<div id="menu-top"></div>
<div id="title"><img src="http://geocities.com/choykun116/lostny02crop.jpg"><img src="http://geocities.com/choykun116/highlightbar2.jpg"></div>
<div id="menu">Menu</div>
<div id="content">Content</div>
<div id="footer"><center><font face="verdana" size="1" color="#FFFFFF">Blogging Since 2006</font></center></div>

</div>

</body>

</html>
Choy



Joined: 16 Jun 2006
Posts: 2

PostPosted: Fri Jun 16, 2006 7:12 pm     Reply with quote

Hi again, I managed to solve some problems on my own, but still have some layout problems that I need help with.

As it stands, the layout renders properly on Firefox/Camino/Safari with the exception that the page height stretches double the window size. How can I get it so that the page reaches the bottom of the window and then stops if there isn't that much content on the page?

In IE however I have another problem. In addition to the page height being too long like in Firefox/Camio/Safari, the positions of the floats are also wrong. In IE for OSX, only the top part of menu float is misaligned (it's too high). In IE 6 for Windows the floats don't line up next to each other and instead are each on a separate line. Does anyone know how remedy this?

You can see the new page at http://two.fsphost.com/soujiro116/index2.html

And here is my source code:

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title><$BlogPageTitle$></title>
<style type="text/css">

html,body
{ margin-top: 0;
  margin-bottom: 0;
  margin-left: 0;
  margin-right: 0;
  padding-left: 0;
  padding-right: 0;
  height: 100%;
  background-color: #999999;
}

#blog {
 margin: auto;
 height: 100%;
 min-height: 100%;
 width: 790px;
 background-color: #999999;
}

#title {
  width: 560px;
  height: 250px;
  margin-right: 230px;
  background-color: #999999;
}

#content {
  margin-right: 230px;
  width: 540px;
  height: 100%;
  min-height: 100%;
  padding: 10px;
  background-color: #FFFFFF;
}

#menu-top {
  float: right;
  width: 230px;
  height: 50px;
  margin-top: 200px;
  background: #CCCCCC url(http://geocities.com/choykun116/menutopbg.jpg)
  no-repeat top right;
}

#menu {
  float: right;
  width: 190px;
  height: 100%;
  min-height: 100%;
  padding: 0 20px 20px 20px;
  background: #CCCCCC url(http://geocities.com/choykun116/menubg.jpg)
  repeat-y;
}

#footer {
  clear: both;
  width: 790px;
  height: 15px;
  background-color: #000000;
}

</style>
</head>

<body>

<div id="blog">

<div id="menu-top"></div>
<div id="title"><img src="http://geocities.com/choykun116/lostny02crop.jpg"><img src="http://geocities.com/choykun116/highlightbar2.jpg"></div>
<div id="menu">Menu Menu Menu Menu Menu Menu Menu Menu Menu Menu Menu Menu Menu Menu Menu Menu Menu Menu Menu Menu Menu</div>
<div id="content">Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content</div>
<div id="footer"><center><font face="verdana" size="1" color="#FFFFFF">Blogging Since 2006</font></center></div>

</div>

</body>

</html>


Thanks![/code][/url]
Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum Index -> CSS All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
HTML Help topic RSS feed 

 
HOSTING / DESIGN
MAKE MONEY

Home
  |   Tutorials   |   Forum   |   Quick List   |   Link Directory   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial