Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / HTML, CSS, Scripts / CSS / May 2007



Tip: Looking for answers? Try searching our database.

switching top/bottom position of elements with unknown height

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
TKapler - 26 May 2007 01:31 GMT
hi, i have two blocks in xhtml, e.g.
#div A
#div B

inside those divs there is an unknown text (for design), so i do not
know the height of any of this divs
The problem is, that i need to show them as
#div B
#div A

so switch their positions.
i tried
#div A float right
#div B float left

but it doesn't help (i can just move the div B on the left hand side
of div A, but not above), position absolute is of course nonsense
(unknown height, and i got a footer below those two divs)

any help would be appreciated, thx
dorayme - 26 May 2007 02:47 GMT
> hi, i have two blocks in xhtml, e.g.
> #div A
[quoted text clipped - 16 lines]
>
> any help would be appreciated, thx

You have 2 divs and you want one of them to the right of the
browser window to some extent and the other to be below but at
the left of the window to some extent? Look at:

<style type="text/css">

#a {float: left; width:50%;}
#b {clear:both; float: right; width: 50%;}

</style>

</head>

<body>

<div id="a">Lorem ipsum dolor sit amet, consectetuer adipiscing
elit. Pellentesque augue.Suspendisse consectetuer velit nec
neque. Duis nec orci quis nulla egestas fermentum.Ut quis eros.
Aenean at augue vitae quam posuere vehicula. Pellentesque
habitantmorbi tristique senectus et netus et malesuada fames ac
turpis egestas. Maecenas justonunc, porta sed, molestie eget,
adipiscing id, ante. Cum sociis natoque penatibus etmagnis dis
parturient montes, nascetur ridiculus mus. Suspendisse potenti.
Nunc blanditmagna id odio sodales luctus. Nulla quam magna,
viverra quis, dignissim blandit, viverra nec</div>

<div id="b">Lorem ipsum dolor sit amet, consectetuer adipiscing
elit. Pellentesque augue.Suspendisse consectetuer velit nec
neque. Duis nec orci quis nulla egestas fermentum.Ut quis eros.
Aenean at augue vitae quam posuere vehicula. Pellentesque
habitantmorbi tristique senectus et netus et malesuada fames ac
turpis egestas. Maecenas justonunc, porta sed, molestie eget,
adipiscing id, ante. Cum sociis natoque penatibus etmagnis dis
parturient montes, nascetur ridiculus mus. Suspendisse potenti.
Nunc blanditmagna id odio sodales luctus. Nulla quam magna,
viverra quis, dignissim blandit, viverra nec</div>

</body>
</html>

Signature

dorayme

Ben C - 26 May 2007 22:13 GMT
> hi, i have two blocks in xhtml, e.g.
> #div A
[quoted text clipped - 16 lines]
>
> any help would be appreciated, thx

I don't think it's possible without knowing the heights or using
JavaScript.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.