Forum Moderators: open
See LINKS and posting CODE [webmasterworld.com] for help and guidlelines.
Then I put in this which allows for specific printing from an area designated on the jpeg
<body>
<div id="container" style="height: 870px; left: 0px; top: 0px;">
<form><map name="FPMap0" id="FPMap0">
<area href="print.css" shape="rect" coords="887, 215, 1076, 232" />
</map>
<img alt="" src="jgswebpage6welcome.jpg" width="1152" height="864" usemap="#FPMap0" onclick="window.print();return false;" /></form>
And heres the content. I am writing some print.css so only this part will print btw but more importantly I need to fix this to the jpeg behind it so it moves as the browser changes....
<div style="position:absolute; width: 655px; height: 430px; z-index: 3; left: 400px; top: 265px; id="layer3" class="newStyle1">
<P><FONT style="FONT-SIZE: 13px" face=Verdana color=#000000>Founded in,.....
Heres the div with the menu - one of the parts that moves dependent on the browser and part of what I want to fix/attach to the jpeg:
<div style="position: absolute; width: 155px; height: 450px; z-index: 2; left: 115px; top: 250px" id="layer2">
<ul id="verticalmenu" class="glossymenu">
Can anyone help?
Thanks!
Position: absolute positions the element relative to
- the closest parent that "has position"
or
- the viewport if no parent exists which has position.
an element gets position by having either "position: absolute" or "position: relative" itself. (your container has position)
Other troubles you might be struggling with (not sure, use what you need):
- to center a absolutely positioned element you need a trick: set the width with e.g. "width: 200px;", the left side in the middle of the parent with position: "left: 50%" and then a negative margin on the left of half the width of the element: e.g.:"margin-left: -100px;" . There are other ways, but they are far more trouble in legacy browsers like IE < 8.
- to use the full height of the browser's window: "height: 100%" is a tricky thing: it sets the height of the element to the height of the direct parent provided that the height is explicitly set on the parent and is different from "auto". There is an exception: the root element (the parent of html) has the height of the viewport. So to get something to be as tall as the viewport, you need to set height: 100% on html, body, and *all* elements between it and the body (wrappers included),
BTW: I'm seeing a lot of superfluous css in there ... e.g.: height: auto is the default, block elements start with 100% width, left:0 and top:0 are the default for position:relative, ...