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
Old 09-08-2007, 08:43 AM Floating Issues
Galaxian's Avatar
Rich Powell

Posts: 842
Name: Rich Powell
Location: United Kingdom
Trades: 0
I'm having problems with floating things in my design.

The menu is floated to the left and the main part of the page is a non floated div next to it.

There are a few problems..

The main being whenever an item is floated on the main page if it is bigger than the main div it will extend into and below the footer. I want the main div to contain anything itself it.

Secondly, if the navigation is larger than the main part of the page, then it will extend over the footer and beyond.

I just want everything to stay proportional whilst enabling the floating of layers.

Any ideas?
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

Please help get the new
Please login or register to view this content. Registration is FREE
forum started for Webmasters like you!

Galaxian is offline
Reply With Quote
View Public Profile Visit Galaxian's homepage!
 
 
Register now for full access!
Old 09-08-2007, 03:44 PM Re: Floating Issues
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
Quote:
The main being whenever an item is floated on the main page if it is bigger than the main div it will extend into and below the footer. I want the main div to contain anything itself it.
Sounds like you're not CLEARING your floats, and you must do so.
Quote:
Secondly, if the navigation is larger than the main part of the page, then it will extend over the footer and beyond.
Again, probably more to do with clearing the floats, but could be somewhat structural too. I'd have to see the code to know.

Oh.. and they are not 'layers'.. that's an antiquated term that DW insists on propagating - a holdover from the old, old Netscape Navigator days.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 09-08-2007, 05:42 PM Re: Floating Issues
Galaxian's Avatar
Rich Powell

Posts: 842
Name: Rich Powell
Location: United Kingdom
Trades: 0
Thank you.

How do I clear them? Clear: both? I tried it and it didn't like it. (In the container element)
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

Please help get the new
Please login or register to view this content. Registration is FREE
forum started for Webmasters like you!

Galaxian is offline
Reply With Quote
View Public Profile Visit Galaxian's homepage!
 
Old 09-09-2007, 09:02 AM Re: Floating Issues
danfinney's Avatar
Average Talker

Posts: 22
Name: Dan Finney
Trades: 0
Galaxian,

See if this helps you sort things out:

<html>
<head>
<style type="text/css">
<!--
#col_one {
float:left;
width:300px;
border:solid 1px green;
}

#col_two {
border:solid 1px red;
}


#footer {
clear:left;
border:solid 1px blue;
}
-->
</style>
</head>

<body>
<div id="col_one">Content for id "col_one" Goes Here</div>
<div id="col_two">Content for id "col_two" Goes Here</div>
<div id="footer">Content for id "footer" Goes Here</div>
</body>
</html>
__________________
d a n f i n n e y

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
danfinney is offline
Reply With Quote
View Public Profile Visit danfinney's homepage!
 
Old 09-10-2007, 05:10 AM Re: Floating Issues
Galaxian's Avatar
Rich Powell

Posts: 842
Name: Rich Powell
Location: United Kingdom
Trades: 0
Thank you Dan.

This works in IE but in Firefox the container of the container clears and not the actual container DIV.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

Please help get the new
Please login or register to view this content. Registration is FREE
forum started for Webmasters like you!

Galaxian is offline
Reply With Quote
View Public Profile Visit Galaxian's homepage!
 
Old 09-10-2007, 02:51 PM Re: Floating Issues
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
You might want to read up on a few things:
http://css-discuss.incutio.com/?page=FloatLayouts

http://css-discuss.incutio.com/?page=ClearingSpace
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 09-11-2007, 04:30 AM Re: Floating Issues
Galaxian's Avatar
Rich Powell

Posts: 842
Name: Rich Powell
Location: United Kingdom
Trades: 0
Quote:
Originally Posted by LadynRed View Post
Thank you.

Had some compaitability issues while doing this and also trying to attain 100% height.

Currently in Firefox the #main div overlaps the footer by about 20 pixels for some reason. In IE 6 everythings messed, IE 7 too.

Here's my stylesheet. Forgive me, i've severely messed it up since I've been trying to fix all these cross browser issues but it just gets worse whenever I try.

Code:
html, body {
min-height: 100%;
/*height: auto !important;*/
padding: 0px;
margin: 0px;
}

body {
font-family: 'Trebuchet MS', Arial, Verdana;
padding: 0px;
margin: 0px;
height: 100%;
margin-top: 17px;
background: url('images/topbgrad.gif') top repeat-x #b6daff;
}

input {
font-family: 'Trebuchet MS', Arial, Verdana;
}

#wrap {
margin-left: auto;
margin-right: auto;
width: 836px;
background: url('images/rightreal.gif') repeat-y right #8db7dd;
}

#left {
background: url('images/leftreal.gif') repeat-y left;
width: 100%;
}

#leftwrap {
background: url('images/left.gif') no-repeat top left;
width: 100%;
}

#rightwrap {
background: url('images/right.gif') no-repeat top right;
min-height: 200px;
width: 100%;
}

#topbar {
height: 25px;
background: url('images/toppagebar.gif') top right no-repeat;
text-align: right;
width: 614px;
padding-right: 15px;
font-size: 12px;
font-weight: bold;
color: #ffffff;
float: right;
}

#topbar a:link, #topbar a:visited {
color: #ffffff;
}

#topbar a:hover {
color: #EBFFCC;
text-decoration: underline;
}

#navigationwrap {
padding-left: 11px;
}

#navigation {
float: left;
width: 196px;
padding-top: 60px;
background: url('images/menutop.gif') no-repeat top left #8db7dd;
font-weight: bold;
overflow: hidden;
font-size: 12px;
}

#navigation a:link, #navigation a:visited {
display: block;
padding-left: 35px;
margin-bottom: 5px;
color: #ffffff;
text-decoration: none;
}

#navigation a:hover {
background: #ffffff;
color: #0A416D;
text-decoration: underline;
}

#header {
height: 113px;
width: 836px;
background: url('images/header.gif') no-repeat left;
margin-left: auto;
margin-right: auto;
}

#main {
/*padding: 10px;
margin-left: 196px;*/
padding-right: 10px;
height: 100%;
float: right;
width: 619px;
display: table;
clear: right;
}

#mainwrap {
padding: 15px;
padding-left: 20px;
background: #ffffff;
}

#footer {
margin-left: auto;
margin-right: auto;
height: 34px;
background: url('images/footer.gif') bottom center no-repeat;
clear: both;
}
html for header:

Code:
<div id="header">

</div>

<div id="wrap">
<div id="left">
<div id="leftwrap">
<div id="rightwrap">

<div id="navigationwrap">
<div id="navigation">
  <a href="index.php">Home</a>
  <a href="rock-paper-scissors.php">Play Singleplayer</a>
  <a href="rock-paper-scissors-multiplayer.php">Play Multiplayer</a>
    <?php (($loggedin == true) ? print "  <a href=\"users/".$user['username']."\">Your Profile</a>\n  <a href=\"account.php\">Account Settings</a>":print "  <a href=\"login.php\">Login</a>\n  <a href=\"register.php\">Create an Account</a>")?>
  <a href="about.php">About MMORPS</a>
  <a href="support.php">Support</a>
</div>
</div>

<div id="topbar"><?php

(($loggedin == true) ? print "Hello, <a href=\"users/$username\">$username</a>! <a href=\"login.php?logout=1\">[Logout]</a>":print "<a href=\"register.php\">Create an account to play!</a>");

?></div>

<div id="main">

<div id="mainwrap">
code for footer:

Code:
</div>
</div>
</div>
</div>

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

</body>
</html>
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

Please help get the new
Please login or register to view this content. Registration is FREE
forum started for Webmasters like you!


Last edited by Galaxian; 09-11-2007 at 03:44 PM..
Galaxian is offline
Reply With Quote
View Public Profile Visit Galaxian's homepage!
 
Old 09-11-2007, 07:37 AM Re: Floating Issues
maxxximus's Avatar
Extreme Talker

Posts: 219
Name: Rob
Location: UK
Trades: 0
It would help if you could post your HTML as well.
maxxximus is offline
Reply With Quote
View Public Profile
 
Old 09-11-2007, 08:31 AM Re: Floating Issues
Galaxian's Avatar
Rich Powell

Posts: 842
Name: Rich Powell
Location: United Kingdom
Trades: 0
Quote:
Originally Posted by maxxximus View Post
It would help if you could post your HTML as well.
Edited
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

Please help get the new
Please login or register to view this content. Registration is FREE
forum started for Webmasters like you!

Galaxian is offline
Reply With Quote
View Public Profile Visit Galaxian's homepage!
 
Old 09-11-2007, 03:15 PM Re: Floating Issues
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
On the #main being floated, in IE you'll run into the doubled-float margin bug because you have the box floated right with a right margin.

You need to use conditional comments and a separate 'iefixes' css file that will contain ONLY the "hacks" needed to make IE6 behave.

You'll see ALL the bugs you must deal with here:
http://www.positioniseverything.net/explorer.html

Why do you have display:table in there ?
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 09-11-2007, 03:23 PM Re: Floating Issues
Galaxian's Avatar
Rich Powell

Posts: 842
Name: Rich Powell
Location: United Kingdom
Trades: 0
Quote:
Originally Posted by LadynRed View Post
On the #main being floated, in IE you'll run into the doubled-float margin bug because you have the box floated right with a right margin.

You need to use conditional comments and a separate 'iefixes' css file that will contain ONLY the "hacks" needed to make IE6 behave.

You'll see ALL the bugs you must deal with here:
http://www.positioniseverything.net/explorer.html

Why do you have display:table in there ?
Thank you, I'll take a look into that.

However, Firefox is also misbehaving with the #main because it's height is 100% it, for some reason, extends 95% into the footer.

And the display: table is there to enable 100% height of main. Is there another way?
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

Please help get the new
Please login or register to view this content. Registration is FREE
forum started for Webmasters like you!

Galaxian is offline
Reply With Quote
View Public Profile Visit Galaxian's homepage!
 
Old 09-11-2007, 03:25 PM Re: Floating Issues
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
You don't need a table for that:
http://www.webmaster-talk.com/css-fo...l-browser.html

You are going to need conditional comments to pull in a 2nd css file ONLY for IE6. IE6 doesn't support min/max width or height.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 09-11-2007, 03:42 PM Re: Floating Issues
Galaxian's Avatar
Rich Powell

Posts: 842
Name: Rich Powell
Location: United Kingdom
Trades: 0
I seem to have gotten some issues under control. Instead of making seperate stylesheets for different browser I did a transparent div wrapped around the margin-left and -right's and used padding.

One prominent offending problem that sticks out now is that with Firefox 100% height is not being achieved, but in IE(6, 7) it is.

I have updated my style and header, Let me just update those in the previous posting.

Edit: Regarding the 100% div thread.

I have tried these methods but none really work with my design because the 100% just require the floats to be 100% between the header and footer. In IE 6 and 7 it works, however in Firefox it persists. In my time with playing about with this, the main sometimes extends into the footer (Firefox), or extends down all the page (Ie 6). But Firefox has never really done what I've intended in respect to this.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

Please help get the new
Please login or register to view this content. Registration is FREE
forum started for Webmasters like you!


Last edited by Galaxian; 09-11-2007 at 03:54 PM..
Galaxian is offline
Reply With Quote
View Public Profile Visit Galaxian's homepage!
 
Old 09-11-2007, 10:29 PM Re: Floating Issues
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
I'd have to see ALL the code to debug that. Suffice it to say, if IE appears to be doing it 'right', then it's usually doing it WRONG.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Floating Issues
 

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.61918 seconds with 12 queries