473,406 Members | 2,281 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,406 software developers and data experts.

appendChild() and CSS position attributes

What does a child element inherit as far as position, top, left, etc.
?
I'm using DHTML to create child, and append with appendChild()

I actually used "position:absolute" with a parent element.
What should I set to ensure that a child element's position would be
"relative" to the parent.

Is nesting <div> elements legal ?
Are there other ways to implement a container ?
TIA for you input.

May 23 '06 #1
4 2510
i_****@hotmail.com wrote:
I actually used "position:absolute" with a parent element.
What should I set to ensure that a child element's position would be
"relative" to the parent.
position:absolute isn't inherited. But the relationship between the
parent, floated element, and it's children remains relative.
Is nesting <div> elements legal ?
Yes of course

http://www.w3.org/TR/html4/struct/global.html#edef-DIV
Are there other ways to implement a container ?


Any element with another element inside it could be considered a
container. I don't think that's what you're asking though. The answer
is; yes, loads.

--
Brian O'Connor (ironcorona)
May 24 '06 #2
ironcorona wrote:
i_****@hotmail.com wrote:
I actually used "position:absolute" with a parent element.
What should I set to ensure that a child element's position would be
"relative" to the parent.


position:absolute isn't inherited. But the relationship between the
parent, floated element, and it's children remains relative.


Sorry. It is inherited
http://www.w3.org/TR/CSS21/visuren.html#choose-position
--
Brian O'Connor (ironcorona)
May 24 '06 #3
ironcorona wrote:
position:absolute isn't inherited. But the relationship between the
parent, floated element, and it's children remains relative.


Sorry. It is inherited
http://www.w3.org/TR/CSS21/visuren.html#choose-position
--
Brian O'Connor (ironcorona)
May 24 '06 #4
ironcorona wrote:
ironcorona wrote:
position:absolute isn't inherited. But the relationship between the
parent, floated element, and it's children remains relative.


Sorry. It is inherited
http://www.w3.org/TR/CSS21/visuren.html#choose-position


Inherited: no

I think this means it is not inherited, doesn't it?
--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)
May 24 '06 #5

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

Similar topics

25
by: kie | last post by:
hello, i have a table that creates and deletes rows dynamically using createElement, appendChild, removeChild. when i have added the required amount of rows and input my data, i would like to...
2
by: kie | last post by:
hi, when i use appendChild, the following code ends in success cellSec3=document.createElement('TD'); aTextBox=document.createElement('input'); aTextBox.type = 'text'; aTextBox.value =...
1
by: Nicolas Van Lancker | last post by:
Hi folks; I have this webpage, allowing users to insert multiple records in one post into the database. Because I don't know the exact number of records they want to add, I created a little...
2
by: Michael Lee | last post by:
Does anyone know why the following function works in FireFox but not in IE6? function ShowTable() { clonedNode = document.getElementById("myTable").cloneNode(true); win = window.open();...
1
by: Shawn Modersohn | last post by:
Firstly, thanks for all the help in here. My code is: <script type="text/javascript"> var img1= new Image(200,200) img1.src="file://d:/datatools/c++/boat1.jpg" var img2 = new Image(200,200)...
1
by: Ryan Stewart | last post by:
If you don't want to read this post because of its length, I understand. I've spent two and a half days on this problem and have a good deal of information to relate. And this is kind of a long...
7
by: Andrew Poulos | last post by:
If I try to append a PARAM tag twice I'm having problems: var.medDiv = document.getElementById("myDiv"); var medObj = document.createElement("object"); var p =...
1
by: xaces | last post by:
I am relatively new to javascript. I am trying to create a menu. I cant get it to show on IE. The object exists but just wouldnt show up. Can anyone please help?? Thanks :confused: var...
2
by: Rick | last post by:
I'm using an xpathnavigator in a windows form to append child with attributes. xnav.AppendChild("<item name="""" value=""" & client supplied value & """/>") When the client enters a value...
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
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...
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.