CSS - Browser Display Issue With Percentages Vs. Fixed Width
Similar TutorialsHi all, I've got a problem with CSS, and while I usually can fix them myself, I can't seem to find a solution to this one. I want to create a centered block with a dynamic width using almost nothing but CSS (except for the div in the HTML code). Not specified by percentages, but instead specified by the distance from both the left and the right border of the block to the body. So what I want is to specify the left and right properties of the DIV, so my first attempt was: Code: #block { position: absolute; top: 40px; right: 40px; left: 40px; height: 40px; } In Opera and FireFox it worked fine, but in Internet Explorer the block had no width. Does anyone know of a way to accomplish this? Hi, well i am using quicksand and in it i wanted to use tootips but no one on internet helped me by telling how to do so. So, i am now using css technique, the method is very simple css trick, when you hover over the game icons its details appear, and when you hover over the details then the details disappear. The details disappear in IE and firefox but it is not the case with google chrome. here is the test page http :// letseedrop.blogspot.com/2011/01/testing-8. html i don't know what i am doing wrong, i also tried to use !important in css but it didn't helped. well i am pasting css here too if you don't want to go into the source code Code: .demosa { position:relative; top:0px; left:0px; margin:0px; padding:0px; } .gamedetailpara { text-decoration:underline; color:#000000; } ul.gamecolumns { min-height:300px; list-style: none; margin: 0px; padding: 0px; } ul.gamecolumns li { background:url('(URL )) no-repeat; position:relative; display: inline; width: 114px; height:118px; float: left; margin: 8px; padding: 0px; } ul.gamecolumns li:hover { z-index: 99; } ul.gamecolumns li img { position:relative; top:12px; left:12px; filter: alpha(opacity=100); opacity: 1; -ms-filter:"progidXImageTransform.Microsoft.Alpha(Opacity=100)"; /*--IE8 Specific--*/ } ul.gamecolumns li:hover img{ position:relative; top: 12px; left:12px; z-index: 999; filter: alpha(opacity=100); opacity: 1; -ms-filter: "progidXImageTransform.Microsoft.Alpha(Opacity=100)"; } ul.gamecolumns li .gamedetails { position: relative; left: 0px; top: 0px; padding: 20px 4px 10px 10px; display:none; background:#ffffff; font:bold 13px "Times New Roman", Times,sans-serif; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; z-index: 99999; } ul.gamecolumns li .gamedetails:hover { display:none; } ul.gamecolumns li:hover .gamedetails {display: block;} ul.gamecolumns li:hover .gamedetails:hover {display: none;} thank you in advance. Hi I'm developing a new website using non tabular css and xhtml. I've used a predefined template which has been edited to my needs for the project. The problem I have is the top menu displays perfectly in FF3 but not in IE7, the top menu has a width of 100% with each of the 4 links having a width of 25% so in FF3 displays right across the page perfectly, but in IE7 the last menu link breaks to a new line. This url shows the issue im having: http://www.purepcs-store.co.uk/tim/new HTML USED: Code: <div id="menu" class="width"> <ul> <li> <a href="index.php" onfocus="blur()"> <span class="title ">Home</span></a> </li> <li> <a href="products.php" onfocus="blur()"> <span class="title ">Products</span></a> </li> <li> <a href="forum/" onfocus="blur()"> <span class="title ">Forum</span></a> </li> <li> <a href="contact.php" onfocus="blur()"> <span class="title ">Contact Us</span></a> </li> </ul> </div> RELEVANT CSS: Code: #menu { margin: 0 auto; } #menu ul { width: 100%; float: left; margin: 0; padding: 0; text-align: left; background: #3B5D77 url(../images/bg/menu.gif) repeat-x top left; } #menu ul li { display: inline; margin: 0; padding: 0; list-style: none; } #menu ul li a { float: left; width: 25%; font: 400 1.2em arial, sans-serif; letter-spacing: 0.1em; color: #fff; border-top: 7px solid #41637D; border-bottom: 15px solid #FFF; } #menu ul li a span { display: block; padding: 2px 7px; } #menu ul li a span.desc { font-size: 0.8em; color: #8C8D94; } #menu ul li a:hover, #menu ul li a.here { background: #4A5C6A; border-top: 7px solid #455660; } #menu ul li a:hover span.desc, #menu ul li a.here span.desc { color: #FFF; } .width { width: 100%; } full css code can be seen he http://purepcs-store.co.uk/tim/new/css/layout.css Does anyone have any ideas on how to combat this issue, if you can point me in the right direction it would be much appreciated. Cheers Hi, I have hit the "wall" in my knowledge of CSS while trying to implement a "flex-width-equal-height-sidebar-layout" style of layout as a skin/theme for a message board system and need some help. My trouble occurs when a direct link to the post is used (instead of following the menu navigation system) where the top menu information/links area (the area between the banner and the post) is chopped off... The relevant portion of the CSS seems to be the .col_wrap {margin-top: 10px; border: 0; overflow: hidden; float: left; width: 100%; position: relative; z-index: 10; clear: both;} portion of my CSS because if I take out the overflow:hidden declaration then the menu portion of the skin/theme/layout shows correctly but the sidebar the shows the part which should be hidden at the bottom and the footer completely vanishes from view! My apologies but this is the best I can do without having the ability to post pics or urls which could better explain what is wrong and frankly speaking I don't know how anyone here can help given my inability to show the problem but hopefully someone knows or has run into this problem before or can offer some resources that may be of assistance.... i ve been playing with my page and been trying to modify the width of the page (divs) according to the browswer's width. The problem is i want the navigation menu on left to be fixed width (say 200px) and the center div and the right column to be variable width. Also, i want to set a minimum width , so that the floating divs dont roll below the navigation menu. here s the link to the page. try reducing ur browser windows size . the content div rolls down under theleft nav menu. http://ccc.1asphost.com/pacemakerpr...r/cicuitlab.htm Also , i get wierd result in netscape navigator. please help I have seen a design which I find pretty interesting where in the main site is aligned left and fixed width at say 700px wide. Yet the footer seems to span the entire screen. The header also seems to use the entire screen width but that is beign accomplished with the background image, but this footer goes all the way to end of the screen and naturally adjusts itself under all the content. Is there a way to get this effect? I'm at the very very very begaining of a table-less design (my first, actually). The problem is, since I have decided to have a non-fixed width, when the browser is minimized, at a certain point the design breaks. See it here (please don't make fun! it's just the start): SiliconSatan.com/test.php I'd like to set a minimum width, probably on the container <div>, so at a certain point it sort of becomes like a fixed width? No smaller than a set width? [EDIT] Also, I have a question about background color mismatch, but it was not quite OT for the CSS forum: http://forums.devshed.com/web-desig...e7t-403266.html Hi, this is my first post. I have a problem with the navigation bar on a site that I'm developing (musicboxtheatre.com). It renders properly in firefox and safari, but, of course, IE is causing problems. It renders as steps. The tabs are dropping vertically so that their tops are aligning with the bottom of the previous tabs line-height. Does anyone know of a solution? Update: I rewrote everything, and it somehow works now. Nevermind. I cant get the side menu (colored in red at the moment...will eventually be white like the rest) to overflow: auto with 100% height....i know that you need a fixed with for overflow and the only solution i could find (havent tried it tho) was to use javascript to get the window dimensions but i am trying to avoid using javascript. heres the code: <b>The Page:</b> 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 </title> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" > <link rel="stylesheet" type="text/css" href="stylesheets/default.css"> </head> <body> <div id="content"> <div id="logo"> <img src="/Images/owlstreelogo.jpg" height="100px" width="300px" alt="Welcome to Owl's Tree"> </div> <div id="quicknav" style="height: 25px; background-image: url('/Images/quicknavbackdrop.jpg');"> <div id="quicknavtext" style="position: relative; top: 4px; margin-left: 25px; font-weight: bold; text-align: center;"> <a href="index.html">Home</a> <a href="">Profiles</a> <a href="">Chat</a> <a href="">Forums</a> <a href="">Messages</a> <a href="">Extras</a> <a href="">Tickets</a> <a href="">Suggestions</a> </div> </div> <div id="sidemenu" style="height: 405px; width: 200px; background-color: #FF0000; overflow: auto;"> <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br> </div> </div> </body> </html> <b>The CSS</b> Code: body { background-image: url('/Images/grassbackdrop.jpg'); } a:link { color: #7E5C14; text-decoration: none; } a:visited { color: #7E5C14; text-decoration: none; } a:active { color: #000000; text-decoration: none; } a:hover { color: #00FF00; text-decoration: underline overline; } div#content { height: 100%; width: 100%; background-color: #FFFFFF; } I know that most of the css is in the page and not the external css but thats because i was modifying it heavily to see what would work and what wouldnt. The problem is the fixed width on the side menu as it wont be consistent across different screen resolutions. any help would be much appreciated as i dont want to continue work on this page until i can figure this problem out. I having a bit of a problem with my div tags. I have set a table inside the divs to a fixed width of 300px and the same with the div tag. But if I was to insert text into the table such as: 11111111111111111111111111111111111111111111111111111111111111111111 this makes the table and div tag expand to fit the text on one line. Making is disappear off the page so people have to scroll to view the text. I have tried the CSS command of "table-layout:fixed;" but this just makes the table end and cut of the end of the text. Is there anyway round this?? Pretty much what the title says, is it possible to center a div in the middle of the screen without giving it a fixed width? The main body text in IE stays within the width I gave it, but in Firefox, it just goes off the div, its all not showing becasue I have the containing div overflow:hidden, but why won't it stay in the fixed width div, 603px, in Firefox like it does in IE? mediacontour.com/TCS/frequently-asked-questions.php Well, this would be the first time I actually am starting to use full DIVs to code a website, usually use tables. Anyways, I have most bugs fixed out since I do somewhat know how to code in DIVs - the question is though, on one of the "right" side content area things I have, the content part extending right over the DIV, and even the container. I also gave both with fixed widths, no idea why this is happening. Anyone have any ideas? http://www.futuregamers.net http://www.futuregamers.net/style.css Hi, I'm wondering how do you make two divs next to each other, in line with each other, but have one to the left be a set width, and the one on the right be everything else that is left (changes as the user scales the browser). Here is an example: ( -100px- )( ---------everything else that is left---------- ) (more stuff can go here now) I'm having trouble having one float: left and width: 100px, the other float: right and width: 100% (I think this part is the problem). Hi everyone, I'm interested in making the ads in the rightmost sidebar stay within the 900px of the layout. How can I alter this page so that: 1. The images stay inside the container div 2. If the images are larger than the rightmost column, the column expands to the left and will make the main content feed smaller. I'm still kind of rusty with how fluid width works. Site is h**p://www.topofferspage.com this should be simple, but im just not finding my answer. im trying to figure out how to evenly spread several links across a fixed width. i could manually set the padding or margins for each link, but i figure there has to be a way to do it in css automagically. Hello, How can i create a fixed-width menu to the left with content to the right that fills up the rest of the page. ie, no auto-width, it needs to fill up all the way to the right edge. So if you create a horizontal line <hr> in the content it will draw all the way to the right (except for some padding of course) Like this pictu tinyurl.com/ydsr2ov I'm looking for a nice cross browser (well, actually I mainly interested in IE8 and ff3) 3 column layout with header and footer where the middle column has a fixed width and the left and right are variable width. I like these: http://matthewjamestaylor.com/blog/perfect-3-column.htm But none have a fixed width center column (could they be modified for a fixed width center col?) Any suggestions? Hello all, I am implementing a 2 column fixed width template. The problem is that the smaller column does not stretch to match the height of the taller column. All of the online templates I have found remedy this problem by setting a 1 px high background image to span the width of the container div. My problem is that I would like to place an image at the top and bottom of the smaller column. How can I achieve this? Has anyone else experienced this? I have a div with a specified width of 503px. If I fill it with text, after about a screens worth it's physically 506px in IE (it's fine in every other browser). Anyone any ideas what could be causing this, or a solution to this problem? Many thanks |