CSS - Unable To Keep Navigation Bar On One Line When Window Is Resized
Hi,
I have the following horizontal navigation bar: Code: ul#List { list-style-type:none; margin:0; padding:0; width:956px; font-size:13px; font-weight:bold; } ul#List li { display:inline; } ul#List li a { text-decoration:none; padding:5px 0; width:100px; background:#000000; color:#FFFFFF; float:left; text-align:center; border-left:1px solid #fff; } ul#List li a:hover { background:#ADFF2F; color:#000000; } <ul id="List" style="position:absolute;left:0px;top:90px;"> <li><a style="width:91px;" href="">something something</a></li> ............ </ul> The trouble is when the window is resized (maximized or minimized) at certain points the last list overflows and appears on the next line. How can I prevent this, that is, keep the list on one line when the window is resized. Note I have tried using position:relative and putting the above inside <div> but neither solution worked. If the above code cannot be modified I wonder if someone has a horizontal navigation bar that does what I want. I will be very grateful for all help. Similar TutorialsHi. I have recently 'finished' my website, currently at http://www.aslo50.dsl.pipex.com I have positioned the images of the album cover absolutely (http://www.aslo50.dsl.pipex.com/music.htm) but they are jumping about when the browser window is resized. They are also overlapped on browser windows with different screen resolutions. The Navigation Buttons are also stacking and overlapping in this manner although they are just positioned in flow. I would be really grateful for any help you can offer. Thanks So this site is having a bit of trouble in WinIE 6.0. If you resize the window after you load the page, the dark brown area behind the content sort of gets stuck on the right. I'm wondering if it might have something to do with the javascript I had to do to get IE to recognize fixed backgrounds. Any ideas? Site: http://dev.sabotagemedia.com/firstclass/ CSS: http://dev.sabotagemedia.com/firstclass/_css/style.css Hello all I have a page that uses css for the layout. The issue that I can not figure out how to fix is when someone re-sizes their browser the page content is all resized. How would I lock th positions of each span on the page so even if they resize (smaller) the browser the span's will stay where they are when the page is fully maximized on the users screen? I hope it is clear what I am asking. I tried puttin like a float tag but that does not work at all. Thanks all Jason Hey, i made a header in with some space to get a navigation line over. So i put it in its place with css but when i zoom in or out it won't stay in the middle like evrything else, i tried evrything, display:block, margin:0px, position:absolute http://i.domaindlx.com/wheelofgod/kingjames.asp The navigation bar isn't lining up I use Mozilla Firefox and the 2 images "examples" and "articles" are not in the column no matter how hard I tried. This might be a CSS problem. This is what I have: Code: /* Layout Stylesheet */ body { margin:10px; background:#FFFFFF; color: #333333; text-align:center; padding:0; } #outer { text-align:left; border:1px solid #000000; width:1050px; margin:auto; } #hdr { height:60px; background:#9ACD32; color: #333333; } #bar { height:25px; background:#688E23; color: #FFFFFF; border:solid #000000; border-width:1px 0 1px 0; } #bodyblock { position:relative; background: #FFCC80; color: #FFFF33; width:650px; padding:0; } #l-col { font: Verdana; float:left; background:#9ACD32; color: #333333; width:120px; } #cont { width:800px; background:#FFFFFF; font: verdana; color: #333333; border:solid #000000; border-width:0 0 0 1px; text-align:left; } #ftr { height:25px; background:#9ACD32; color: #FFFFFF; border:solid black; border-width:1px 0 0 0; margin:0; } Code: /* Presentation Stylesheet */ h3, p { margin:0; padding:15px; } h4 { margin:0; padding: 5px 0; } p:first-letter { font-size: 80%; font-weight: bold; color:blue; } /*<![CDATA[*/a.piclink:active{color:red;background-color:grey;text-decoration:none} a.piclink:visited{color:blue;background-color:grey;text-decoration:none} a.piclink:hover{color:#B36B00;background-color:white;text-decoration:none}/*]]>*/ Been trying to figure out why my links in my navigation bar (id="extra") won't line up horizontally -- they keep stacking vertically. Can someone please tell me what I'm doing wrong? Thanks. The important bits are below... Code: <style type="text/css"> html,body{margin:0;padding:0} body{font: 76% arial,sans-serif} p{margin:0 10px 10px} a{display:block;color: #981793;padding:10px} div#header h1{height:80px;line-height:80px;margin:0; padding-left:10px;background: #999966;} div#extra{background:#a4c2c2; text-align:left} div#content p{line-height:1.4} div#navigation{background:#fff} div#footer{background: #999966;color: #333300} div#footer p{margin:0;padding:5px 10px} div#wrapper{float:left;width:100%} div#content{margin-left:200px; background: #fff} div#navigation{float:left;width:200px;margin-left:-100%} div#extra{width:100%} </style> <body> <div id="container"> <div id="header"> <h1 class="logo">Sowanee's</h1> </div> <div id="extra"><div class="navText"> <a href="#">global link</a> | <a href="#">global link</a> | <a href="#">global link</a> | <a href="#">global link</a> | <a href="#">global link</a> | <a href="#">global link</a> | <a href="#">global link</a> </div> </div> </div> <div id="wrapper"> <div id="content"> <p><strong>1) Content here.</strong> </div> </div> <div id="navigation"> <p><strong>2) Navigation here.</strong></p> </div> <div id="footer"><p>Here it goes the footer</p></div> </div> </body> I have finally got my page set up as required. There is one minor niggle. The footer sits at the bottom of the page when the browser is maximised and has no content. If the browser is not maximised or the content introduces scroll bars the footer is bumped up one pixel in IE. How can I get around this? The footer CSS is below, if you require any more CSS let me know which elements (roughly) as there is a lot of it. PHP Code: #wrap { margin-left: auto; /*center the wrapper CSS2 compliant (all except IE*/ margin-right: auto; margin-top: -21px; width: 760px; top: 21px; min-height: 100%; position: relative; left: 0px; background-image: url(../images/content_bg.gif); text-align: left; } * html #wrap { height:100%; padding-bottom: -20px; } #clear_footer { clear: both; height: 21px; overflow: visible; z-index: 1999; /*background-color: green; Used for demonstration purposes only, remove after testing*/ } #contain_footer { left: 0; margin-top: -21px; width: 100%; height: 21px; background-color: red; background-image: url(../images/contain_footer_bg.gif); padding-bottom: 0px; z-index: 2002; } #footer { position: absolute; bottom: 0; margin: 0 auto; width: 760px; height: 21px; line-height: 21px; vertical-align: center; background-image: url(../images/footer_bg.gif); z-index: 1999; } Perhaps this should go into a Javascript or PHP but I wasn't quite sure. I want to declare a navigation bar's text to a fixed height of 12px which I think is rather easy for MOST anyone to read. What I'm having to do is because the site owner wants a "tabbed" appearance, I'm using images for the sides and will make the background of the text various colors (depending on if their active or not). If a visitor to the site, however, has their text style zoomed, that will considerably disrupt the apparent "image" of the tabs and make it look screwey. Text must be used for SEO so making the tabs a full image is not an option. Any advice? Sorry if this should have gone to a different forum. Thanks. Tim Supposing I have an image that is 200x200 pixels, and I have a div that is 100x100 pixels. I want to place the image inside the div AND have all 4 corners of the image visible. How do I do this? The idea is to fit the image inside the div without the image looking like it got "cut off" on any of its edges. I tried simply changing the CSS width and height but that did not achieve the desired effect. I'm hoping I won't need 4 divs, one for each corner? Hello, For some reason I'm having difficulty with this, I'm designing a page that needs a background image centered even when the browser is resized like on ask.com. I don't need several different background options, just one background. It seems to me it should be simple enough but I'm having one of those nights. Can anyone point me in the right direction? Thanks, Jasontor i have a basic navigation system - 12 items divided into 3 columns - fitted together horizontally in a row. On a windows xp machine with a high resolution display which is set to automatically resize all ie browser pages to make them appear larger (readable or lower-res) - somehow my navigation columns no longer fit into a single row... as far as i know under all other browsers/platforms the menu appears correctly. i've tested the navigation layout in opera, ie, firefox, netscape on my own windows computer, and have tested the pages using some online site that takes snapshots of your page in various browsers on various operating systems (including linux and apple).... the problem may be with the way i am calculating the pixels for the div widths? or...? the page is at gatewoodfarms.com (gatewoodfarms.com/gwf.css) a screenshot of the problem is at gatewoodfarms.com/screenshot.png here is the Basic Structure/CSS: <body style="border:0px;padding:0px;margin:0px;min-width:630px;"> <div id="wrap" style="border:0px;padding:0px;margin:0px auto;width:630px;"> <div id="top" style=""> ... <div id="nav" style="border:0px;padding:0px;margin:0px;height:90px;width:630px;"> <div id="nav1" style="width:210px;height:90px;border:0px;margin:0px;float:left;"></div> <div id="nav3" style="width:210px;height:90px;border:0px;margin:0px;float:left;"></div> <div id="nav3" style="width:210px;height:90px;border:0px;margin:0px;float:right;"></div> </div> </div> <div id="main" style="border:0px;padding:0px;margin:0px;height:auto;width:630px;top:250px;"> ... </div> </div> any ideas how i can fix this? thanks! Hi All, I am building a site that has the following structure for the navigation; Code: <div id="navigation"> <ul id="navlist"> <li class="home"><a href="../index.asp" title="home"><span>home</span></a></li> <li class="aboutus"><a href="../aboutus.htm" title="aboout us"><span>about us</span></a></li> <li class="ourservices"><a href="../ourservices.htm" title="our services"><span>our services</span></a> <ul> <li class="internationalmail"><a href="ourservices_internationalmail.htm" title="international mail"><span>international mail</span></a></li> <li class="worldwidecourier"><a href="ourservices_worldwidecourier.htm" title="worldwide courier"><span>worldwide courier</span></a></li> <li class="worldwidefreight"><a href="ourservices_worldwidefreight.htm" title="worldwide freight"><span>worldwide freight</span></a></li> <li class="storage"><a href="ourservices_storage.htm" title="storage"><span>storage</span></a></li> <li class="publishingservices"><a href="ourservices_publishingservices.htm" title="publishing services"><span>publishing services</span></a></li> </ul> </li> <li class="requestquote"><a href="../requestquote.htm" title="request a quote"><span>request a quote</span></a></li> <li class="contactus"><a href="../contactus.htm" title="contact us"><span>contact us</span></a></li> </ul> </div> The main LI is horizontal, and the containing UL, LI is a vertical dropdown. The seperate CSS file does the image replacements on the <a> and hides the text within the <span>, usual stuff. The nav works great, with the graphic rollovers etc. The rollover, again, standard way of doing it, background: url(<FILE>) no-repeat top left; and the a:hover rollover is a background: bottom left;. Edit: Just noticed that I can't link to the full site that I have uploaded for preview. What I want to do, is when the user roll's over any of the items within the sub-navigation, it keeps the main Services navigation link rolled over also. The only way I could think of doing this, and relatively simply, would be to use JavaScript, but wanted to explore any other CSS ways of doing this. For example, is it possible to change a style of another class, from another? Your help would be much appreciated! please see following code. (i want myHeight becomes dynamis, that mean when user resize the browser, it will be changed automatic w/o refresh the page). thank you. waitting online for the answer. <html> <head> </head> <body > <table> <tr><td>tasd</td></tr> <tr><td> <script type="text/javascript"> var myWidth = 0, myHeight = 0; if( typeof( window.innerWidth ) == 'number' ) { //Non-IE myWidth = window.innerWidth; myHeight = window.innerHeight; } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { //IE 6+ in 'standards compliant mode' myWidth = document.documentElement.clientWidth; myHeight = document.documentElement.clientHeight; } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) { //IE 4 compatible myWidth = document.body.clientWidth; myHeight = document.body.clientHeight; } //var height = myHeight *.8; document.writeln("<div style='HEIGHT:" + myHeight *.8 + "; WIDTH:100%; OVERFLOW:auto'>"); //return height; </script> <table> <tr><td> msg </td></tr> </table> </div> <td> msg </td> </table> </body> </html> Greetings, I have a class called "header" and I am trying to give it a touch of extra space between it and the next line. All of my headers are just a few words and thus on one line. I tried placing "line-height: 1.5em" in my "header" class and it shows up correctly in Dreamweaver but not in IE. My thought is, because it is only a single line, that class value does not kick in because there is no second line for that class. Is there a way to conrol this in CSS or am I going to have to resort to using a....gulp.....spacer? Thanks in advance! I've got two lines of text. Want the spacing the two lines to increase, so I set a line-height. When I do this, not only does it increase space between the two lines, it also increases spacing above the first line (and maybe below the second). How can I increase spacing between the two lines only, without increasing above and below? Thanks! Greetings, I am relatively new to CSS and am using background image bullets. Problem is, in the case of a two line link, the bullet aligns in between the two lines and I need it to align to the top line. Below is the CSS, and attached is a screenshot of the link to better illustrate my predicament. Thanks for any help! li { list-style-type: none; background: url(../images/bullet.gif) no-repeat left; padding: 0 0 0 10px; } Hi there, thanks in advanced for any help. I have an xls file that is diplayed in my index page... however, when I view the index.htm locally is applies to the css style to my xls file perfectly. In both IE and Firefox.. however when I upload the file to my server IE displays it correctly, however FireFox doesnt. XSL file Code: <?xml version="1.0" encoding="iso-8859-1"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/TR/xhtml1/strict"> <xsl:template match="/"> <html> <body> <link media="all" rel="Stylesheet" type="text/css" href="css/schedule.css" /> <div class="stitle">Schedule</div> <xsl:for-each select="SCHEDULE"> <div class="date"> <xsl:value-of select="DATE" /> </div> </xsl:for-each> <div class="schedule"> <xsl:for-each select="SCHEDULE/SHOW"> <div> <div class="stime"> <xsl:value-of select="STIME" /> </div> <div class="etime"> <xsl:value-of select="ETIME" /> </div> <div class="title"> <xsl:value-of select="TITLE" /> </div> <div class="description"> <xsl:value-of select="DESCRIPTION" /> </div> <br /> </div> </xsl:for-each> </div> </body> </html> </xsl:template> </xsl:stylesheet> any ideas? and also it doesnt display this part of the xsl file on the web at all. Code: <div class="stitle">Schedule</div> thanks steve I'm struggling to target some headings in ie 6. They need more padding on the top as they look slightly chopped. www.efficient-heat.net/services The headings are Power Flushing and Condensing Boilers I've had a look at them in internet explorer developer toolbar and i'm seeing several paddings being applied. This suggests a conflict in the cascade. I've given the styling for the Power flushing header rule !important but that doesn't work. The headings look ok in ie 7 and ff3 How do I target these titles for styling in ie6? I have created a .css tab set and wish to move the tabs to left and reduce the white space before the first tab. For some reason, I just don't see it. Any help would be greatly appreciated. Thanks! Here is a link to the sample page I'm playing with: http://www.rustbug.com/mmtest/tabs.html Here is my .css: Code: body { margin:0px; background-color:#fff; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px;} p { margin:10px 10px 10px 10px; line-height:140%; color:#333333;} #menu{ margin-top:50px; width:744px; height:20px; z-index:1;} #menu ul { list-style:none;} #menu li{ float:left; background: url(../images/rect_tab_notselected.gif) no-repeat; height:20px; width:148px; text-align:center; line-height:20px; vertical-align:bottom; font-size:12px; padding-left:4px;} #menu a { text-decoration:none;} #menu li.selected { position:relative; top:1px; background: url(../images/rect_tab_selected.gif) no-repeat; background-color:#fff; font-weight:bold; height:20px; width:148px;} #menu li.selectedRound{ position:relative; top:1px; background: url(../images/curve_tab_selected.gif) no-repeat; font-weight:bold; height:20px; width:148px;} #menu li.notselectedRound{ background: url(../images/curve_tab_notselected.gif) no-repeat;} #menu_content_container { width:744px; border:1px #CCCCCC solid; z-index:2;} Here is my 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=utf-8" /> <title>Untitled Document</title> <link href="css/tabs2.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="menu"> <ul> <li><a href="tabs.html">My Selections</a></li> <li><a href="tabs.html">Date-based Option</a></li> <li><a href="tabs.html">Risk-based Option</a></li> <li class="selectedRound"><a href="tabs.html">Create My Own</a></li> </ul> </div> <div id="menu_content_container"> <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.</p> <p>Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</p> </div> <!-- <input type="button" value="Previous" class="btn"/><input type="button" value="Submit" class="btn"/> <p class="btn">hello</p> --> </body> </html> Hi All, Been a while since I have been here, been doing other jobs in place of website design sadly! Something I enjoy a great deal! Anyway, I am in the process of making a new website and I have discovered overlays - what a great idea. They look fantastic. Now I have designed an overlay for my site: http://www.wellandpower.net/website2/index.php The bottom link on this page makes an overlay appear with a new specification sheet in it. The dotted grey background (soon to be changed to another design) is held in the #overlay div, the specification sheet is housed in the '#overlayholder' div. The overlay div has a property of text-align: center; - but the overlayholder div is not aligning to the centre. I have posted the CSS of the two elements below. It works in IE7, but not in FF. Secondly, when the overlayholder appears and content is added to it, the overlay DIV does not stretch in either browser, why not? I found this strange. CSS Code: Original - CSS Code #overlay { visibility: hidden; position: absolute; left: 0px; top: 0px; width:100%; height:100%; text-align: center; z-index: 1000; background-image:url(/images/checkerboard.png); } #overlay #overlayholder { margin-top: 50px; padding: 10px; width: 850px; text-align: center; background-color: #FFFFFF; } #overlay { Any help greatly appreciated. |