CSS - Resolution Change Screws My Site
i have hit a brick wall in the development of this site i began working on several hours ago.
i did not create the template or slice the images up.. i only wrote css + xhtml code. here is what it looks like.. one in ff and one in IE.. http://i39.tinypic.com/35hicki.jpg http://i41.tinypic.com/2wrq1d1.jpg xhtml: Code: <?xml version="1.0" encoding="iso-8859-1"?> <!-- 'About' Page --> <!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" lang="EN"> <head> <link rel="stylesheet" type="text/css" href="styles.css" /> <title>Professor Fountain's Cabinet of Wonder -- About</title> <!-- Need to add Meta Tags --> </head> <body> <div id="container"> <!-- Lets try setting up the left side of the page first. The way this is sliced will most likely mean the entire top banner will also need to be set up first. --> <!-- Here is the Banner --> <div id="banner_container"> <img class="top_banner" src="images/index_01.gif" alt="Professor Fountain's Cabinet of Wonder - Top Banner" /> </div> <!-- Next is the left part of the page... --> <div id="leftside_container"> <img id="leftside" src="images/index_02.gif" alt="Cabinet of Wonder - Left Side" /> </div> <!-- Next is the Navigation Bar --> <div id="nav_container"> <ul> <li class="nav_item"><a href="about.html"><img class="nav_item" src="images/working_03.gif" alt="Main Navigation - About" /></a></li> <li class="nav_item"><a href="history.html"><img class="nav_item" src="images/working_04.gif" alt="Main Navigation - About" /></a></li> <li class="nav_item"><a href="performances.html"><img class="nav_item" src="images/working_05.gif" alt="Main Navigation - About" /></a></li> <li class="nav_item"><a href="contact.html"><img class="nav_item" src="images/working_06.gif" alt="Main Navigation - About" /></a></li> <li class="nav_item"><a href="links.html"><img class="nav_item" src="images/working_07.gif" alt="Main Navigation - About" /></a></li> </ul> </div> <!-- END OF NAV BAR --> <!-- Next is the right part of the page... --> <div id="rightside_container"> <img id="rightside" src="images/index_08.gif" alt="Cabinet of Wonder - Left Side" /> </div> <!-- END OF RIGHT PART OF PAGE --> <!-- Background of cabinet --> <img class="bg_image" src="images/index_09.gif" alt="The background of Professor Fountain's Cabinet" /> </div> </body> </html> css: Code: body { lowest z-index : -3 ; display : block ; background-color : #D2B48C ; margin-top : 10px ; margin-left : 10px ; width : 99% ; } h1.content_heading { } #container { display : inline ; margin-top : 0px ; margin-left : 0px ; width : 917px ; height : 697px ; position : relative ; left : 10px ; top : 10px ; } img.bg_image { z-index : -1 ; display : inline ; position : relative ; top : -481px ; left : 109px ; width : 710px ; height : 481px ; } #banner_container { display : inline ; height : 220px ; width : 99% ; position : relative ; top : 10px ; left : 10px ; } img.top_banner { display : inline ; height : 220px ; width : 917px ; } #leftside_container { display : inline ; position : relative ; left : 10px ; top : 4px ; width : 109px ; } img.leftside { display : inline ; width : 109px ; height : 550px ; } #nav_container { z-index : -2 ; display : inline ; position : relative ; left : -45px ; top : -477px ; height : 48px ; width : 695px ; } div#nav_container ul { display : inline ; white-space : nowrap ; } div#nav_container li.nav_item { display : inline ; width : auto ; list-style-type : none; } div#nav_container img.nav_item { display : inline ; border : medium ; } #rightside_container { display : inline ; position : relative ; top : 3px ; left : -55px ; } img.rightside { display : inline ; width : 109px ; height : 550px ; } this is the first time i am ever attempting such a project. Similar TutorialsWhen viewing the test version of my site apparently it has issues with lower resolutions. I'm using 1280x1024 and I guess some people are having issues with it at 1024x768. Is there a way to fix my code so there are no resolution problems, or minimal ones at that? Thanks. Can anyone please tell me why Safari can't deal with these margins properly? EDIT: Fixed. Removed link. im using (stripped most) CSS: Code: h3 { margin-top:-10px; } in this HTML Code: <h1>Header</h1> <h3>subtitle</h3> i want the <h3> the overlap the <h1> partly, like defined in the CSS. It works fine in every browser, but in IE, the rest of the page is distored because of the negative margin definition. is there any workaround for this I am trying to develope http://www.hotlinkforums.com/, but why does the doctype that is generated by the forums screwup my styles. When I take it out of my homepage it makes my stylesheet work correctly, but when I use it it doesn't. Does it matter if I don't use the doctype? Will that screw up search engine ranking or anything? Also what the heck is all of this in my homepage?: <html dir="ltr" lang="en"> <head> <meta http-equiv="Pragma" content="no-cache" /> <meta http-equiv="Expires" content="-1" /> <meta http-equiv="Cache-Control" content="no-cache" /> <title>HotLink Forums - powered by vBulletin</title> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> <meta name="generator" content="vBulletin 3.0.0 Release Candidate 3" /> <meta name="keywords" content="vbulletin,forum,discussion,bulletin board,hotlink,hosting,linux,vb,domains,reseller,affordable,cheap" /> <meta name="description" content="Message Boards for HotLink Hosting" /> Does the direction and lagnuage statements in the html tag matter towards anythign important? What do all these weird meta tags such as pragma, expires, cache-control, generator do and do I need them there? Do the meta tags below the title need to be below the title because I know I can put them above it with the others. Also, why is there a blank white space at the top of the forums? And why does the background to my td at the bottom not work? Hi, I'm having a strange problem. I finally got my layout designed so that it works in both IE and FF and will work scale correctly in relation to screen resolution but now with one aesthetic defect. I have it set up so that the side navigation and the body are scaled 25%:75% but I would like a "thin solid" border between the two. My problem is that when i add the border it exceeds 100% and pushes the main content area underneath the menu. Heres the code for the page; and yes the styles will eventually be moved to the external CSS. right now the only thing the external CSS provides is the body's background image. Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html lang="en"> <head> <title> TEST PAGE 2 </title> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" > <link rel="stylesheet" type="text/css" href="stylesheets/default.css"> </head> <body> <!-- LOGO ROW --> <div id="logorow" style="background-color: #FFFFFF; height: 100px; border-bottom: medium solid #7D5D10;"> <img src="/Images/owlstreelogo.jpg" height="100px" width="300px" alt="Welcome to Owl's Tree"> </div> <!-- END OF LOGO ROW --> <!-- TOP NAVIGATION ROW --> <div id="topnavigationrow" style="background-color: #FFFFFF; padding: 0px 0px 0px 0px; font-weight: bold; text-align: center; border-bottom: thin solid #7D5D10;"> INSERT TOP NAVIGATION ROW LINKS HERE </div> <!-- END OF TOP NAVIGATION ROW --> <!-- CHANGING CONTENT AREA --> <div id="changingcontent" style="background-color: #FFFFFF;"> <!-- SIDE NAVIGATION AREA --> <div id="sidenavigation" style="background-color: #FF0000; width: 25%; float: left;"> </div> <!-- END OF SIDE NAVIGATION AREA --> <!-- BODY CONTENT AREA --> <div id="bodycontent" style="background-color: #0000FF; width: 75%; float: left;"> </div> <!-- END OF BODY CONTENT AREA --> </div> <!-- END OF CHANGING CONTENT AREA --> </body> </html> I want to add "border-right: thin solid #7D5D10" to the side navigation section but when I do i'm faced with this problem. Any idea on a solution to this problem? Oh yeah and as a side not all these sections will eventually have a white background so i'm not worried about the height of them not matching because it will be unnoticable, the sections are just colored so I can see where each section starts and ends. And another random question i'm not too worried about: If i fill a section (eg. the main content section) with a single character over and over past the width of the section without spaces it overflows and displays outside the div tags boundaries. Why does it do that? and is there anyway to make sure the text wraps in the extremely rare case this would happen? Thanks in advance to anyone reading this Hello, whats your opinion and experience? Wich is the best way to serve diferent css depending on resolution? Using media like this and serve several diferent stylesheets? <link href="css/tablet.css" rel="stylesheet" type="text/css" media="screen and (min-width: 321px) and (max-width: 768px)"> or using this: @import url("tablet.css") screen and (min-width:321px) and (max-width:768px); And is it posible and good or bad idea to have one .css file with diferent css depending on resolution. Is it better to detect resolucion with only javascript? Thanks, appreciate help as I am very stressed and have so many things to fix urgently. I've just recently started using CSS, and unlike tables, I have no clue how the heck to autostretch the layout. Could someone to tell me how to make my page "adapt" to different resolutions for CSS? I don't want to have to make seperate styles for each resolution, is there a simple property and value that I can just insert somewhere with the position property? thanks (sorry i posted this again, I just felt the other post was not clear) Hello all! Is there a way to set a resolution % for a certain type of resolution size and any above that resolution to another specific % For example I want it to be: 1024x 768 : width : 90%; and anything higher than 1024x 768 to be 80% since 90% on a resolution higher than 1024 for my navigation is just too make of a banner. Please help/advice. Regards, Kingofqueens. Hi, thanks for your time. My problem is with screen resolution, I am currently building a website using 1280 x 1044 pixels. At this resolution the website looks fine. I have used CSS styles and the size page I have used is 80% so there is a blue background around the page. The problem is I have 2 images sized 990 width pixels, at the current resolution they look fine, but when I drop the resolution they will stay the same size (which is now way too big) while the page size will remain a constant 80% so I am left with an image nearly twice as wide as my content. I have thought of splitting one of the images and used a float left and right for it, but the other image is not possible to do that with, I have seen sites with big banners on so how do those images remain constant size even when you change resolution? All help will be greatly appreciated. Many thanks. Craig I am having a very strange problem with firefox and different screen resolutions. I have just made a navigation system for a website and tested the links in I.E and F.F - no problems in my screen resolution of 1280 x 1024. I tested it at 800 x 600 and 1024 x 768 and firefox does not change to the hover status when hovering over the link. There are no problems in I.E at the smaller resolutions. Does anyone have any ideas what is causing this problem. After playing around with a few things i discovered that if i change my display from inline to block it works perfectly in firefox at all resolutions - In I.E it causes a step like appearance to the links. Below is the css I am using, I have also added the xhtml at the bottom. Code: #top_button li { margin: 0; display: inline; list-style-type: none; } #top_button a:link, #top_button a:visited { float: left; overflow: hidden; height: 0px; } #top_nav { margin: 0; padding: 0; } #top_button { position: relative; top: 0px; left: 157px; height: 19px; list-style: none; margin: 0; } #t1 a:link, #t1 a:visited { background-image: url(../images/top_nav_home_1.gif); background-repeat: no-repeat; padding-top: 19px; width: 47px; } #t1 a:hover, #t1 a.current { background-position: 0px -19px; } #t2 a:link, #t2 a:visited { background-image: url(../images/top_nav_services_1.gif); background-repeat: no-repeat; padding-top: 19px; width: 63px } #t2 a:hover, #t2 a.current { background-position: 0px -19px; } #t3 a:link, #t3 a:visited { background-image: url(../images/top_nav_portfolio_1.gif); background-repeat: no-repeat; padding-top: 19px; width: 65px; } #t3 a:hover, #t3 a.current { background-position: 0px -19px; } #t4 a:link, #t4 a:visited { background-image: url(../images/top_nav_resources_1.gif); background-repeat: no-repeat; padding-top: 19px; width: 72px; } #t4 a:hover, #t4 a.current { background-position: 0px -19px; } #t5 a:link, #t5 a:visited { background-image: url(../images/top_nav_contact_1.gif); background-repeat: no-repeat; padding-top: 19px; width: 59px; } #t5 a:hover, #t5 a.current { background-position: 0px -19px; } { xhtml Code: <div id="top_nav"> <ul id="top_button"> <li id="t1"><a class="current" href="/" title="home"></a></li> <li id="t2"><a href="/services" title="services"></a></li> <li id="t3"><a href="/portfolio" title="portfolio"></a></li> <li id="t4"><a href="/resources" title="resources"></a></li> <li id="t5"><a href="/contact" title="contact"></a></li> </ul> </div> I would appreciate any suggestions! I am in the process of designing a website and I have dual monitors at home, one is using 1024x768, and other is using 1280x1024 resolution. The website I have designed, off course looks different from one resolution to the other. One the less resolution monitor, the site looks big (my masthead is 750x200 and the whole page is approximately 770x900), however, on the high resolution, the site looks tiny. on 1200 wide resolution my page width is only 770, so there is white (in my case blue) space both sides making it look not so good. Because of the above reason, the site looks big on one monitor and very tiny on the other. I am sure there would be lots of people out there with those two kinds of resolutions (I am mostly concerned about these two resolutions). I wonder how do people deal with this when they are designing a website? Could one find out the resolution of the monitor ahead of time (before displaying the page) and have different css/images be loaded based on the monitor it is being viewed? Is there a concept of floating site -- what I mean by that is if there is a concept of site automatically changing appearance based on screen resolution? Thanks!!! www.oakdalehosecompany.org or oakdalehosecompany.org is my website Its perfect when you view it with firefox at 1024x768 res, but when you view it with internet explorer at 800x600 res it looks horrible. is there anyway to fix this like a program or something. bear with my this is my fire site i ever made so i dont know much. thanks for any that help Hi All, I have a fixed div which I am using as a footer in my application. here is the screen shot of my page please have a look first so u will understand what i am talking about. http://img192.yfrog.com/img192/5572/1280x768.gif Problem is that if I browse the application on 1024 x 768 pixels it works great but when i change the resolution up to 1280 x 800 pixels the image inside the div change its position. I want this to appear same on every resolution...any suggestions or workaround. the CSS code is below Code: #footer { position: fixed; top: auto; left: auto; width: auto; } here is the HTML Code: <html> <head id="Head1" runat="server"> <link href="../App_Themes/style.css" rel="stylesheet" type="text/css" /> <script src="../Scripts/jquery-1.3.2.min.js" type="text/javascript"> </script> <title></title> <style type="text/css"> .style1 { width: 800px; background-color:White } .style2 { height: 391px; } .style3 { text-align: right; } </style> </head> <body bgcolor="#d7d7d7"> <form runat="server"> <div id="content" style="margin: auto; border: thin solid #C0C0C0; padding: 0px 0px 0px 0px; width: 820px; height: 595px" align="center"> <table align="center" class="style1"> <tr> <td style="font-family: 'Times New Roman', Times, serif; font-size: small; color: #FF0000;" class="style3"> <asp:ContentPlaceHolder ID="StatusBar" runat="server"> </asp:ContentPlaceHolder> <asp:Image ID="Image1" runat="server" ImageUrl="~/images/appHeader.png" /> </td> </tr> <tr> <td class="style2" align="left" valign="top"> <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server"> </asp:ContentPlaceHolder> </td> </tr> <tr> <%--<td style="background-color: #FF9933; height: 15px;"> </td>--%> </tr> </table> <div id="footer"> </div> <%-- <table align="center" class="style1"> <tr> <td> <div id="footer"> <img src="../images/footer.png" alt=""/> </div> </td> </tr> </table> --%> </div> </form> </body> </html> I want a table below the container div and want to place my footer div inside that table and on every resolution it should come up the same...i did try but its not working...help need Hi There.. I am still learning CSS/Xhtml so please be patient and understanding, . Anyway, I am making a site for my business and wanted to try some new idea. Everything looks good except for my navigation bar in IE. Whenever I change resolution the navigation bar moves out of position and I have to refresh to get it to snap into place. In Firefox and Chrome I do not have this issue. I have been googling trying to find the solution but have come up empty. Could someone look at my code and tell me when I did wrong so I don't make the same mistake again? Thanks for your help. Here is the CSS: <style type="text/css"> <!-- #html, body { top: 0px; right: 0px; bottom: 0px; left: 0px; width:920px; height: 100%; background: url(desk.jpg) white center no-repeat; background-repeat:no-repeat; margin: 0 auto; text-align: center; font-family: Verdana, Helvetica, sans-serif; } #container { width: 900px; height:840px; background-image: url(bg1.png); margin: 0 auto; text-align: left; } #mainContent { padding: 3px 60px; margin-top: 0px ; } #text { padding: 0; margin-left: 35px; text-align: center; } #navigation { float:right; display:block; width: 400px; margin-top: 15px ; font-family:Trebuchet MS, Helvetica, sans-serif; overflow:hidden; } #navigation ul { float:left; list-style:none; margin:0; padding:0; position:relative; left:50%; text-align:center; } #navigation ul li { display:block; float:left; list-style:none; margin:0; padding:0; position:relative; right:50%; } #navigation ul li a { display:block; margin:0; padding:.4em .8em; color:#000; text-decoration:none; line-height:1.3em; } #navigation ul li a span { display:block; } #navigation ul li.active a { color: #fff; font-weight:bold; } #navigation ul li a:hover { color: #fff; font-weight: bold; } .guy { float: right; margin-top: -70px; } .yell { float: left; margin-top: 20px; padding-bottom: 0px; margin-right: 30px; margin-left: 20px; } .second { margin-top:45px; } #footer { font-size: 11px; margin-bottom: 10px; } --> Hey there! New to code, sort of flying blind but learning a lot as I go along. I'm also kind of shooting for the stars with my design decisions. I was wondering if anyone here has any idea how to mimic the rotating image on Blizzard's website. (As I cannot post the URL, I assume everyone can figure out how to get to Blizzard Entertainment's website easy enough). If you zoom in and out on it, it remains static even as the pieces around it resize over it (this also happens at smaller resolutions). I would desperately like to know how to get it to lock flush against the side of the window like that. Additionally, you'll notice that it doesn't pop a scrollbar onto the window until you shrink the window smaller than the central content. I guess a bigger question is, is this even something achievable in CSS? Do I have to delve into Flash or Javascript to do it, and if so, does anyone know how? Thank you so much in advance! what i would like to do is centre my website on any monitor any resolution but i dont know how. could someone explain what i would need to do. im taking a guess but the way i thought you could do it is by putting a div around the whole thing and settinga fixed height and width on auto but i dont think thats right. thanks Hi, Ive been asked to create a webpage for a website, the page must be 99% identical to the current website but the problem is I had to build the new page from scratch because a problem with joomla. While creating the page I ran into a big problem aligning the menu bar. Right now the menu bar lines up exactly how it should on my desktop, but on my laptop which has a much larger screen the menu bar is slide way over to the left. here's the website Im making a copy for http://www.curacao.vatcar.org/home/ and here's the page I've made so far http://brandynstestserver.zymichost.com/flight/downloads.html I know it still needs alot of tweaking but I just want to solve the menu problem Heres the HTML, please ignore the comments those are just for the current webmaster (who doesn't know much) until they find another one. Also I just noticed a now unneeded <div id="banner"> tag ignore that too. 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=utf-8" /> <title>Virtual Curacao FIR Downloads</title> <link rel="stylesheet" type="text/css" href="styles.css"> </head> <script type="text/javascript"> var timeout = 50; var closetimer = 0; var ddmenuitem = 0; function mopen(id) { mcancelclosetime(); if(ddmenuitem) ddmenuitem.style.visibility = 'hidden'; ddmenuitem = document.getElementById(id); ddmenuitem.style.visibility = 'visible'; } function mclose() { if(ddmenuitem) ddmenuitem.style.visibility = 'hidden'; } function mclosetime() { closetimer = window.setTimeout(mclose, timeout); } function mcancelclosetime() { if(closetimer) { window.clearTimeout(closetimer); closetimer = null; } } document.onclick = mclose; </script> <body> <div id="page-background"><img src="images/bg.JPG" width="100%" height="100%" alt="Smile"></div> <div id="content"><div id="banner"><center><img src="images/banner.png"/></center></div> <ul id="sddm"> <li><a href="http://www.curacao.vatcar.org" onmouseover="mopen('m1')" onmouseout="mclosetime()"><center>Home</center></a> </li> <li><a href="http://www.vatcar.org/website/index.php?option=com_content&view=article&id=5&Itemid=40" onmouseover="mopen('m2')" onmouseout="mclosetime()"><center>Roster</center></a> </li> <li><a href="http://www.vatcar.org/forum/index.php?board=6.0&Itemid=54" onmouseover="mopen('m1')" onmouseout="mclosetime()"><center>Forum</center></a> </li> <li><a href="http://www.curacao.vatcar.org/home/index.php?option=com_jobline&Itemid=61" onmouseover="mopen('m1')" onmouseout="mclosetime()"><center>Career Opportunities</center></a> </li> <li><a href="http://www.curacao.vatcar.org/home/index.php?option=com_content&view=article&id=56&Itemid=66" onmouseover="mopen('m1')" onmouseout="mclosetime()"><center>Contact Us</center></a> </li> <img src="images/menuspacer.jpg" /></ul> <table width="982" border="0" cellspacing="0" cellpadding="0" background="images/body.jpg" align="center"> <tr> <td> </td> <td><h2>Downloads</h2></td> <td> </td> </tr> <tr> <td> </td> <td> <!--Downloads will go under this comment, dont edit anything above this--> <h2><center>Charts</center></h2><!-- this little piece of code it just a centered heading, hence the <h2> and <center> tags around the words you want to be the heading--> <!-- use this format to add downloads, type <a href="LINK TO DOWNLOAD HERE">Name of the download</a> and thats it. That code will display text saying what ever you typed in the "Name of the donwload" section and when you click on the words it will download the file that is located in the "LINK TO DOWNLOAD HERE" section. Heres a few working downloads below for you go go off of--> <center><a href="downloads/charts/TNCA/TNCACharts.zip">TNCA Charts package</a><br /> <!-- The <br /> is just a line break--> <a href="downloads/charts/TNCB/TNCBCharts.zip">TNCC Charts package</a><br /> <a href="downloads/charts/TNCC/TNCCCharts.zip">TNCB Charts package</a><br /></center> <h2><center>ATC</center></h2> <center><a href="downloads/ATC/Training Files.zip">Training package</a><br /> <a href="downloads/ATC/TNCF Control.zip">TNCF Control package</a><br /></center> <!-- Dont edit anything below this comment--> </td> <td> </td> </tr> <tr> <td colspan="3"><img src="images/bottom.jpg"/></td> </tr> </table> </div> </body> </html> Heres the CSS Code: @charset "utf-8"; /* CSS Document */ html, body {height:100%; margin:0; padding:0; font-family: Arial, sans-serif, Verdana, Helvetica; } #page-background {position: fixed; top:0; left:0; width:100%; height:100%;} #content {position:relative; z-index:1; padding:10px;} #sddm { margin:0 0 0px .6em; padding: 0; z-index: 30 } #sddm li { margin:0 auto; padding: 0; text-align: left; list-style:none; float: left; font: bold 15px sans-serif} #sddm li a { display:block; margin-left: auto; margin-right: auto; padding: 8px 5px; background: url(images/mainmenu.jpg) repeat-x left top; color: #FFF; text-decoration: none } #sddm li a:hover { background: #000; width:auto; font-size: 15px; } Thank you in advance for the help! This one has probably been beaten to death by now, but I can't seem to find a specific answer. I develop on a monitor 1024x768, and use a standard font size (for general text) of 11px. When using a 800x600 resolution monitor, the text seems oversized - which is what one would expect with a px setting. Or looking at it from the other side of the fence, if I develop on the 800x600 and get a decent text size, it looks too small on the higher resolution. I can use 2 .css files with different font size settings and javascript to direct to the relevant css file. As far as I can tell, that is the only way I can get a 'similar' look on both screen resolutions. Is there another way where I can get away with using only 1 css file? What do others do to get around this problem? Hi friends, I am building my website templates compatible for any resolution ranging from 800x600 to maximum possible resolution. I want to place all the body content exactly in the center (900px layout). I have set the background exactly in the center. but when i am inserting the content, it is displayed from left. How should i set it in the center? please help me! |