• Howdy! Welcome to our community of more than 130.000 members devoted to web hosting. This is a great place to get special offers from web hosts and post your own requests or ads. To start posting sign up here. Cheers! /Peo, FreeWebSpace.net
managed wordpress hosting

Problem with float...

DarkBlood

NLC
NLC
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<title>Yummy Flavor</title>
	<meta http-equiv="content-type" content="text/html;charset=utf-8">

<script type="text/javascript">
function pspBrowserCheck() {
     if(navigator.appName == "PSP (PlayStation Portable) Internet Browser") {
          location.href = "./PSP/index.htm";
     }
}
</script>
<style type="text/css">
BODY { background:#EEEEEC; color:#5c3566; margin:0px; font-family:Tahoma,Verdana,Helvetica; }
IMG { border:0px; }

#logo { background:transparent; margin-top:20px; margin-bottom:20px; }
#overall-navi { background:transparent; padding:10px; border-left:5px solid #5c3566; margin-left:10px; width:250px; }
#content { float:right; margin-right:10px; text-align:left; }

.navi { margin-bottom:5px; }
.navi A:Link, .navi A:Active, .navi A:Visited { text-decoration:none; color:#5c3566; padding-botton:5px; border-bottom:2px solid #5c3566; padding-right:20px; }
.navi A:Hover { color:#75507b; text-decoration:none; border-bottom:0px; }

.subcontent { text-align:left; }
</style>
</head>

<body>

<div id="logo"><a href="./index.htm"><img src="./IyeruLogo3.png" alt="Iyeru's Designs"></a></div>
<div id="content"><div class="subcontent">Blah, blah, blah!</div></div>
<div id="overall-navi">
	<div class="navi"><a href="./index.htm">Home</a></div>
	<div class="navi"><a href="#">About</a></div>
</div>
</body>
</html>

the div subcontent doesn't want its text to be left aligned. I want its text to be left-aligned though. :S Using the following,
Code:
#content { float:right; margin-right:10px; margin-left:250px; text-align:left; width:100%; }
works, but then it gets jumbled with the nav (yes, margin-left won't work, sadly. But putting it on subcontent does, yet... it still causes the navi to be pushed down)
 
Last edited:
You wouldn't need to define its text alignment since browsers automatically have it defined left by default?
 
You wouldn't need to define its text alignment since browsers automatically have it defined left by default?

Apparently so, but now in order to get rid of that ugly "navigation push" deal, I have to use margin-bottom:-100%; (it works) on subcontent. (it even validates ;))
 
Last edited:
I understand that, I'm not saying what you should or should not do. Just that my experience using floats widths as %'s can act unexpectedly.
 
alright, no real perpose to this, but why did i get negative rep for "floats misbehave without defining widths."

thats what you get for simply trying to help out.
 
Don't worry Haydn, you get neg reps for weird reasons all the time.

In fact, I think I'm gonna get neg rep for this post. :p
 
Back
Top