CSS - How Can I Make My Pages Look Good On All Monitors?
hi,
I have a problem with my website. On one of my computer my website proportions look right, but on my other computer it looks proportioned different. On my Computer everything is ok,but on my friends computer the web pages are not good. the css styles are ok but some images are bigger and some are small.how to solve this problem thanks mrjameer Similar TutorialsHi, today a friend of mine introduced me to browsershots.org. When I saw what my contact forms looked like in different browsers I couldn't believe it. To make forms look nice I usually create a div and assign it a background image using the background-image css property. I give the div the same height and width as the background image, and then I position the input fields using the margin-top and margin-left properties. In Safari the text fields are way too long and get out of the image. In IE the vertical separation is too little and everything is screwed up. In Opera the text fields are too tall and screws up the form as well. Many people recommended to me not to use divs with a background for forms. My question then is: how should I do it? Can I use a table with a background image? I don't want to have a normal (ugly) contact form. Is there any way of making a form work across the browsers without giving up the nice design? Ok, I have basic CSS knowledge but need some help. Here's what I'd like to do: I take trips and post pictures on my site. I use lighthouse to display the images, so each image has a separate filename and caption, and each group of images has a separate group name. Under "Ski Trip", for instance, I'll have Img 1, "Skiing"; Img 2, "More skiing"; etc. It's relatively tedious to create page after page that uses the same format. I use CSS for style, the menu, and Lighthouse, but is there way that I could create a new page entitled "New ski trip.html" and in that file just have a list of the image filenames, captions, etc., that end up all using the same html format to display the images? I don't think I'm being terribly clear (sorry) ... big kudos to anyone who can help. When I switch between pages with images on them, everything is fine. When I switch between pages without images on them, everything is fine. But when I switch to or from a page with a picture on it to or from a page without a picture on it, the page jumps sideways a bit. Most ppl probably wouldn't even notice this, but I find it really annoying and want a good way to get rid of this. I'm using a centered fixed width css style so I have no idea how this could be happening. I'll just add the css if needed: (Any random advice or advice on how to make buttons without photoshop would be awesome too!) Code: body { background: #FFFF96; font-family: Verdana; font-size: 14px; } td { background: #FFFF96; font-family: Verdana; font-size: 14px; } a { text-decoration: underline; font-family: Verdana; font-size: 14px; } a:link { color:#2828FF; } a:visited { color:#2828FF; } a:hover { color:#AFAFFF; } a:active { color:#AFAFFF; } img { border: none; } #wrapper { width: 950px; margin-left: auto; margin-right: auto; } #title { width: 100%; font-size: 27px; font-style: italic; background-image: url("images/bgwinterowl.gif") } #links { width: 100%; padding: 15px; } #body1 { border: 4 double; border-color: red; background: #FFFFF0; width: 100%; text-align: left; padding: 15px; } #body2 { background: #FFFFF0; text-align: left; padding: 15px 15px 15px 100px; width: 500px; } Hi, As you no doubt can tell from the title of this thread I'm a newb. I'm familiar with html but moving into learning css. Self taught, I no doubt have a lot to learn but I'm attempting to alter a template and would really appreciate some assistance. The site is www . inspirationz . info. I look at the site on my main monitor which is a large one and all looks fine. The two boxes in the main content area sit side by side, however when I look at it on my laptop or on a smaller monitor the navigation box on the right appears to sit still to the right, but beneath the box on the left. It didn't appear this way in firefox browser at first on my laptop, only Internet Explorer, but it appears that way on my other pc monitor in firefox so I assume it's likely to be a coding error. I have included some of the stylesheet coding below. Is anyone able to help me work out what's causing this? Thank you in advance. /*================================================================ Typography and links ==================================================================*/ a:link, a:visited { color: #999999; text-decoration: none; } h1 a:link, h1 a:visited, h2 a:link, h2 a:visited, .sidebar_nav a { text-decoration: none; } h1, h2, h3, h4, h5, h6 { font-size: 1em; font-weight: bold; letter-spacing: .16em; } .featured h2 { font-size: 1.8em; font-weight: normal; text-transform: uppercase; } .post_header h2 {font-size: 1.2em; font-weight: normal; margin-top: 10px;} .post_header_page h1, .post_header_single h1 { font-size: 2em; font-weight: normal; text-transform: uppercase; } #footer h3 {margin-bottom: 25px; border-bottom: 1px dotted gray; padding: 5px;} .featured p { font-size: .8em; font-style: italic; } p { margin: 15px 0px; } .post_body_page p, .post_body_single p {margin: 0; padding: 15px 0px;} small { font-size: 0.8em; font-style: italic; } strong {font-weight: bold;} .post_body p { font-size: 1em; margin: 10px 0px; } .more { margin-top: 10px; margin-right: -10px; float: right; } .more_big { margin-top: -20px; margin-right: 20px; float: right; width: 139px; height: 73px; } .footer_comments { float: left; margin-left: 20px; margin-top: 20px; } .comment_count { font-weight: bold; font-size: 1.8em; } .featured_datetime {margin: 6px 0px} .featured_more { float: right; font-weight: bold; margin-right: 20px; text-decoration: underline; } .post_body_page ol, .post_body_single ol { list-style-type: upper-roman; margin: 30px 0px; } .post_body_page ol li, .post_body_single ol li { list-style-type: upper-roman; margin-left: 60px; } .post_body_page ul, .post_body_single ul { list-style-type: upper-roman; margin: 30px 0px; } .post_body_page ul li, .post_body_single ul li { list-style-type: disc; margin-left: 60px; } blockquote { margin: 0px 30px; padding: 20px; border: 1px dotted gray; font-style: italic; } /*================================================================ Site Structure ==================================================================*/ body { font-size:100%; line-height:1.125em; font-family: Georgia, "Times New Roman", Times, serif; background-color: #f0f0f0; background-image: url(images/index/body.jpg); background-repeat: repeat-x; color: #7C7C7C; } #page_wrapper { width: 976px; margin: 0px auto; position: relative; } #featured { height: 230px; margin-right: 3px; margin-bottom: 30px; border: 0px solid red; padding: 15px; background-image: url(images/index/featured.jpg); background-repeat: no-repeat; } #header { width: 667px; margin: auto; height: 109px; background-image: url(images/index/header.jpg); } #container { width: 990px; margin: 140px auto; font-size:0.875em; } #main_content_left_index { width: 600px; float: left; } #main_content_left { width: 600px; float: left; } #main_content_right { width: 343px; float: right; } #footer { height: 250px; padding: 130px 130px 50px 130px; margin: auto; clear: both; background-color: #eeefef; background-image: url(images/index/footer.jpg); background-repeat: repeat-x; background-position: top; } #footer_contents {width: 990px; margin: auto;} #footer_left {width: 460px; margin: auto; float: left;} #footer_right {width: 460px; margin: auto; float: right;} /*================================================================ The columns ==================================================================*/ #first_column { float: left; width: 280px; } #second_column { float: right; width: 280px; } /*================================================================ The posts ==================================================================*/ .posts { background-image: url(images/index/posts.jpg); height: 333px; width: 275px; margin-bottom: 60px; } .post_header { height: 38px; width: 255px; padding: 10px; border: 0px solid red; } .post_body { width: 255px; height: 180px; padding: 10px; overflow: hidden; font-size: .9em; } .post_footer { height: 58px; width: 275px; margin-top: 15px; } .post_header_page, .post_header_single { background-image: url(images/index/PostHeaderPage.jpg); height: 38px; width: 547px; padding: 25px; text-align: center; } .post_body_page, .post_body_single { background-image: url(images/index/PostBodyPage.jpg); background-repeat: repeat-y; width: 547px; padding: 0px 25px; } .post_footer_page, .post_footer_single{ clear: both; background-image: url(images/index/PostFooterPage.jpg); height: 90px; width: 477px; margin-bottom: 20px; padding: 0px 60px; font-style: italic; } .next_prev { border: 0px dotted gray; height: 29px; clear: both; margin-bottom: 20px; background-image: url(images/index/next_prev_posts.jpg); width: 577px; padding-top: 10px; padding-right: 10px; padding-left: 10px; } .next_prev_comments { border: 0px dotted gray; height: 29px; clear: both; margin-bottom: 20px; background-image: url(images/index/next_prev_comments.jpg); width: 535px; padding-top: 10px; padding-right: 10px; padding-left: 10px; } /*================================================================ The sidebars ==================================================================*/ .sidebar_header { background-image: url(images/index/sidebar_header.jpg); height: 91px; width: 340px; } .sidebar_body { display: block; float: left; margin:0 0 0px 0; width: 290px; padding: 25px; background: url(images/index/sidebar_body.jpg) repeat-y; } .sidebar_bottom { background-image: url(images/index/sidebar_footer.jpg); height: 56px; width: 340px; clear: both; margin-bottom: 40px; } /*================================================================ Sidebar Navigation ==================================================================*/ .sidebar_nav ul {} .sidebar_nav li {} .sidebar_nav ul li { display: block; padding: 4px; border-bottom: 1px dotted #515151; font-size: .8em; } .sidebar_nav ul ul li {margin-left: 10px; border-bottom: none; font-size: 1em;} .sidebar_nav ul ul ul li {margin-left: 10px;} .sidebar_nav { margin-bottom: 20px; } .sidebar_nav ul { } .sidebar_nav a {display: block; padding: 4px; } .sidebar_nav a:link, #navlist a:visited { color: #666666; text-decoration: none; } .sidebar_nav a:hover { background: #d8d8d8 } /*================================================================ Top navigation ==================================================================*/ #top_nav_menu { position: absolute; top: 132px; left: 0; width: 950px; } /***** drop menu *****/ #dropmenu, #dropmenu ul { list-style-positionutside; position:relative; line-height:1.5em; z-index:300; width:100%; font-weight: normal; letter-spacing: .18em; margin: 0px 0px 0px 0px; } #dropmenu a { display:block; padding: 5px 15px; text-decoration:none; color: #666666; font-size: 1.2em; font-family: Georgia, "Times New Roman", Times, serif; letter-spacing: .18em; } #dropmenu a:hover { color:#000; text-decoration: underline; } #dropmenu li { float:left; position:relative; } #dropmenu ul { position: absolute; display: none; width: 18em; top: 1.9em; left: 0px; } #dropmenu ul a { background: url(images/index/dropmenu_bg.png) } #dropmenu ul a:hover { } #dropmenu li ul { width:14.1em; margin-top: 4px; } #dropmenu li ul a { width: 250px; height: auto; float: left; } #dropmenu ul ul { top:auto; } #dropmenu li ul ul { left: 265px; margin:0px 0 0 10px; } #dropmenu li:hover ul ul, #dropmenu li:hover ul ul ul, #dropmenu li:hover ul ul ul ul { display:none; } #dropmenu li:hover ul, #dropmenu li li:hover ul, #dropmenu li li li:hover ul, #dropmenu li li li li:hover ul { display:block; } /*================================================================ Categories Navigation ==================================================================*/ #main_categories { margin: auto; height: 20px; width: 976px; margin-bottom: 30px; } /* Horizontal Category List (frontpage) */ ul.horizontal_categories { clear: both; } .horizontal_categories li { display: inline; background: url(images/index/cat_bullet.png) no-repeat right center; font-size: 1.2em; font-weight: bold; letter-spacing: .08em; } .horizontal_categories a { padding: 0px 25px; } .horizontal_categories a:link, .horizontal_categories a:visited { } .horizontal_categories a:hover { } Does anyone have any idea what could be happening to my main menu - it dissappears in Safari! Hobo I've mucked up my css a bit. Works great in IE but not in FireFox. Submenus are not under their main menu item. and I can't seem to get it centered. Here is the site. Causeway Lighitng And here is the css (it the nav2 portion that controls the top menu) Code: #nav, #nav ul { margin: auto; /* centres the nav */ padding: 0; list-style: none; /* removes the bullets */ width: 100%; } #nav2, #nav2 ul { margin: auto; /* centres the nav */ padding: 0; list-style: none; /* removes the bullets */ width: 135px; } #nav li, #nav { margin:0; padding:0; } #nav2 li, #nav2 { margin:auto; padding:0; } #nav ul li { position: relative; width:130px; line-height:14px; padding:0; margin:0; } #nav li ul { position: absolute; margin-left:134px; margin-top:-24px; display: none; } #nav li ul li { position:relative; float:none; /* stops the submenus from being horizontal */ } /* Styles for Menu Items */ #nav li a { display: block; text-decoration: none; /* removes the underline */ color: #777; background: #fff; /* necessary to fix an IE6 Bug */ padding: 0px; border: 1px solid #ccc; } #nav2 li a { display: block; text-decoration: none; /* removes the underline */ color: #777; background: #FFCC00; /* necessary to fix an IE6 Bug */ padding: 0px; border: 1px solid #ccc; text-align : center; } /* Fix IE. Hide from IE Mac \*/ * html #nav li, * html #nav2 li { float: left; height: 1%; } * html #nav li a, * html #nav2 li a { height: 1%; margin-left : auto; } /* End */ #nav li a:hover, #nav2 li a:hover { color: #E2144A; background: #f9f9f9; } /* Hover Styles */ #nav li ul li a, #nav2 li ul li a { padding: 2px 5px; } /* Sub Menu Styles */ #nav li:hover ul, #nav li.sfhover ul, #nav2 li:hover ul, #nav2 li.sfhover ul { display: block; } /* The magic */ #nav2, #nav2 ul { width: 100%; } #nav2 li { float:left; /* makes the main nav horizontal */ width:80px; /* Width of Menu Items */ margin:0; } #nav2 li ul { position: absolute; /* positions and sets width of submenus */ display: none; float:left; margin:0; } #nav2 li ul li { position:relative; float:none; /* stops the submenus from being horizontal */ } /* Styles for Menu Items */ Hello, This one doesn't look good on FF 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" /> <title>Untitled Document</title> <style type="text/css"> #layer { position:relative; font-size:10px; top:3px; width:100%; } #layer ul { float:left; list-style-type:none; height:12px } #layer li { display:inline; height:12px } #layer a { text-decoration:none; border:1px 1px solid #990000; color:#990000; background-color:#CCCCCC; padding:20px; height:12px } </style> </head> <body> <div id="layer"><ul><li><a href="#">sample link</a></li></ul></div> </body> </html> Hello, This one looks good on IE7/FF but not with IE6 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" /> <title>Untitled Document</title> <style type="text/css"> #picture { position:relative; float:left; left:6px; color:#ff0000; top:15px; } .name_txt { position:relative; margin-bottom:4px; float:left; font-size:10px; width:235px } </style> </head> <body> <div id="picture"> <p class="name_txt" style="float:left; width:100%"><img src="Blue hills.jpg" alt="" width="112" height="85"/></p> <p class="name_txt" style="float:left; width:100%"><img src="Sunset.jpg" alt="" width="112" height="85"/></p> </div> </body> </html> Hi, Here is the site I am working on: http://www.pizzaz-lingerie.com/launch.php It looks perfect in IE 7 and FF, but in IE 6 its a mess and I don't know what the problem is. I'm pulling my hair out over this one. -CJ Hey, Myspace allows users to customize their profiles with CSS, and what i've done is cover my profile with a blank DIV overlay. How can I include a flash component in my DIV? I'm trying to include this little flipbook device onto my profile sothink.com/tutorials/viewtopic.php?t=61 The flipbook you'll see is obviously not hosted by the forums (...I think,) it is hosted elsewhere and the user just included it in her bulletin post. What code allows you to do that? And would it be possible to include such a code onn my DIV overlay? Thanks, I'm having a lot of trouble getting a couple of final things to work on this CSS template design I'm doing for one of our stores. http://www.thescriptstation.com/catalog/index.php?tplDir=CSS-fluid-1 (the ?tplDir=CSS-fluid-1 is necessary to see the developing template instead of the live one) It's all looking pretty much how I want it, with a couple of exceptions, and I'd love some help with what I'm doing wrong here. Issue 1 Links in the top green bar and bottom green bar on the page - earlier I had them looking fine in FF (using margins, positions, and padding), but looked in IE and it was a big mess. So I backed up and worked on it in IE, and now its looking OK there, but in FF, I'm losing the links after the first one - it seems like they are displaying underneath one another, which is below the size of the containing style. Issue 2 In the same areas, For the life of me I can't find a way to vertically align those links inside those areas. They just go to the top no matter what I've tried. If anyone could look over the styles and see what I've done I'd be forever grateful: http://www.thescriptstation.com/catalog/templates/CSS-fluid-1/stylesheet.css http://www.thescriptstation.com/catalog/templates/CSS-fluid-1/main_layout.css Many Thanks Viewing this page in Firefox: http://moneyextra.thehelpgroup.co.uk/compare/creditcards/ProductDetails.php?index=79 - it looks fine, but when you view it in IE 6, it is really messed up Does anyone know whats causing that to happen and how I would fix it Thanks alot Ok, firstly, here is the link: www.mstrgaming.com/stars Now, if you look at the website in FF, then in IE, you'll notice that the absolutely poistioned #topbar (the horizontal bar right at the top) goes over the top of the floated logo & menu (whereas it doesn't in FF, which is the desired look). I'd welcome any suggestions as to why it does this, and more importantly how to prevent it. Also, the floated logo & menu is spaced away from the left side of the page, whereas in firefox, it isn't. I welcome any suggestions! The website is reletively simple so I don't think you should have any concerns with the code, but if you do by all means let me know . Thanks! Edit - how odd, I edited the title of this thread because I missed a word, and it won't change, oh well I have been reading alot about how much trouble we get into with IE when trying to center a div. I had a lot of trouble with it and mainly just wanted to have a fixed width site (760px or so) with a thin border all the way around it. Is the following code a good way to accomplish this? Code: <head> <style type="text/css"> body { margin: 0px; padding: 0px; } div { border: 1px solid #666666; height: 100%; width: 100%; } </style> </head> <body> <table width="770" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td><div></div></td> </tr> </table> </body> I am planning on having this as my index page and just using an "include" for the different header/body/footer elements. Would love some advice/opinions. I need to link to differnt style sheets to a page and i need it so it will use one if the user has IE and a differnt one if the user is using anything else that works properly. Is this posable and if it is please tell me how? and if theres a way of doing it that uses php i would like to use that method. thanks Anyone know of any web developer tool bars for IE7? The things I'm looking for are in browser notification of valid markup (like the HTML Tidy plugin on firefox) and being able to edit css live (like Chris Prodericks web developer toolbar). Sorry not quite css related but sorta ... TIA, Mark Hi Can anyone recommend a good book/course on CSS that they enjoyed/found very useful? I would rather read one awesome book, then 4 so-so books/courses. Thanks Drew EDIT: Just noticed the CSS resources above. But if someone does have a link to a good ebook (free or not) or hard copy, I would be happy to check it out. hey i am new in developing sites with css codes so i started coding my home page with all the css code that was required and when half the page was done i checked it in the browser. so it looks good in firefox but it looks messed up in IE. So please suggest me something to fix my problems. I am using Dreamweaver to develop my site. As per the subject I'm looking for examples of attractive yet sensibly coded forms where the layout uses only CSS. I guess bad things would be where the layout is done using absolute positioning. I'm looking for something that is easy to reuse and straightforward to code a stylesheet for. Thanks, Geoff Hello, I have this layout in CSS for my website www.websitemeester.nl , in Firefox it looks perfect, but IE ****s the whole thing up. Who knows why that is? How can I make it a lil better for IE? Thx, Jules #top { margin: 0px 0px 0px 0px; padding: 10px; border-bottom: 0px solid black; background: #efefef; height: 100px; voice-family: "\"}\""; voice-family:inherit; height: 40px; } html>body #top { height: 40px; } #left { position: absolute; top: 60px; left: 0px; margin: 0px; padding: 10px; border-right: 0px dotted black; border-bottom: 5px solid yellow; background-color: orange; width: 170px; voice-family: "\"}\""; voice-family:inherit; width: 150px; } html>body #left { width: 150px; } #middle { padding: 10px; border-top: 5px solid orange; background: white; margin: 0px 150px 0px 170px; } #right { position: absolute; top: 60px; right: 0px; margin: 0px; padding: 10px; border-left: 5px solid orange; border-bottom: 15px solid orange; background: #efefef; width: 150px; voice-family: "\"}\""; voice-family:inherit; width: 130px; } html>body #right { width: 130px; } |