473,396 Members | 1,987 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.

relative element inside absolute element?

Jezternz
145 100+
Okay so I want to place a relative division inside an absolutely positioned division.
Expand|Select|Wrap|Line Numbers
  1. <div style="position:absolute;left:50px;right:50px;top:50px;bottom:50px">
  2.     <div style="position:relative;margin:0 auto;height:100%;width:500px;">testing123</div>
  3. </div>
  4.  
This isn't the code from my website but is good enough for demonstration. So I want to absolutely position one division, then within that division I want to center another one, and have it spanning the full height of the absolutely positioned one. This code works fine in FF & Chrome, but in IE for some reason the height will only expand when content is stuck into the relative div. How can I fix this?

Cheers, J
Aug 23 '10 #1
2 1746
TheServant
1,168 Expert 1GB
If it works in everything except IE then your code is probably good. IE never plays by the rules which is why most developers hate it. Everything that is suggested will be a work around, and will either require you to use an IE only stylesheet, or will be using incorrect styles to get it done. I don't have my home computer to play around with this, so I can't offer a workaround right now, but maybe later.

Again, if you find a solution that fixes the IE one and doesn't break the others, use it. If it does break the others, put it in a an IE only stylesheet.
Aug 24 '10 #2
JKing
1,206 Expert 1GB
I'm not sure if that is the right way to be using absolute positioning. Normally you would declare a top or bottom and a left or right but not all four together.

Nonetheless, the reason IE isn't expanding to the full height is because there is no height given for the absolute div thus IE defaults to it's own height of nothing when there is no content.
Aug 25 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: gqtang | last post by:
How to chage Absolute url to relative url ,and relative url to absolute url
6
by: ste.paoletti | last post by:
hi, I have read that browsers support block element inside inline element but the css is not valid. Someone can tell me more about? What do you think? Thanks.
1
by: Luqman | last post by:
Where is Form Relative Position and Absolute Position in VS.Net 2005 ? Best Regards, Luqman
6
by: axlq | last post by:
I've spent most of the day struggling with what I thought would be a trivial problem. I have a hidden element that appears, outside of the normal flow, when the mouse hovers over an inline...
5
by: felipevaldez | last post by:
how can I put an element below another element, that's not absolutely positioned? so I have a n element, called X, and next to that, an element Y X Y XXXXXX
3
by: mikewse | last post by:
I have a strange problem where it seems IE is doing the correct layout but Firefox and Safari isn't. I think I'm probably wrong, and there is something in the standards that say behaviour should be...
3
by: rlueneberg | last post by:
I want to change the color of an "a" child element inside a table cell via javascript. Is there any way to do that? Ps: there is no id assigned to child elements. I would like to discover the child...
5
by: SuneR | last post by:
Hi, I am having problems figuring out how to make Firefox behave, and output the HTML I want it to output. The thing I want done is actually quite simple. I have a <labeltag, and inside it, I...
2
by: MATTXtwo | last post by:
how to get/set element that inside of iframe from parent pages.. please give me tip.. my iframe define :name="ifrMenu" id="ifrMenu" the element inside of iframe that i need control :id="mnuLevel"
2
by: AlannY | last post by:
Hi there. I'm writing a program under Linux. I need a function that convert relative path to absolute (or full path). Under Windows, I have a GetFullPathName function in WinAPI. But now, I need...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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...

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.