Help with postioning
Posted: 08 June 2006 08:33 AM   [ Ignore ]
Newbie
Rank
Total Posts:  2
Joined  2006-06-08

Hi

I need some help. I’m trying to align/float the #text tag in the css to the right. For some reason the code centre aligns it! I’ve tried for ages to sort this out an am running out of ideas. See code below,

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"
>

<
html>

<!-- 
SourceDynamic Drive CSS Library -->
<!-- 
URLhttp://www.dynamicdrive.com/style/ -->
<head>
<
title></title>
<
meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<
style type="text/css">

#blueblock{
width180px;
border1px solid;
padding0 0 1em 0;
margin-bottom1em;
font-family'Trebuchet MS''Lucida Grande'Arialsans-serif;
font-size90%;
color#CCCCCC;
}

html #blueblock{ /*IE 6 only */
w\idth147px/*Box model bug: 180px minus all left and right paddings for #blueblock */
}

#blueblock ul{
list-stylenone;
margin0;
padding0;
bordernone;
}

#blueblock li {
border-bottom1px solid ;
height20px;
margin0;
}

#blueblock li a{
displayblock;
height20px;
padding5px 5px 5px 8px;
border-left10px solid 
border
-right10px solid 
background
-imageurl(button_grey.gif);
width157px;
}

html
>body #blueblock li a{ /*Non IE6 width*/
widthauto;
}

#blueblock li a:hover{
background-imageurl(blue.gif);
colorwhite;
height20px;
list-
style-typedisc;
}


#head {

border-stylesolid;
border-color#CCCCCC;
border-weight1px;
background-imageurl(New_banner_1.gif);
width900px;
height200px;
floattop;
}

#text {
floatright
}

body {
background
-imageurl(background.gif);
background-repeatno-repeat;
height700px;
width550px ;

}

</style>
</
head>
<
body>
<
div id="head">

</
div>
<
br>
<
br/>

<
div id="blueblock">
<
ul>
<
li><a href="index.v2.htm" target="_self">Homepage</a></li>
<
li><a href="About_Us.htm" target="_self">About Us</a></li>
<
li><a href="Products.htm" target="_self">Products</a></li>
<
li><a href="Examples.htm" target="_self">Examples</a></li>
<
li><a href="Find_Us.htm" target="_self">Find Us</a></li>
<
li><a href="Contact Us.htm" target="_self">Contact Us</a></li>
</
ul>
</
div>


<
span style="FONT-SIZE: small; COLOR: #000000; FONT-FAMILY: Trebuchet MS; TEXT-DECORATION: underline">3 Warwick Close<br />
   
Market Bosworth<br />
   
Warwickshire<br />
   
C000 099<br />
   
Phone0116 000000<br />
   
E-Mail:<br/>
   <
a href="mailto:Sales@Leicestercobble.co.uk?subject=Question for Leicester Cobble&amp;body=Please type your question here">sales@leicestercoe.co.uk</a>
</
span>

<
p align="right">
<
div id="text">
problem textI what this on the right!!
</
div>
</
p>
</
body>
</
html


Any help would be gratefully received,

Thanks

Profile
 
 
Posted: 09 June 2006 11:09 AM   [ Ignore ]   [ # 1 ]
Newbie
Rank
Total Posts:  2
Joined  2006-06-08

Finally I’ve sorted it! For anyone else who has a problem of this nature here is the fix.

body {
background
-imageurl(background2.gif);
background-repeatno-repeat;
width500px;
height700px;

The problem was in the body tag. I’d spesified a width for the body of the doc and therefore you could’nt right align to the extreme right because the body did’nt go that far.

To sort it out I had 2 options (I think?)

body {
background
-imageurl(background2.gif);
background-repeatno-repeat;
width100%;
height700px;

This would make the body as large as the image used for the background (I Think).

Second remove the width all together.

Thanks

Profile
 
 
   
 
 
‹‹ Nested <div> problem      CSS Job ››