Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Base CSS Values off elements in Page?

0 views
Skip to first unread message

AA

unread,
Jan 5, 2001, 2:12:21 PM1/5/01
to
In the CSS file can you reference the positions of elements on the page.

Here is my HTML:

<HTML>
<HEAD>
<TITLE>
Sample Page
</TITLE>
<link rel="stylesheet" type=text/css href=..\css\style.css>
<DIV ID='Parent' Style='position:absolute;top:10;left:200;'>
<IMG SRC='..\images\picture.jpg'>
</DIV>
<DIV ID = 'CHILD' >
<IMG SRC='..\images\picture1.jpg'>
</DIV>
</BODY>
</HTML>

Here is my Style Sheet:
#CHILD
{
LEFT: 500;
POSITION: absolute;
TOP: 100;
VISIBILITY: visible
}

In my Style Sheet can I do something like this: Syntax is probably wrong:
LEFT: document.all.Parent.style.posleft + 100

Thanks,
Andrew


AA

unread,
Jan 5, 2001, 4:44:11 PM1/5/01
to
Got it. IE only Though

<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE></TITLE>
</HEAD>
<BODY>
<DIV id=Parent>
<P>Parent Line 1</P>
<P>Parent Line 2</P></DIV>
<P>Line 1</P>
<P>Line 2</P>
<P>&nbsp;</P>
<DIV id=Child style="LEFT: expression(document.Parent.style.posLeft + 10);
POSITION: absolute;
TOP: expression(document.Parent.style.posTop + 50);
VISIBILITY: visible">
<P>Child Line 1</P>
<P>Child Line 2</P></DIV>

</BODY>
</HTML>

"AA" <karc...@zdnetonebox.com> wrote in message
news:uNplLszdAHA.2208@tkmsftngp04...

0 new messages