473,396 Members | 1,836 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,396 software developers and data experts.

Div - how to place on on top of other?

Hello,

I have 3 Divs as follow:

<div id="Container">
<div id="Header">header</div>
<div id="Text">text</div>
</div>

I need the div "Text" to have an absolute position inside div
"Container" and to overlap the div "Header".
How can I do something like this?

Thanks,
Miguel

Jan 3 '07 #1
5 11948
On 2007-01-03, shapper <md*****@gmail.comwrote:
Hello,

I have 3 Divs as follow:

<div id="Container">
<div id="Header">header</div>
<div id="Text">text</div>
</div>

I need the div "Text" to have an absolute position inside div
"Container" and to overlap the div "Header".
How can I do something like this?
It'll just work, try it.

Absolutely positioned boxes get stacked on top of normal-flow boxes
anyway.
Jan 3 '07 #2
Hi,

I don't understand what you said.
The code as I have don't solve the my problem.

I want the div TEXT to be over the div HEADER.

Thanks,
Miguel

Ben C wrote:
On 2007-01-03, shapper <md*****@gmail.comwrote:
Hello,

I have 3 Divs as follow:

<div id="Container">
<div id="Header">header</div>
<div id="Text">text</div>
</div>

I need the div "Text" to have an absolute position inside div
"Container" and to overlap the div "Header".
How can I do something like this?

It'll just work, try it.

Absolutely positioned boxes get stacked on top of normal-flow boxes
anyway.
Jan 3 '07 #3
shapper wrote:
Hi,

I don't understand what you said.
The code as I have don't solve the my problem.

I want the div TEXT to be over the div HEADER.

Thanks,
Miguel

Ben C wrote:
>On 2007-01-03, shapper <md*****@gmail.comwrote:
>>Hello,

I have 3 Divs as follow:

<div id="Container">
<div id="Header">header</div>
<div id="Text">text</div>
</div>

I need the div "Text" to have an absolute position inside div
"Container" and to overlap the div "Header".
How can I do something like this?
It'll just work, try it.

Absolutely positioned boxes get stacked on top of normal-flow boxes
anyway.
Perhaps an web page to see what is being attempted? Re-positioning the
text may not be appropriate. Given that though.

For CSS positioning see http://www.w3.org/TR/REC-CSS2/visuren.html or
search for tutorials on CSS positioning.

An alternative method is to set margin values on #text (negative
margin-top value will display higher in the flow)

(BTW for semantic markup replace the div element with a heading element)

Louise

Jan 4 '07 #4
It is not easy to post some code as I am using Asp.Net and the code is
generated at runtime so first I need to understand how to solve my
problem with CSS.

Consider what I wrote before:

<div id="Container">
<div id="Header">header</div>
<div id="Text">text</div>
</div>

I was doing the following:

#Container {position:relative}
#Text {position: absolute; left:0; right:0}

So when "Text" is visible it should overlap "Header".

Well, this is what I think it should be happening.
Somehow, "Text" looks like it is not inside "Container". Why?
Because I keep having "Text" showing on the top left corner of my
browser and not on the top left corner of "Container".

Any idea?

Thanks,
Miguel

boclair wrote:
shapper wrote:
Hi,

I don't understand what you said.
The code as I have don't solve the my problem.

I want the div TEXT to be over the div HEADER.

Thanks,
Miguel

Ben C wrote:
On 2007-01-03, shapper <md*****@gmail.comwrote:
Hello,

I have 3 Divs as follow:

<div id="Container">
<div id="Header">header</div>
<div id="Text">text</div>
</div>

I need the div "Text" to have an absolute position inside div
"Container" and to overlap the div "Header".
How can I do something like this?
It'll just work, try it.

Absolutely positioned boxes get stacked on top of normal-flow boxes
anyway.

Perhaps an web page to see what is being attempted? Re-positioning the
text may not be appropriate. Given that though.

For CSS positioning see http://www.w3.org/TR/REC-CSS2/visuren.html or
search for tutorials on CSS positioning.

An alternative method is to set margin values on #text (negative
margin-top value will display higher in the flow)

(BTW for semantic markup replace the div element with a heading element)

Louise
Jan 4 '07 #5
shapper wrote:
It is not easy to post some code as I am using Asp.Net and the code is
generated at runtime so first I need to understand how to solve my
problem with CSS.

Consider what I wrote before:

<div id="Container">
<div id="Header">header</div>
<div id="Text">text</div>
</div>

I was doing the following:

#Container {position:relative}
#Text {position: absolute; left:0; right:0}

So when "Text" is visible it should overlap "Header".
It will if you replace right:0 with top:0;

--
Gus
Jan 4 '07 #6

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

Similar topics

22
by: bearophileHUGS | last post by:
Here are some questions and suggestions of mine that I've collected in the last weeks on the language (please note that some (most?) of them are probably wrong/useless/silly, but I've seen that...
9
by: justanotherguy63 | last post by:
Hi, I am designing an application where to preserve the hierachy and for code substitability, I need to pass an array of derived class object in place of an array of base class object. Since I...
1
by: success_ny | last post by:
I would like to be able to display either one or the other HTML table in the same place. I.e., there are 2 buttons on the screen. When the user clicks one button, the table A is displayed below....
4
by: Merkisson Jourhanssen | last post by:
When aspx is requested, load one user control or other based on queryString value. How to do this? Note: only one user control to possibly appear on the page at one time; and either of which to be...
3
by: vitaly.tomilov | last post by:
I'm using an ASP.NET form to display data from my database table, and I'm doing it in the following way: XmlDataDocument doc = new XmlDataDocument(mydataSet); XPathNavigator nav =...
10
by: Water Cooler v2 | last post by:
I've asked myself this question in the past but couldn't afford more time to it (I program other languages for my bread and butter), so I'll ask now since it's never too late. What does the...
5
by: Ian Bicking | last post by:
I got a puzzler for y'all. I want to allow the editing of functions in-place. I won't go into the reason (it's for HTConsole -- http://blog.ianbicking.org/introducing-htconsole.html), except that...
0
by: jackyustb | last post by:
Now i'm coding with SWT?Jface. i wanna show some messages on sash,so i wish to place a lable on the sash. how to do?
15
by: rizwanahmed24 | last post by:
Hello i have made a custom control. i have placed a panel on it. I want this panel to behave just like the normal panel. The problem i was having is that the panel on my custom control doesnt...
2
by: Reggie | last post by:
Hi and TIA! I have a class file located in my root directory with all me web pages. I call/use the class and it works fine. I have no imports statements aspx or codebehind. My question is why? ...
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...
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
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.