473,386 Members | 1,817 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

switching top/bottom position of elements with unknown height

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

May 26 '07 #1
2 2593
In article <11********************@w5g2000hsg.googlegroups.co m>,
TKapler <ka****@gmail.comwrote:
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
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>

--
dorayme
May 26 '07 #2
On 2007-05-26, TKapler <ka****@gmail.comwrote:
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
I don't think it's possible without knowing the heights or using
JavaScript.
May 26 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Markus Mohr | last post by:
Hi, everyone, I have a special problem: For every monitor resolution in 200 pixel steps from 800 to 1600 pixels I have an image to be shown as centered background-image. Those images all...
7
by: DaWoE | last post by:
Hi, I want to place a div centered of another div in IE. I get this to work in Mozilla, but not in IE. The code i use for mozilla is the following : <html> <head> <style type="text/css">
13
by: Greg | last post by:
Most suggestions on this topic recommend to use a page footer and make it visible only on the last page. My problem is that the footer is half of the height of a page which means the detail would...
4
by: john | last post by:
Hi to All, I am new to html authoring, so sorry if my terminology is not correct or exact. I would like to position a footer div to the bottom of the browser window. As I research in the web...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.