Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

positing a layer using css

Status
Not open for further replies.

chaos986

Programmer
Sep 22, 2000
4
US
I need to positiona layer floated to the right but still creating a corrdinate system for its children. float:left does not satisfy the second requirement, and i cannot seem to get javascript command screen.width to work in css code. I can position the layer relatively in one resolution but this fails under different resolutions. is there a css, asp, vbscript command that i can employ? [sig]<p>Mike2<br><a href=mailto:chaos986@yahoo.com>chaos986@yahoo.com</a><br><a href=http// Mike2 Website</a><br>also see my small busness work @ http:/www.michaelswgp.com[/sig]
 
You just have to position the layer using absolute positioning, while using relative for it's children OR even use absolute for them too.

example: for layer(foo) absolute, children relative.

.foo{
position: absolute;
left: 50%;
top:50%;
)

/*Now for the kids*/

.foo table, .foo div, .foo whatever{
position: relative;
left: 10px;
top:10px;
}

this way &quot;foo&quot; is at the center of the screen while it's kids are 10 px right and below of it.
If resolutions is ur problem don't use pixels, use something like 50%. Yup...it works fine.

Cheers,

Manos Batsis
manosb@profile.gr

[sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top