HOME       >>       Programming

Problem With Css And Div Tag It is not aligned right


BooZker

Can anyone help me with the site? My problem is i can't get the DIV box inside my main outline box. Here is my example of what my problem is (its the attachment). The side bar which is bolded is what i want and where i want. I can't get it there however. Here is my CSS:

#sidebar { width: 140px; border-style: solid solid solid solid; border-color: #94AA74; border-size: 1px; border-width: 1px; margin: 10px; float: right; }

Is this right? When i take out the float: right it stays inside the main box that holds all the DIV boxes, but once i put a float: right it does not stay within the main box. Why is this? I know CSS pretty well as well as HTML, but i can't figure this out. Any help?

FLaKes

It would help if you could add a link or somewhere where we can see the page and the div in action. I entered your site and I didnt see any side bar.


fffanatics

Yeah and the fact that the file is a php file, unless we through the files onto our own server to run, we wont be able to see what you mean. Either upload it to your Xisto site or post a screen shot so we can see it. I would check the float element and or add a z-index element to your css to make sure the box you want on top has the highest z-value.


BooZker

OK i fixed it. I just had to move it between these other DIV tags. It was just misplaced.


derickkoo

Can anyone help me with the site? My problem is i can't get the DIV box inside my main outline box. Here is my example of what my problem is (its the attachment). The side bar which is bolded is what i want and where i want. I can't get it there however. Here is my CSS:

#sidebar { width: 140px; border-style: solid solid solid solid; border-color: #94AA74; border-size: 1px; border-width: 1px; margin: 10px; float: right; }

Is this right? When i take out the float: right it stays inside the main box that holds all the DIV boxes, but once i put a float: right it does not stay within the main box. Why is this? I know CSS pretty well as well as HTML, but i can't figure this out. Any help?


when use float in box, remember to put a clear element at the last of the outline box. otherwise the above float will not be enclosed but the outline box.

example:

<div id="outbox"> <div id="div1">....</div> <div id="div2">....</div> <br style="clear:both;" /> </div>


Notice from truefusion:
You must place coding into CODE bbcode. Second verbal warning.


BooZker

oh... Thanks! let me try it out.



VIEW ORIGINAL REGISTER GET FREE HOSTING

Xisto.com offers Free Web Hosting to its Members for their participation in this Community. We moderate all content posted here but we cannot warrant full correctness of all content. While using this site, you agree to have read and accepted our terms of use, cookie and privacy policy. Copyright 2001-2019 by Xisto Corporation. All Rights Reserved.