HTML - Layout Issues: Relative Positioning
Hi all,
Help on this would clear up this headache. I am using relative position to put this flash component flush with the right side of the layout. However, in different screen resolutions it still moves. Why is this? for ref: www.burnthisforyourfriends.com Here's the code: <html> <head> <title>Burn This for Your Friends, show dates, music, media, downloads and store</title> </head> <body bgcolor="#000000"> <center><img src="http://img704.imageshack.us/img704/3791/burnthisheader.jpg" /> <br /><a href="http://www.burnthisforyourfriends.com/index.html"><img src="http://img704.imageshack.us/img704/686/mainnavigationplacehold.jpg" alt="Home" border="0" /></a><a href="http://www.burnthisforyourfriends.com/releases.html"><img src="http://img704.imageshack.us/img704/686/mainnavigationplacehold.jpg" alt="releases" border="0" /></a><a href="http://www.burnthisforyourfriends.com/artists.html"><img src="http://img704.imageshack.us/img704/686/mainnavigationplacehold.jpg" alt="artists" border="0" /></a><a href="http://www.burnthisforyourfriends.com/studio.html"><img src="http://img704.imageshack.us/img704/686/mainnavigationplacehold.jpg" alt="studio" border="0" /></a><a href="http://www.burnthisforyourfriends.com/gallery.html"><img src="http://img704.imageshack.us/img704/686/mainnavigationplacehold.jpg" alt="gallery" border="0" /></a><a href="http://www.burnthisforyourfriends.com/bookinginfo.html"><img src="http://img704.imageshack.us/img704/686/mainnavigationplacehold.jpg" alt="bookinginfo" border="0" /></a><a href="http://www.burnthisforyourfriends.com/press.html"><img src="http://img704.imageshack.us/img704/686/mainnavigationplacehold.jpg" alt="press" border="0" /></a><a href="http://www.burnthisforyourfriends.com/store.html"><img src="http://img704.imageshack.us/img704/686/mainnavigationplacehold.jpg" alt="store" border="0" /></a><a href="http://www.burnthisforyourfriends.com/contactus.html"><img src="http://img704.imageshack.us/img704/686/mainnavigationplacehold.jpg" alt="contactus" border="0" /></a> <br /><img src="http://img514.imageshack.us/img514/9773/flashplaceholderred.png" /><img src="http://img163.imageshack.us/img163/8006/flashplaceholdergreen.png" /><img src="http://img340.imageshack.us/img340/4820/flashplaceholderyellow.png" /> </center> <div style="position: relative; top: 20px; left: 659px;"> <p> <script type="text/javascript" src="js/swfobject.js"></script> <script type="text/javascript"><!-- Similar TutorialsNever mind you guys were wrong as usual. Thanks. Hey guys. I am having to rework some HTML/CSS and I am just getting frustrated with this part. I have a background image that needs to be the image behind both of the tables, but it can only be shown once. Mockup of what I need this part to look like: Here is my code at the moment -- HTML Part: HTML Code: <table id="myScheduleTable" width="100%"> <span class="sessionHeader">Session Wish List</span><br /> <tr> <form id="session_search"> <td valign="middle"> <a href="javascript:void(0);"><img src="{$APP_URL}/img/btn_save.gif" alt="Save" title="Save" onClick="saveMySchedule(true); return false;"></a> </td> <td valign="middle"> <input type="image" src="{$APP_URL}/img/clearButton.gif" Title="Clear" onClick="clearSessions();return false;"/> </td> <td valign="middle"><a href="javascript:void(0);" title="Email My Schedule" onClick="showEmailMySchedule();return false;"><img src="{$APP_URL}/img/btn_email.gif" alt="Email my Schedule"></a> {include file="$THEME/common/mail_a_friend.tpl"} </td> <td valign="middle"> <input type="image" src="{$APP_URL}/img/btn_printNow.gif" title="Print Now" onClick="new_window=window.open('','_blank');printSchedule(new_window);return false;" /> </td> <td valign="middle"> <a href="javascript:void(0);" title="Add to my Profile" onClick="exportHTML();return false;"><img src="{$APP_URL}/img/btn_addToProfile.gif" alt="Add to my Profile"></a> </td> <td valign="middle"> <div id='blankContainer'></div> </td> </tr> </table> <div id="myScheduleContainer"> <div name="userScheduleContainer" id="userScheduleContainer"> <form name="user_sessions" id="user_sessions"></form> <div id="userScheduleListContainer"> <div id='user_schedule_div'>{if !$user_sessions}No sessions selected.{/if}</div> </div> <div id="userSchedulePassContainer"></div> </div> </div> </td> <td> <span class="sessionHeader">myGDC Schedule</span><br /> <table id="myScheduleTable" width="100%"> <tr> <form id="session_search"> <td valign="middle"> <a href="javascript:void(0);"><img src="{$APP_URL}/img/btn_save.gif" alt="Save" title="Save" onClick="saveMySchedule(true); return false;"></a> </td> <td valign="middle"> <input type="image" src="{$APP_URL}/img/clearButton.gif" Title="Clear" onClick="clearSessions();return false;"/> </td> <td valign="middle"><a href="javascript:void(0);" title="Email My Schedule" onClick="showEmailMySchedule();return false;"><img src="{$APP_URL}/img/btn_email.gif" alt="Email my Schedule"></a> {include file="$THEME/common/mail_a_friend.tpl"} </td> <td valign="middle"> <input type="image" src="{$APP_URL}/img/btn_printNow.gif" title="Print Now" onClick="new_window=window.open('','_blank');printSchedule(new_window);return false;" /> </td> <td valign="middle"> <a href="javascript:void(0);" title="Add to my Profile" onClick="exportHTML();return false;"><img src="{$APP_URL}/img/btn_addToProfile.gif" alt="Add to my Profile"></a> </td> <td valign="middle"> <div id='blankContainer'></div> </td> </tr> </table> <div id="myScheduleContainer"> <div name="userScheduleContainer" id="userScheduleContainer"> <form name="user_sessions" id="user_sessions"></form> <div id="userScheduleListContainer"> <div id='user_schedule_div'>{if !$user_sessions}No sessions selected.{/if}</div> </div> <div id="userSchedulePassContainer"></div> </div> </div> </td> </tr> </table> CSS Part: Code: #myScheduleBG { background-image:url(http://test.gdconf.com/scheduler/img/mySchedule_bg.jpg); background-repeat: no-repeat; width: 872px; height: 283px; position: relative; float: left; border: none; top: 15px; left:-2px; } #mySessionWishList { float: left; display: block; border: none; } #myGDCSchedule { float: right; display: inline; border: none; } #myScheduleTable { position: relative; left:9px; top: 5px; width: 425px; } #myScheduleContainer { position: absolute; left: 9px; top:48px; width: 425px; height: 220px; border: none; background-color: #000000; } The background image is mySchedule_bg.jpg and it needs to hold both of the containers. Anyone have some insight as I am getting tired playing a guessing game with this code. All of this relative positioning is throwing me for a loop, especially in IE and Safari. Thanks. I have designed my site with Divs nesting and divs floating left and right to get a strict layout. It is flawless in firefox / safari but when I open it in IE it seems that some borders are enlarged or something because objects are obviously sent to the next line because their width exceeded that of the parent div. http://www.nativboardriding.com/media.htm check out how the video and div box won't fit on the same page in IE but work fine in the other browsers. How can i prevent this? I have a problem with my home page. It is sitting closer to the left side than my other pages and I cannot figure out why! You can see it at http://www.photo-bliss.net/beta username is trial password is demo If you switch between the home page and the other pages, you can see it. Any suggestions would be greatly appreciated. Thanks what have i done wrong?! http://maysonline.sandlerltd.co.uk if you go to "advice & guidance" menu or any other menu except the home page, basically most of the pages seem to be very odd in IE7 but in IE8 - its fine! any ideas?! What am I missing? Hello, I've been having trouble laying out my website. I'm quite new to HTML, so if you could give me the simplest answer possible it would be appreciated. As of right now I have an image aligned to the top of my page, and two side by side tables underneath it. However, although the tables are aligned the way I want them in Mozilla Firefox (the tables being directly under the image), when I display my site in Internet Explorer the tables are beside the image. I found that I could insert page breaks until the image fit where I wanted it in Internet Explorer, then, however, the tables were further away from the image in Mozilla firefox. If anyone could tell me how to fix this problem it would be most appreciated. Cheers, Dancing Pancake Recently made a post concerning tables versus divs, and now I have a site where I think I need to do divs, but not sure how to approach using percentages for the sizing. http://www.pigseldesign.com/cravings.jpg This is the layout. Ideally, I'd like for the middle strip to be vertically centered no matter the browser window height. My guess is to have 3 divs (top, middle, bottom) with 100% and if possible, set the percentages for height so that the top and bottom remain the same ratio of size. If it affects anything, the middle strip is going to be a slideshow Flash object. Any hints for sizing? Morning everyone. I am having a problem with getting a table containing flash files and images to align correctly in IE. The site looks fine in Chrome and FF but in IE there is a slight space between the two columns of flash buttons on the left-hand side and the image on the upper-right. This happens in IE 7 and the 8 beta. The site is: http://www.kidsnightonbroadway.com Many thanks in advance for any assistance you can provide. Andy This may be to big of an ask, but I am trying to make it so my website layout is positioned in the middle of the browser no matter how big the screen resolution is. For example, this is the page on my computer, here And my friends, here. So as you can see, on my pc it looks fine, yet on my friends the layout is all pushed up to the top, and this looks rather silly. If you could throw some tutorials or something my way id appreciate it. website: http://www.breakdowninc.987mb.com So I just decided to redesign my website, and I learned the wonders of "position: absolute" and the left, right, top, and bottom CSS tags. But of course, with that comes some issues (and other things, like me having to think about people with different browsers/resolution settings than me). Some of my problems are as follows (captions of the problem are under the images) When the text overflows here, it just leaves the <div> tag... well... multiple <div> tags. This one takes the body <div> with it.. but doesn't let the bottom page image extend down. Top filler image doesn't extend all the way, body <div> doesn't connect properly to fade images. So as you can see, my big problem is the overflow, which really needs to be fixed. Don't know what the problem is with Opera there, but it's something else that should be checked out. So anyway, here's my code for the website. If you have any ideas for how to improve it/make it work better, then I'm happy with that. Don't worry about validation right now, though. I'm saving that for later. HTML Code: <html> <head> <title>Home - Alex Crooks Webdesign</title> <style type="text/css"> body { margin: 0px; background-color: #035b07; font-size: 10pt; color: white; font-family: verdana, arial, sans-serif; } a { text-decoration: none; color: white; } a:hover { text-decoration: underline; color: white; } img { border: 0px; } .navlink { font-size: 16pt; font-variant: small-caps; font-weight: bold; } #navlinks { text-align: right; vertical-align: middle; padding: 5px 10px 0px 10px; } #topleft { position: absolute; top: 0px; left: 0px; float: left; width: 141px; height: 228px; background-image: url(topleft.gif); z-index: -11; } #topfiller { position: absolute; top: 0px; width: 100%; height: 155px; background-image: url(topfiller.gif); z-index: -12; } #left { float: left; position: absolute; left: 0px; width: 65px; height: 100%; background-image: url(leftfiller.gif); z-index: -13; } #bottomleft { position: absolute; bottom: 0px; left: 0px; float: left; width: 137px; height: 134px; background-image: url(bottomleft.gif); z-index: -11; } #bottomfiller { position: absolute; bottom: 0px; width: 100%; height: 67px; background-image: url(bottomfiller.gif); z-index: -12; } #nav { margin: 100px 0px 0px 65px; margin-top: 100px; height: 40px; width: auto; background-image: url(navbg.gif); color: white; } .sep { vertical-align: middle; width: 2px; height: 25px; padding: 0px 5px 0px 5px; } #bodyright { position: absolute; top: 273px; right: 200px; bottom: 104px; height: auto; width: 22px; background-image: url(bodyright.gif); z-index: -7; } #body { padding: 5px 5px 5px 5px; position: absolute; top: 273px; right: 221px; bottom: 104px; left: 200px; width: auto; height: auto; background-color: white; color: black; z-index: 0; } #bodybottom { float: left; position: absolute; left: 246px; right: 221px; bottom: 87px; left: 200px; width: auto; height: 17px; background-image: url(bodybottom.gif); z-index: -7; } #bodycornerleft { position: absolute; bottom: 87px; left: 200px; width: 46px; height: 18px; background-image: url(bodycorner1.gif); z-index: -6; } #bodycornerright { position: absolute; right: 205px; bottom: 87px; width: 17px; height: 17px; background-image: url(bodycorner2.gif); z-index: -7; } </style> </head> <body> <div id="left"></div> <div id="top"> <a href="index2.html"><img style="padding: 5px 0px 0px 5px;" src="crookslogo.png" /></a> <div id="topleft"></div> <div id="topfiller"></div> </div> <div id="nav"> <div id="navlinks"> <a class="navlink" href="">Home</a> <img class="sep" src="navseparate.gif" /> <a class="navlink" href="">Features</a> <img class="sep" src="navseparate.gif" /> <a class="navlink" href="">Blog</a> <img class="sep" src="navseparate.gif" /> <a class="navlink" href="">Clients</a> <img class="sep" src="navseparate.gif" /> <a class="navlink" href="">Products</a> </div> </div> <div id="content"> <div id="body"> <p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent ac enim sapien, vel tristique sapien. Vivamus erat purus, feugiat non porttitor id, cursus at sapien. Curabitur eleifend, leo facilisis consequat faucibus, ante eros bibendum tellus, et dictum nibh mi laoreet turpis. Proin pellentesque, nulla et ornare pretium, ipsum lectus faucibus mi, sed dictum purus ipsum a ante. Aenean nibh odio, porttitor a volutpat ut, euismod vitae nisi. Integer urna turpis, ultrices ullamcorper porttitor in, placerat ut metus. Sed venenatis nisl in elit faucibus non consectetur quam commodo. Pellentesque ut augue massa, ac iaculis elit. Integer eu quam nisi, non faucibus neque. Donec sit amet magna at nulla commodo cursus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Donec tellus mauris, congue ut lobortis nec, adipiscing eu arcu. Suspendisse congue consectetur ante at porttitor. Maecenas sapien nibh, porttitor non pellentesque sed, sodales eu dui. </p> <p> Nullam sodales malesuada lorem, et cursus velit malesuada nec. Phasellus vestibulum elit quis nunc semper vel accumsan dui lobortis. Nunc viverra tortor tincidunt dolor congue quis porta tortor auctor. Sed porta neque ac libero tristique varius. Nam id nisi lectus. Integer consectetur magna id erat volutpat adipiscing. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Integer risus sem, interdum sed eleifend at, tincidunt in odio. Vestibulum euismod mauris eget magna semper sit amet feugiat risus varius. Mauris non neque et arcu ultricies venenatis a non mauris. Nulla facilisi. Donec sem turpis, porttitor et posuere id, posuere eget diam. Vestibulum et aliquam nibh. Phasellus quis ligula mauris, non porttitor sapien. Duis eu est id elit blandit vestibulum quis non urna. Maecenas enim augue, cursus faucibus tincidunt eget, cursus sed sem. Curabitur dictum dolor id massa bibendum vel tincidunt nunc volutpat. Nunc lobortis augue vitae ante porta eget mattis nisl faucibus. Ut sodales lorem vel dolor malesuada bibendum. Maecenas eget neque in elit semper rhoncus. </p> <p> Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec aliquet semper volutpat. Suspendisse vitae sapien pulvinar mi egestas ornare quis nec sapien. Pellentesque nec ipsum ligula, sed ultricies lectus. Duis eu ipsum et dui vehicula luctus. Sed mollis rutrum dui elementum consectetur. Nunc viverra tortor quis tellus semper a imperdiet nisl suscipit. Nullam et dolor at purus dignissim faucibus eu vitae quam. Proin lacus ante, tempus ut ullamcorper id, mattis vitae eros. Vivamus mauris lorem, interdum at ultrices in, ultrices non metus. Phasellus convallis lobortis sem, sit amet convallis ante dignissim in. Nullam id mollis nibh. Pellentesque lobortis convallis erat, suscipit lobortis velit euismod ultricies. </p> <p> Cras mollis imperdiet dignissim. Nulla sit amet elementum dolor. Curabitur luctus vestibulum sodales. Quisque eu odio velit, et pretium diam. Maecenas porttitor metus et mauris mattis sit amet facilisis odio sagittis. Aenean at turpis ac sapien ultrices pellentesque vel id erat. In ultrices pharetra erat, pulvinar molestie nisi hendrerit id. Mauris nunc eros, consequat in ultrices sed, malesuada non magna. Etiam dictum ultricies blandit. Vestibulum augue ipsum, malesuada a ullamcorper vel, porta accumsan nunc. Quisque dapibus posuere neque, sit amet lacinia justo tempus nec. Curabitur sit amet tortor nulla. Sed enim quam, facilisis eu dapibus quis, vestibulum at erat. Cras placerat sagittis eros, ac faucibus tellus ultricies vitae. </p> <p> Aenean commodo enim facilisis tellus lacinia sit amet vulputate est condimentum. Vivamus viverra vehicula felis sed rhoncus. Donec sed imperdiet est. Proin molestie velit nec urna lacinia vel fermentum sem tincidunt. Maecenas rutrum sollicitudin varius. Donec et ligula semper eros euismod interdum. Aenean ultricies magna sed nisl consectetur venenatis. Nullam quis orci sapien. Curabitur pellentesque lacinia ante, id pharetra risus sagittis id. Etiam metus turpis, rutrum vel faucibus nec, feugiat rutrum nibh. Donec fringilla sagittis ligula, nec varius felis dapibus eu. Curabitur felis quam, fermentum non eleifend ac, faucibus vel libero. In nec leo ut nulla sagittis scelerisque nec in orci. </p> </div> <div id="bodyright"></div> <div id="bodycornerleft"></div> <div id="bodybottom"></div> <div id="bodycornerright"></div> </div> <div id="bottom"> <div id="bottomleft"></div> <div id="bottomfiller"></div> </div> </body> </html> http://recwar.exofire.net/ i know the code is horrible, i used a mix of MS word, frontpage, and dreamweaver, so please dont bite my head off on that, this post is simply about a crossbrowser layout issue. I was able to position everything the right way in dreamweaver. I got a few screenshots from http://browsershots.org/ and its showing completely messed up in ie6, and slightly wonky in ie7 & ie8. the main problem is the text/image in the middle is somehow ending up in the bottom right corner of the page in IE. Also ie6 doesnt seem to like the transparent background on my title/banner/logo. Can anyone figure out a way to at least get the text box in the right spot for IE? Hello all! This is my first website, and of all the languages I've had to start learning to produce it, HTML is by far the most infuriating. My site is www.B3-Office.com and the issue is the layout. It is completely wrong on every page. If you look in the source it should show that my top nav bar is set to be only 94 px in width per cell (10 cells), slightly larger than some of the text therein. The "Contact" text is supposed to be far left. Then the rest of the site, the pages are just all messed up in formatting, looking nothing like it does in my WYSISWYG program (DreamWeaver CS4). I have 4 pages in this format: home, contact, aboutus, and privacy. None of which are working properly. HELP! What am I missing? I would also appreciate your feedback on my work. Thanks so much!!! Hello, I made a very simple table layout (with photoshop and imageready) and its my very first time making this type of layout so I'm having a little trouble with the coding. I haven't added a style.css file to it, except for maybe the css that wraps my navigation to a certain width. Here is the url: http://rezina.awardspace.com/layout01 I can't seem to align the images correctly. My friend told me that one of the images was not sliced correctly, so I sliced it but .. it kind of fixed the right side, and not the left. Also, the extra.jpg (which is the outside background-the stripes) seems to repeat itself both vertically and horizontally, is there a way to fix that? Thanks. =)) oh. oops. I just read the rules, sorry for the vague title. I would try changing it to be more specific but I don't know how.. I am coding in PHP, but I don't think that should have anything to do with it. My problem appears to have to do with the HTML. I am using a 15x15 jpg as a submit button, but I have many of them in a table one per cell with no borders or spacing, so there are many of these submit buttons right next to each other in a grid. The problem is that though the cells are set to be 15x15, the page is displaying them in cells that are 15x27 with the jpg aligned to the top, though the source code does not reflect the 27 figure. I have set the width and height attribute on every cell and image. Is there something I should be looking for to ensure all of my code places the images in the right size and placement? There is no CSS in play with this part of the site. Thanks! Hey all, I'm new here, and I love the layout of this website! I like the bright colors! Anyway... I created a website layout/site in Photoshop CS 5. The website: www.thegarbagedump.net I saved it as a html & images.. The issue I am having is when you click one of the bottons I want it to open the html document and display it within that square area with the border around it. I know I probably need a frame to do this, however I dont know how to add a frame, and it appears photoshop saved it in tables.. Could you please review the html source, and tell me how/where to add a frame, and make the Home, About, Domains button appear within that square area with the border? Thank You, Justin Hi All, I'm a beginner to all this HTML coding and have designed a page. Each problem I've encountered I've been able to search the web for and then paste and amend HTML code. My problem is I am adding an image to create a curve in a table but for some reason the right side of the table is indented by a pixel or two. I've tried changing margins etc but nothing works I've wasted hours trying to resolve this and come here as a last resort. See table titled company at link below http://one.fsphost.com/darrenguy/ Please help! Hello All, I have a problem with div position in my html page. I need two divs position=relative aligned with a single div. Basically I have a header panel, content panel (have two vertical column height changed dynamically) and a footer panel. So Content panel vertical column needs to align with header panel. I need all div tags position relative, so when every div increases in height bottom div sifted down automatically. I have this http://www.arunverma.info/webmaster_help/ Can sombody help me to short it out. Thanks in advance Sunil Hi. I like to include an image in my html file. The file itself is located at: C:\Documents and Settings\Pourang\Desktop The image is located at: C:\Documents and Settings\Pourang\Desktop\VIDEO_TS According to Head First With HTML book: This is the path I must include in my <img> empty element: <img src=" VIDEO_TS/the name of image file " OR: /VIDEO_TS/the name of image file " Right? relative paths or something else it's called. But I can't get it right? it's a broken link, no image is uploaded. Can you help me with this? thank you. Hi to all. I'm trying to achieve a pure relative html layout by implementing only percentage values (without any pixel position or dimension). This way i want to get an html page which would appear the same in all of resolutions and browsers. I attached a simple html page, written in this relative manner. However, i have 2 issues with it: 1) some empty space on the right of the html body in FF. 2) disarranged look in IE (small image lifted up, and empty space below the page body). Is there a hack for IE to render this page properly, and a way to force FF to not display mentioned empty space? (Also, but less important, there is a minor (height) position difference of the small image /bacardi.gif/ viewed in 1024x768 & 800x600, and likely in higher resolutions too, but my graph.card cannot display it.) Many thanks in advance |