CSS - A Positioned Absolute Div Looks Smaller When On A Smaller Reseloution
i have a webpage that the layout looks perfectly fine when looking on a monitor larger than 1024x768. when i look at it on that screen size everything inside of a div that is absolutly positioned gets put over it as if it is smaller than it is on the larger screen size.
has anyone else come across this problem and know how to resolve it. please ask for more info if needed. many thanks in advance. i have attached an image with the problem showing RESOLVED: i redid my javascript Similar TutorialsIs there a command in CSS that can determine the height of a line break instead of the default which is way too big? I want to create a line break in my text, but the <BR> command's is too big. Is there a way in CSS to dictate how large of a break I want? However, I only want to apply it to certain parts of a the page, but not the whole thing. How can I do this? I am not experienced in CSS or any web design for that matter. I am trying to make a very simple web site using CSS and I am being frustrated by some positioning problems. I would appreciate your help! Problem: When I restore the browser window to a smaller size, "things" in my web page start to overlap eachother. The smaller the window, the greater the overlap. What I have done: I have validated everything, guess and checked multiple positioning elements, fiddled with margins, and have browsed through multiple CSS sites looking for help. What I would like fixed: When the browser is in a smaller window, there will be a scrollbar that appears preserving the size of the web page instead of scrunching it all together. Graphical Representation: Full-Screen Smaller Window - Overlapping I Like This - Note the Scrollbar on the bottom Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html;charset=utf-8"> <title>Chapel</title> <style type="text/css"> @import "layout.css"; </style> </head> <body> <div id="chapell"> <img src="graphics\chapel1.jpg" alt="chapel"> </div> <div id="news"> <a href="news.html"> <img src="graphics\news.jpg" alt="news"> </a> </div> <div id="us"> <a href="index.html"> <img src="graphics\us.jpg" alt="us"> </a> </div> <div id="directions"> <a href="directions.html"> <img src="graphics\directions.jpg" alt="directions"> </a> </div> <div id="contact"> <a href="contact.html"> <img src="graphics\contact.jpg" alt="contact"> </a> </div> <div id="schedule"> <a href="schedule.html"> <img src="graphics\schedule.jpg" alt="schedule"> </a> </div> <div id="myspace"> <a href="http://www.myspace.com" target="_blank"> <img src="graphics\myspace.jpg" alt="myspace"> </a> </div> <div id="art"> <a href="art.html"> <img src="graphics\art.jpg" alt="artistry"> </a> </div> <div id="messages"> <a href="messages.html"> <img src="graphics\messages.jpg" alt="messages"> </a> </div> <div id="scoop"> <img src="graphics\scoop.jpg" alt="scoop"> </div> <div class="roundcont"> <div class="roundtop"> <img src="tl.gif" alt="" width="15" height="15" class="corner" style="display: none" /> </div> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p><br><br> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p> <div class="roundbottom"> <img src="bl.gif" alt="" width="15" height="15" class="corner" style="display: none" /> </div> </div> </body> </html> Code: body { color: white; background-color: #FDF8DF } #chapell img { position: absolute; left: 21.5%; top: 34%; border: none; margin-bottom: 10%; margin-right: 10%; } #news img { position: absolute; left: 20%; top: 38%; border: none; margin-bottom: 10%; margin-right: 10%; } #us img { position: absolute; left: 20%; top: 42%; border: none; margin-bottom: 10%; margin-right: 10%; } #directions img { position: absolute; left: 20%; top: 46%; border: none; margin-bottom: 10%; margin-right: 10%; } #contact img { position: absolute; left: 20%; top: 50%; border: none; margin-bottom: 10%; margin-right: 10%; } #schedule img { position: absolute; left: 20%; top: 54%; border: none; margin-bottom: 10%; margin-right: 10%; } #myspace img { position: absolute; left: 20%; top: 58%; border: none; margin-bottom: 10%; margin-right: 10%; } #art img { position: absolute; left: 20%; top: 62%; border: none; margin-bottom: 10%; margin-right: 10%; } #messages img { position: absolute; left: 20%; top: 66%; border: none; margin-bottom: 10%; margin-right: 10%; } #whoarewe img { position: absolute; left: 37%; top: 25%; } #scoop img { position: absolute; left: 36%; top: 25%; margin-bottom: 10%; margin-right: 10%; } #findus img { position: absolute; left: 40%; top: 25%; } #banter img { position: absolute; left: 32.5%; top: 25%; } #docket img { position: absolute; left: 39%; top: 25%; } #expressions img { position: absolute; left: 37%; top: 25%; } #listen img { position: absolute; left: 39%; top: 25%; } .roundcont { top: 35%; right: 35%; width: 35%; background: white; color: black; position: absolute; margin-left: 10%; margin-top: 0%; } .roundcont p { margin: 0 3%; font: 12px arial, tahoma, serif; } .roundtop { background: url(tr.gif) no-repeat top right; } .roundbottom { background: url(br.gif) no-repeat top right; } img.corner { width: 3%; height: 15px; border: none; display: block !important; } Thank you, Daniel Hi, I've a problem with a layout, I don't understand why div container appears smaller than input field contained. PHP Code: <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <style type="text/css" > body { margin : 10px; background-color : gray; } .container{ background-color : orange; border : 3px solid black; padding : 40px; } </style> </head> <body > <div class="container"> <input name="prova" value="Look to the right -----> -----> -----> -----> -----> " type="text" style="width:2000px;"> </div> </body> </html> ps. Verified with Firefox 2.0.0.4 and mozilla 1.7.13 Any hint? I can forsee having display issues on smaller screens and idk how to prepare for this. For example if i use the margin or padding property to say..center an image or align text. Keeping in mind that for example my wrapper div is coded in percent(other things too). So smaller screens=shrinkage, but the code thats not percent values will stay the same. The code is kind of a mess the most used components are at the top. Code: body {background:#white; } #wrap {margin-left:20%; margin-right:20%; } #header {border: 2px solid grey; background:white; } #titlearea { height:100px; padding:4px; font-family:Verdana; } #belowimg {background:#6a7c63; margin:0px; height:40px; border-top:2px solid grey; } .link {float:left; margin-top:8px; margin-left:5px; background:#6a7c63; border-right:1px solid #681300; height:20px; width:100px; text-align:center; text-decoration:none; font-family:Lucida Grande; padding-right:3px; margin-bottom:8px } .linklast {float:left; margin-top:8px; margin-left:0px; background:#6a7c63; height:20px; width:100px; text-align:center; text-decoration:none; font-family:Lucida Grande; padding-right:3px; margin-bottom:8px } #main {border:1px solid grey; background:tan; padding:10px; padding-right:0px; margin-top:0px; font-size:.80em; font-family:Verdana; color:#000000; height:100%; } #rightcontent {float:right; border-left:1px dashed grey; padding-left:0px; padding-right:0px; height:90%; width:230px; font-size:small; margin-left:8px; background:white; } .button { font-size:small; font-family:Verdana; border-top:1px solid grey; padding:8px; margin:0px; padding-bottom:0px; background:white; } .button.center { padding-left:23px; text-align:center; } .button.right {float:right; border:1px solid red; padding:2px; background:blue; } #imagescroller{width:530px; float:left; margin-right:10px; margin-left:10px; height:300px; padding:4px; border-top:2px solid #f1e1b8; border-left:2px solid #f1e1b8; border-right:2px solid #f1e1b8; border-bottom:2px solid #f1e1b8; background:blue; } #bottom {background:blue; border-bottom:2px solid red; border-right:2px solid #f1e1b8; border-left:2px solid #f1e1b8; height:30px; padding:0px; color:grey; margin-top:0px; width:600px; height:30px; } .box { padding-top:0px; margin:1px; font-size:.80em; font-style:strong; float:left; color:grey; background:white; font-family:Lucida Grande; line-height:1px; margin-top:196px; } .left {float:left; padding-right:20px; padding-bottom:0px; margin-bottom:0px; } .right {float:right; border-left:1px solid grey; border-bottom:1px solid grey; background:white; } .inside {border-top:1px solid white; padding-left:3px; padding-right:3px; background:#ffa812; font-family:Verdana; font-size:.70em; height:20px; background:#EEC900; color: #000000; } .bottom {height:10px; background:#DEECFF; border-top:1px solid grey; } .imagebottom {background:white; border-bottom:2px double #f1e1b8; padding:3px; color:grey; } #blockquote {margin-left:18%; font-size:.60em; padding-left:40px; color:brown; font-family:Verdana; font-style:italic; background:white; border-left:4px dotted orange; } #topping {border-bottom:1px solid grey; margin-left:1px; margin-top:4px; } #bottomborder {border-bottom:1px solid grey; margin-left:1px; } #footer {border:1px solid grey; height:30px; margin-top:5px; } #test {height:20px;} .test1 {margin-top:3px; border-top:1px solid #fcfcfc; height:0px; } .test2 {height:0px; border-top:1px solid #f5f5f5; } .test3 {height:0px; border-top:1px solid #ededed; } .test4 {height:0px; border-top:1px solid #e5e5e5; } .test5 {height:0px; border-top:1px solid #dedede; } .test6 {height:0px; border-top:1px solid #d9d9d9; } .test7{height:0px; border-top:1px solid #d3d3d3; } .test8 {height:0px; border-top:1px solid #cfcfcf; } .test9 {height:0px; border-top:1px solid #c9c9c9; } .test10{height:0px; border-top:1px solid #c2c2c2; } #testy{height:20px; color:000000; } h2 {font-size: 1.571em} /* 22px */ h3 {font-size: 1.429em} /* 20px */ h4 {font-size: 1.286em} /* 18px */ h5 {font-size: 1.143em;} /* 16px */ h6 {font-size: 1em; font-family:Verdana;color:brown;} /* 14px */ h2, h3, h4, h5, h6 { font-weight: 400; line-height: 1.1; margin-bottom: .8em; } /* Anchors */ a {outline: 0;} a img {border: 0px; text-decoration: none;} a:link, a:visited { color: #c7a01e; padding: 0 1px; text-decoration: none; } a:hover, a:active { /*background-color: #C74350;*/ color: #f09419; text-decoration: underline; text-shadow: 1px 1px 1px #333; } strong, b {font-weight: bold;} 060 em, i {font-style: Thanks I'm using a relative-positioned div as a container for an image, which is absolute-positioned. I'm doing this so that the image will automatically scale down to fit inside the containing div (nothing else I've tried has done this for me- so if there is another way to achieve this, please fill me in). This part works fine, but the image isn't as wide as the containing div, so I would like to center the image inside the div- but I can't seem to get it to work. I tried the obvious text-align:center in the div. That actually worked... kinda. The image's left-side was in the center of the div, but obviously isn't the 'centering' that I'm looking for. I then tried setting margin-left and margin-right on the image to auto, and that did nothing. I suspect that the fact that I have my image absolute-positioned is the culprit here, but I don't know how to get around it- or IF I can get around it without drastically changing my approach. Admittedly, the container div resides inside a table cell. I know that isn't the best practice, but I spent so much time trying a div-only approach only to waste time and become frustrated that I went back to what I know works- at least for now. I tried removing the container div from the table and inserting the image directly to the table cell- but encountered more issues with the sizing of the image. Essentially, my code is something like this: CSS: Code: td#CONTENTDISPLAY { width: 100%; height: 100%; text-align: left; vertical-align: top; padding: 0 0 0 0; margin: 0 0 0 0; } div#CONTENTBANNER { position: relative; height: 100%; padding: 0 0 0 0; } img.CONTENTIMG { position: absolute; height: 100%; } HTML: Code: ... <td id="CONTENTDISPLAY"> <div id="CONTENTBANNER"> <img class="CONTENTIMG" /> </div> </td> ... Nothing flashy, I know. One thing I should mention, however, is that the image is ALWAYS placed inside the container div using a Javascript function (it's a dynamic image). I doubt that makes a difference, but I figure it's worth mentioning. Can anyone help point me in the right direction? Thanks! - skubik My Question is... When I put an image in a stylesheet, when does it get loaded? Does it get loaded when the style sheet gets loaded or does it get loaded only if I'm using the style on the page that has the image? The reason I ask... I have a lot of images in my style sheet, and I'm concerned about performance. Only some of the images in the style sheet are used on each page, but never all of them at once. I'm wondering if I should split up my style sheet into smaller style sheets, so that I will never be loading images for a page that I'm not going to be using on that page. (this would require the inclusion of 2 smaller style sheets on each page instead of 1 big style sheet). My style sheet is over 200 kb right now, and that does not include the image file sizes. Please advise. hey guys JonnoWalmsley.com is giving me grief. I have a nav bar which is position:absolute; bottom:0px (so stuk to the bottom of the screen at all times, with the appropriate z-index etc). It works fine on FF, but IE seems to be starting from the center of the page, which effectively pushes the nav bar over to the right, and partially off the screen on smaller screens. Code: <div style="position:fixed; bottom:0px; background-color:#0a2a1a; width:899px;">...nav links...</div> I need IE to render the same as FF, and start the nav panel from the left. Any ideas? IE Screenshot FF Screenshot We don't use position absolute for anything else on our site, but it seems that our drop down still goes under some content. Here is the css: Code: #nav { background-image: url('../images/nav-full-bg.jpg'); background-repeat: repeat-x; width: 967px; height: 69px; padding: 0; margin: 0; overflow: hidden; } #nav, #nav ul { /* all lists */ padding: 0; margin: 0; list-style: none; line-height: 1; } #nav a { display:block; padding: 11px 12px 13px 12px; font-weight:bold; font-size: 13px; font-family: "Trebuchet MS", Bitstream Vera Sans, Verdana; color: #626262; margin: 0; text-decoration: none; } #nav li { /* all list items */ float: left; } #nav li ul { /* second-level lists */ position:absolute; width: 200px; left: -999em; /* using left instead of display to hide menus because display: none isn't read by screen readers */ border-bottom: 2px solid #808080; background-image: url(../images/davidpng2.png); z-index: 900; } #nav ul li { float: left; width: 10em; /* width needed or else Opera goes nuts */ } #nav li ul li a{ padding:5px; display: block; width: 190px; color: #000; font-weight:normal; font-family:verdana; font-size:11px; } #nav li ul li a:hover{ background-color:#a2c9f4; } #nav li ul ul { /* third-and-above-level lists */ margin: -23px 0 0 200px; ; } #nav li ul li ul li a{ display: block; } #nav li:hover ul ul, #nav li.sfhover ul ul { left: -999em; } #nav li:hover ul, #nav li li:hover ul, #nav li.sfhover ul, #nav li li.sfhover ul { /* lists nested under hovered list items */ left: auto; } I have a header div with a background image - it's basically a pair of hands holding a banner - the arms extending to the sides of the window. I'm trying to work it so that, no matter how wide or thin the window, the arms will always extend to the sides. So when you make it smaller, the image will disappear beyond the viewing window. This happens automatically on the right-hand side, but the image is stopping it on the left. Is there a way to set a min-width, which is smaller then the image itself, so that when the window is shrunk the image starts to disappear on either side until it reaches the min-width? I'm trying to get it so the arms will disappear and stop at the hands. Or can anyone suggest an alternative solution? I tried to do it with background and header image, with the arms on the background, so when the top image moves it looks like the arms move with it. That worked great until I started using a patterned background. Full width: |---------------------------------------| |AAAAAAAAHHH BBBBBBBBBBBBBB HHHAAAAAAAAA| |---------------------------------------| Shrunk width: ------- |------------------------| -------- AAAAAAA |AHHH BBBBBBBBBBBBBB HHHA| AAAAAAAA ------- |------------------------| -------- Grey bit outside window edge. | Window side A Arms H Hands B Banner I hope that makes sense. I expect there's an easy solution but I've been trying to figure it out for several hours and could do with someone else's perspective. Thanks. I have created a 2-column liquid layout that works perfectly in Safari, FF(Win & Mac), Netscape(Win & Mac), IE5(Mac) and IE6(Win). In IE5 and 5.5 (Win) I don't get any images. the images are all position:absolute, with their containers set to position: relative. I tried them at first as simple image tags with a class assigned. I then tried to wrap them in Divs with ids. I also messed a little with the z-indexes. Nothing has worked so far. The HTML... Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3. org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <style type="text/css" media="screen"><!-- @import url(css/base.css); --></style> <style type="text/css" media="print"><!-- @import url(css/print.css); --></style> </head> <body> <div id="container"> <div id="head"> <div id="headerTitle"><img src="images/headerTitle.gif" alt="Ken Dalton" height="100" width="325" border="0"/></div> <div id="headerGraphic"><img src="images/headerGraphic_Home.gif" alt="Header Graphic" height="100" width="400" border="0"/></div> </div> <div id="leftColumn"> <img src="images/typewriter_Home.gif" alt="typewriter" height="220" width="120" border="0"/> <p class="linkSelectedTop1">Welcome</p> <p class="link1"><a href="bio.php">Biography</a></p> <p class="link1"><a href="blog.php?category=">Musings</a></p> <p class="link1"><a href="guestBook.php">Guest Book</a></p> <p class="link1"><a href="links.php">Links</a></p> <p class="link1"><a href="mailto:ken@kendalton.com">Contact</a></p> </div> <div id="rightColumn"> <div id="rightPages48"><img src="images/rightPages48.gif" alt="graphic" height="600" width="48" border="0"/></div> <div id="krdPortrait"><img src="images/krdPortrait.gif" alt="Portrait of Ken Dalton" height="200" width="175" border="0"/></div> <h1>Welcome</h1> <p class="clear"> </p> </div> <div id="footer"><p> </p></div> </div> </body> </html> The CSS... html { height: 100%; margin: 0 auto; padding: 0; text-align: left; background-color: #000000; } body { height: 100%; margin: 0; padding: 0; font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif; font-weight: normal; font-size: 80%; background-color: #000000; } a { text-decoration: none; color: #A50023; } #container { position: relative; margin: 0; padding: 0; min-height: 100%; } * html #container { height: 100%; } #head { position: relative; background-image: url("../images/headerBlend.gif"); background-repeat: repeat-x; background-position: 0 0; text-align: left; margin: 0; padding: 0; height: 100px; } #headerTitle { position: absolute; top: 0; left: 0; z-index: 10; } #headerGraphic { position: absolute; top: 0; right: 0; z-index: 9; } #rightPages48 { position: absolute; top: 0px; right: 0; z-index: 10; } #krdPortrait { position: absolute; top: 0px; right: 64px; z-index: 10; } #leftColumn { float: left; top: 100px; left: 0; z-index: 10; width: 120px; margin: 0; padding: 0; background-color: #000000; text-align: right; } #leftColumn p { font-weight: bold; margin-left: 0px; margin-right: 0px; margin-top: 0px; margin-bottom: 0px; padding-right: 9px; padding-top: 3px; padding-bottom: 3px; } #leftColumn a { color: #BFA673; } #leftColumn a:hover { color: #A50023; } .link1 { border-top: 1px solid #606880; margin-top: 0px; margin-bottom: 0px; padding-right: 9px; padding-top: 3px; padding-bottom: 3px; } .linkSelected1 { color: #A50023; border-top: 1px solid #606880; margin-top: 0px; margin-bottom: 0px; padding-right: 9px; padding-top: 3px; padding-bottom: 3px; } .linkSelectedTop1 { color: #A50023; margin-top: 0px; margin-bottom: 0px; padding-right: 9px; padding-top: 3px; padding-bottom: 3px; } #rightColumn { position: relative; min-height: 100%; margin: 0; margin-left: 120px; padding: 0; background-image: url("../images/rightColumnFill48.gif"); background-repeat: repeat-y; background-position: 100% 0%; background-color: #FFFFFF; text-align: left; } * html #rightColumn { height: 100%; } #rightColumn h1, h2, h3, h4, h5, h6, p { margin-left: 36px; margin-right: 320px; margin-top: 0px; margin-bottom: 0px; } #rightColumn h1 { font-size: 200%; color: #606880; padding-top: 36px; } #rightColumn p { color: #333333; margin-top: 9px; } #clear { width: auto; height: 500px; margin-right:48px; margin: 0; padding: 0; margin-right:48px; background-color: Transparent; } #footer { width: auto; height: 72px; margin: 0; padding: 0; background-color: #000000; } #footer p { margin-top: 36px; } It seems strange to me if I begin a page with: body{text-align: center} and a following div with a wrapper: #wrapper{position: absolute; top: 0px} that this would push everything to the left or the right depending on the browser. It seems the logical thing to occur would be that the body tag would shift everything to the center and the wrapper would simply press up to the top of the screen. My problem is fixed simply by changing the position to relative for the wrapper, but I'm curious why that's the case. Thanks. I'm trying to place an absolutely positioned layer over other layers. It works in everything but Windows IE (surprise). If you remove the 'main' <DIV> it works fine (unfortunately, that is not an option). http://www.tuttobellotrouve.com/newsite/tuttobello/testpage.html CSS is internal. You SHOULD be able to see a small frame with a gift package in it, floating over a narrow horizontal box. Ideas? Thanks, Brad I cannot get the footer to sit at the bottom of the page when I use absolute positioning. I need the #main to stretch to whatever the content height and the footer to sit underneath. I know its fairly easy to achieve with relative positioning but I need absolute positioning for for other elements. Can anyone help? html, body {height:100%;} #container { width: 900px; position: absolute; top: 0px; left: 50%; margin-left: -450px; } #header { width: 900px; height: 105px; position: absolute; left:0; top: 0; } #main { position: absolute; left:0; top: 105px; } #footer { position:absolute; bottom:0; border: 1px solid yellow; } Hi. I have a page with 3 absolutely positioned columns. I want the footer to set right underneath the main content. Currently I have a container for the main content and a footer <div> that sits outside of this container. However, certain browsers (NN7 & IE6) are pushing the footer down too far. Anyone know how I can control this? Here's my css: #container{ position:relative; height:100%; width:780px; } #footer { position: relative; top: 0px; left: 0px; clear:both; } Hi all, I want to place a piece of text directly below an item that has a 'position: absolute' style on it, but when I put a div in there for the new text, it just places the text at the top of that absolute positioned item. Is there any way to get past this apart from floating the item? Cheers. I'm make a simple display:hidden , display:visiable "pop up" div box. The popup works wonderful in FF but IE, the button does not display. Here is my full page (short and simple) Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <script type="text/javascript"> function DIVshow(div_id) { var popUp = document.getElementById(div_id); popUp.style.visibility = "visible"; } function DIVhide(div_id) { var popUp = document.getElementById(div_id); popUp.style.visibility = "hidden"; } </script> <style type="text/css"> #popupcontent { position: absolute; top: 50%; left: 50%; width: 300px; height: 200px; margin-left: -150px; margin-top: -100px; visibility: hidden; overflow: hidden; background-color: #F6F6BB; border: 1px solid #333; padding: 5px; } </style> </head> <body> <p><a href="#" onClick="DIVshow('popupcontent');">Click here</a> to open the popup.</p> <div id="popupcontent"> <p>This is a popup window!</p> <input type="button" value="close" onClick="DIVhide('popupcontent');" /> </div> </body> </html> Working sample can be seen he Click Here It works in both IE and FF if I write my hidden div tag like this: Code: <div id="popupcontent"> <div> <p>This is a popup window!</p> <input type="button" value="close" onClick="DIVhide('popupcontent');" /> </div> </div> Obviously I want to avoid the extra div tags if possible. Anybody know what happening here and how to fix it? Thanks! hello, i have a centered element and i would like to create an absolutely positioned div that attaches to the left side of the centered div. ive been following this resource which states: Quote: #wrapper {position: relative; width: 760px; margin: 0 auto; text-align: left; } This will make an inner element that you absolutely position at, for example, top: 0; left: 0; appear at the top left corner of the wrapper, and not of the the top left of the entire window. and so my css is: Code: body { background-image: url(../images/bg.jpg); background-repeat: repeat-x; margin: 0 auto; text-align: center;} #container { position:relative; border: 4px #99968F solid; width:587px; margin: 20px auto;} #left_block { position:absolute ; top: 0px; left: 0px; width: 299px; height: 209px; background-image: url(../images/mediaplayer_bg.png);} what is happening though is that the left block is in the top left of the window and not the top left of the centred div. does anyone know how i can get this in the top left of the centred div and then ultimately to the left of the centred div (is a negative value possible?) thank you! Code: <div class="container"> <div>Booya</div> </div> Code: .container { position: relative; } .container div { position: absolute; bottom: 0; right: 0; } Is there any way to position the nested div relative to its grandparent vs. its parent without losing the relative positioning, or is JS the only option? |