CSS - Display: Inline; - Problems With Ie!!
hi, I am having problems with nav list
It displays inline on firefox but not in IE..but I can not see why? any ideas?? thanks PHP Code: /* NAV */ #nav { width: 420px; height: 70px; float: right; margin: 0; padding: 0; } #nav li.on ul, #nav li.off ul { margin: 0; padding: 0; } #nav a { text-decoration: none; } #nav li { /*float the main list items*/ margin: 0; float: right; display: inline; padding-right: 0px; background: url(../images/pipe.gif) no-repeat; background-position: 0 10px; } .noback { background: none; } #nav li ul { display: none; float: right; } #nav li.off ul, #nav li.on ul { /*put the subnav below*/ position: absolute; top: 88px; *top: 104px; left: 503px; padding-top: 10px; height: 28px; width: 420px; } #nav li a { color: #155089; font-size: 20px; display: block; height: 15px; padding: 10px; background-position: 0 10px; } #nav li.on a { color: #000; background-position: 0 10px; } #nav li.on ul a, #nav li.off ul a { float: left; /*ie doesn't inherit the float*/ border: 0; color: #C1D1E0; width: auto; margin-right: 0px; font-size: 18px; line-height: 0px; background: none; } #nav li.on ul { display: block; background: none; } #nav li.off:hover ul { display: block; z-index: 6000; background: #fff; } #nav li.off a:hover, #nav li:hover a { color: #000; background: #fff; background: url(../images/pipe.gif) no-repeat; background-position: 0 10px; } #nav ul li.off a:hover, #nav ul li:hover a { color: #000; background: none; } ul#nav li.off ul li, ul#nav li.on ul li { background-image:none; } ul#nav li.off ul li a:hover, ul#nav li.on ul li a:hover { background-image:none; } ul#nav li.on a.nopipe, ul#nav li.off a.nopipe { background-image:none; } /* END OF NAV */ and the html PHP Code: <div id="divnav"> <ul id="nav"> <li class="off"><a href="#">contact</a></li> <li class="off"><a href="#">products</a> <ul> <li><a href="#">testemonials</a></li> <li><a href="#">samples</a></li> </ul> </li> <li class="off"><a href="#">about us</a> <ul> <li><a href="#">processes</a></li> <li><a href="#">plant list</a></li> <li><a href="#">benefits</a></li> <li><a href="#">features</a></li> </ul> </li> <li class="on" style = "background-image:none;"><a href="#" class = "nopipe">home</a></li> </ul> </div> thank you Similar TutorialsHi guys, Please help. Im very confused as to why setting display:inline in my CSS is giving me grief with text "breaking out" of the list element in FireFox???. If I give the li element a background colour clearly I can see that the text is outside the boundaries of the li element. However, if I used display:block and float:left the li item ecompasses the text just fine. My CSS is below. Thankyou in advance Code: #navcontainer { margin-left: 30px; } #navlist{ list-style: none; padding: 0; margin: 0; } #navlist li { display: inline; border-right: 1px solid #000; padding: 0 0.4em 0 0.4em; margin: 0 0.4em 0 -0.4em; } /*Win IE browsers - hide from Mac IE\*/ * html #navlist li { display: block; float: left; } #navlist li a{ font-family: Garamond, "Garamond-Normal", Georgia, "Times New Roman", Times, serif; font-size: 200%; /* set the font size for p, scaled from the body declaration */ text-decoration:none; } #navlist a:link, #navlist a:visited{ color: #666; } /* unvisited link */ #navlist a:link#current, #navlist a:visited#current, #navlist a:hover { color: #000; } I've been seeing people using ul and li tags to make their menus in css. So I've started trying to do the same, here is an example. But obviously here, the buttons are not displaying inline. All of the styles are within the page code itself. I've got a display: inline style on the li tag, but it's still not working? How can I get this to work or is there any other way to get a ul li menu to display this way? Could someone enlighten me why the page in the following URL functions perfectly in both IE6 and FF and yet, I seem to be totally unable to get the darn thing working locally? I am trying to avoid JavaScript and this looked like a very clean way of hiding and revealing menu items. I don't speak Japanese so I don't understand the text on the page either. http://www.amy.hi-ho.ne.jp/staka/hp/dhtm/s_disp.htm Hello, my code works fine on my MAC browsers, but on my PC, IE6 browser, the buttons underneath the body of the page don't align. Here's the site: http://www.caillouette.com/Utilitrek/three/ Here's the CSS:http://www.caillouette.com/Utilitrek/three/style2.css Can someone tell me if this site looks okay in IE 7? I can't download IE 7 because of some technical quirk on my computer. And if they don't align in IE 7, please tell me what I should do. thanks -Sean This is bugging me to death. I cannot get these to top elements to display inline. If anyone could take a look in firebug to see element and related css applied and tell me whats wrong. The page is: http://travelmagoo.com/index.php?option=com_resource&controller=article&article=384&category_id=201&Itemid=0 at the top header there is a title and to the right there is an image. I would like the image and title to be on the same line but everything i do will not let me do this. any ideas? Ok, i have this menu with links, but i have a few problems. 1) Don't know why, but i can't center the menu links. There is more space from left to the menu, than from the right to the end of the menu. 2) I'd like to change the properties of each link (using CSS) individually, so i can resize each one like i want. I've done it, but it nly worked in IE. here's the site PS: I still haven't converted pictures to .gif, so it takes a little bit to load all pictures (3). Thanks for taking the time to read my question. I have two containers that I want to line up at the top. I can't seem to make them line up. I have a picture inside a <div>, then I have a paragraph. It works in IE7, but in FF, the <p> appears under the picture. If I put a width on the <p> it moves up, but never up all the way so that it is inline with the picture. I'm stumped and not sure what to do. I tried putting display:inline; on either classes, and on both classes at the same time. Not sure what else to do. If I put a width on the <p>, it looks like this in FF |------| |Icon | |---------------------------| |------| | ElevatorSpeech ES2..........| .............|---------------------------| It looks like this if I have no width on <p> |------| |Icon | |------| |---------------------------| |ElevatorSpeech ES2...........| |---------------------------| HTML: Code: <div class="ESContainer"> <p class="Title1">Control</p> <div class="Icon"><img src="Images/Remote.jpg" align="Zone All Control Remote Control" /></div> <p class="ElevatorSpeech ES2">Control your surroundings with confidence, get the results you deserve.</p> <p class="ElevatorFull"><span class="EFLargeText">Zone-All</span> has been manufacturing room comfort temperature controls for more than two decades. Its variable air volume and variable temperature solutions for zone controls are applicable to heating and cooling systems that are designed using both incremental HVAC units and central station air handlers.</p> </div> CSS: Code: .Icon { float: left; margin-left: 10px; padding: 0px; height: 100px; background-color:#FF0000; } .ElevatorSpeech { font-size: 19px; margin-left: 10px; margin-right: 10px; float: left; padding: 0px; /*width: 225px;*/ background-color:#FFFF00; } Thanks, Brad Hi, I have some simple code as follows: Code: #stars{ width:400px; height:33px; } .star{ width:33px; height:33px; background-image: url('images/product_review/star.gif'); font-size:0pt; } </style> </head> <body> <div id="stars"> <div class="star">1</div><div class="star">2</div><div class="star">3</div><div class="star">4</div><div class="star">5</div><div class="star">6</div><div class="star">7</div><div class="star">8</div><div class="star">9</div><div class="star">10</div> </div> I tried dislpay:inline; for the #stars and the .stars CSS, but inline makes the images disappear. They only show when I remove "inline", but they are stacked in a vertical row. I need them to be horizontal. Here's the link: click here Can someone show me what I doing wrong? thanks Hi, My site is loading fine in IE but messing up in FF, the tables (yes tables, sry) are loosing all height and widths. Ive had a look about but cant work out how to fix/get around this. HTML Code: <div id="products"> <table border="0" cellpadding="0" cellspacing="0" bgcolor="#ED1C24" style="width:194px; height:114px; margin-right:5px;margin-bottom:5px;"> <tr> <td align="left" class="code" style="padding-left:3px;"> AKA </td> <td align="right" class="name" style="padding-right:3px;"> TITLE </td> </tr> <tr> <td colspan="2" align="center" valign="middle" style="background-image: url(images/item_bg.gif); background-repeat:no-repeat;"> <a href="details.php?id=CODE"> <img src="images/products/photos/CODE.jpg" alt="TITLE" border="0" style="height:84px; width:184;" /></a> </td> </tr> </table> </div> CSS Code: #products { padding-bottom:10px; line-height:20px; font-family:Arial, Helvetica, sans-serif; font-size:11px; letter-spacing:1px; display:inline-table; vertical-align:top;} #products table {display: inline} How can i get the same effect so FF looks the same as IE? Thanks for any help. Mike Hello, I have a question about div's set to display: inline. First let me explain what I'm trying to do so that if I'm going about it the wrong way you can show me the light. I'm trying to have multiple divs centered on the screen and lined up horizontally, like so: | (div1)(div2)(div3)(div4) | The thing is, I have images in the divs. I also have a border on the divs. So when I set display: inline, the border goes through the image (although the divs are positioned correctly with the body text-align: center). However, when I set display: block, the border is exactly how I want it (i.e. it includes the image) but the divs are placed one on top of the other vertically and they are left-aligned. Is there a simple way to do this? Thanks I am working on a drupal site and I having problems getting some images in a block to display inline. I am able to effect some of the aspects of the images (they are list items in a ul) but I can't get them to display inline. Here is the html from the source: <div id="block-views-recent_images" class="block block-views"> <div class="blockinner"> <h2 class="title"> recent images </h2> <div class="content"> <div class='view view-recent-images'><div class='view-content view-content-recent-images'><div class="item-list"><ul><li><div class='view-item view-item-recent-images'><div class='view-field view-data-node-data-field-user-images-field-user-images-fid'><a href="/image-upload/admin/05-sep-2007/204"><img src="(xxxxxx) image_0.jpg" alt="" title="" /></a></div></div> </li><li><div class='view-item view-item-recent-images'><div class='view-field view-data-node-data-field-user-images-field-user-images-fid'><a href="/image-upload/admin/05-sep-2007/201"><img src="(xxxxxxx) image.jpg" alt="shack" title="some image" /></a></div></div> </li></ul></div></div><div class='more-link'><a href="/recent_images">more</a></div></div> And here is the css that I have attempted so far: #block-views-recent_images { background: #EBE9ED; } #block-views-recent_images li{ list-style-image: none; list-style-type: none; padding: 0; margin: 0; display: inline; } I am new to CSS so I know I may have taken a completely wrong approach. Thanks for any suggestions on how to get the images to display inline. Thanks I know that display:inline is supposed to change a Block element to view like an inline element. I take that to mean that the display:inline will eliminate any added space the Block element has in it. Meaning images and text will butt up against each other, but it's not working the way I expected. I have a list with images that I want to butt up against each other vertically . These images stack on top each other and to the left. The list has zero pixels for padding and margins. In the browsers that 5 pixel line shows up unless I code in a <p> then I adjust the <p> to have no padding or margin. EX: Code: <div id="maincontent"> <ul> <li class="hoodmenu"><p><a href="#"><img src="bu_streetware.jpg" alt="street ware"></a></p></li> <li class="hoodmenu"><p><a href="#"><img src="bu_dolls.jpg" alt="womens"></a></p></li> <li class="hoodmenu"><p><a href="#"><img src="bu_dudes.jpg" alt="guys"></a></p></li> <li class="hoodmenu"><p><a href="#"><img src="bu_beginners.jpg" alt="children"></a></p></li> </ul> </div> This seems like a hack. I have tried using display;inline but the spaces still appear. The code validates in 4.01 HTML and in CSS3. I also noticed I don't have to use the <p> in Opera or Safari, but I do for Firefox. Is this the correct way to handle this problem? If not, how should I actually write the code? Thank you! Please look at this site - http://www.hitechtranny.com In FF and IE7. Notice in FF that the last link "Contact" on the main nav does not fit? I use this navigation on numerous sites and I always get this problem. Is there a quick fix such as a margin/padding issue I am missing that would fix this? Thanks. Tom Hi, I have created a horizontal navigation before with no problem, yet I am now having trouble. Here's the site: http://www.caillouette.com/Catering/ I have the Div named "indentmenu" and the <ul class="toolbar"> Here's the style sheet: http://www.caillouette.com/Catering/style2.css and here's the navigation: http://www.caillouette.com/Catering/header_nav.inc what am i doing wrong? thanks in advance. Hello, I am having trouble with the display: inline tag. ******************************************** Here is the style: H1.nolinebreak { font-size : 12pt; display: inline; } Here is an HTML snippet: <p> Here is my content text. Blah blah <H1 class="nolinebreak"> inline header 1 </H1> blah blah blah <H1 class="nolinebreak"> inline header 2 </H1> </p> ******************************** The second and additional instances of the <h1 class="nolinebreak"> works great. But the first one always puts in a line break. I need them all to display inline. What am I doing wrong? Thanks in advance. Hi, can anybody help me stretch green buttons for Firefox just like they appear in IE? I'd greatly appreciate the help. Please see the attached html. I'm not completely new to css, but I am new to trying to do a totaly tableless layout. What I'm trying to achieve (which is just a very small part of the overall layout) seems like it should be simple enough but I can't seem to figure it out. Here's a link for visuals and the code. Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link href="styles.css" rel="stylesheet" type="text/css"> <style type="text/css"> <!-- #testBg { background-image: url('signInBg.jpg'); height: 46px; width: 333px; padding-left: 5px; color: #FFFFFF; } #testBg form { display: inline; } #testBg input { margin: 10px 5px 0 20px; } --> </style> </head> <body> <div id='testBg'>Sign In: <form action="login.php" method="post"><input name="username" type="text" value="(username)" size="12"><input name="password" type="text" value="(password)" size="12"><input name="action" type="image" value="login" src="go.jpg"></form></div> </body> </html> No matter what I try (which isn't saying much with my limited experience) I can't make the go button line up next to the right side of rest of the blue bar. Any help or links is appreciated. Thanks Okay i have been working on this for a while now, and i hate asking for help.. but i have given up on it. Firstly i started using display:inline-block; which meant i could have a width so my hover over menu effect would work. But this did not work in IE7 which means it is useless to what i am doing. So i then moved onto Display:inline; This worked fine, in both IE and Firefox, but the width cannot be set with this value. This value just wraps itself around the content. But i need to set a width to the Inline value. Any help? CSS: Code: #navcontainer ul{ margin: 0; padding: 0; list-style-type: none; text-align: center; } #navcontainer ul li { display: inline; width: 65px; height: 21px; background: url("images/tabbg.gif") 0 0 no-repeat; text-decoration: none; text-align:center; } #navcontainer ul li a{ display:inline; width: 65px; height: 21px; background: url("images/tabbg.gif") 0 0 no-repeat; text-decoration: none; } #navcontainer ul li a:hover{ background-position: -65px 0; color:#FFFFFF; } html: Code: <div id="navcontainer"> <ul> <li><a href="#">Milk</a></li> <li><a href="#">Eggs</a></li> <li><a href="#">Cheese</a></li> <li><a href="#">Vegetables</a></li> <li><a href="#">Fruit</a></li> </ul> </div> Also a link to the actual page is http://www.therow2.com/adsense/zzzzzzzzzzzzzzz.php I'm new here, but am hoping someone might have an answer to my question... I'm working to develop a site that displays press clippings for a company. The heavy lifting is done using PHP, but CSS is used for the positioning. Here's the link: http://lutzandpatmos.com/beta/press.php The relevant CSS file can be found at: http://lutzandpatmos.com/beta/lutzandpatmos.css There a number of magazines with press coverage. When you click on a link to a magazine title, the coverage from that magazine is made available below the rest of the links. If there is one clipping, the cover of the magazine is shown and that clipping is displayed. If there are multiple clippings, the user must click one of the covers to access that content. Additionally, covers are displayed with an image of a date below them. To keep the covers and dates together and centered, I've placed them in a <div> tag. My real problem is this: I'm developing on a PC, but the client is on a Mac, viewing with Safari. Therefore, the ultimate solution must work on Safari (although, unfortunately I don't know which version). The covers are "stacking" one above the other when viewed through Safari. The correct behavior - which I've tried to specify through use of the css {display: inline } rule would be for these covers to line up left to right, and if there are too many, for them to begin a new line when they reach the end of the table cell. I'm wondering if anyone can help me figure out a way to code the CSS such that the behavior intended (as seen in IE) would function correctly in Safari. Baring a CSS fix, are there other methods that you can think of to address the problem? I've considered using the nowrap tag to keep the covers from stacking, but this would be a problem when there are more than 6 or so covers, which occurs in a few instances of the press coverage. Please let me know whether I need to supply additional information relevant to figuring this thing out... If no one has ideas, can anyone point to other resources that might be helpful in solving this issue. It's a substantial problem for me, and any all help will certainly be highly appreciated. Thanks. Ryan Thanks for taking the time to read my question. I have a <div></div> that I am using to make a bar across my page. In this bar I am placing the links to the other pages on the site. If I don't use float, the height is messed up. If I do use Float, the width shrinks to the minimum. So I added width: 100%; but that made it wider than the rest of the other bars I already have... at leasts in FF, but not in IE. What should I be using? Float? Block? Inline? I've read the descriptions on http://www.w3schools.com/css/pr_class_display.asp but am still unclear on how to use them. I would like to have an area as wide as the page, with links in it so that the height fits the text + the padding. Does DocType help this? Not to clear on how to use that either. Thanks again, Brad my code below. HTML: Code: <html> <!-- Generated by AceHTML Freeware http://freeware.acehtml.com --> <!-- Creation date: 20-Jan-2006 --> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Contribution Help</title> <meta name="description" content=""> <meta name="keywords" content=""> <meta name="author" content="piercedjunkmail@hotmail.com"> <meta name="generator" content="AceHTML 5 Freeware"> <link href="ChurchHelp.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="Bar1"></div> <div id="TitleBar">Help for You</div> <div id="MenuBar"> <div id="MenuItem"><a href="index.html">Home</a></div> <div id="MenuItem"><a href="General.html">General Help</a></div> <div id="MenuItem"><a href="Settings.html">Settings Help</a></div> <div id="MenuItem"><a href="Contribution.html">Contribution Help</a></div> <div id="MenuItem"><a href="Member.html">Member Help</a></div> <div id="MenuItem"><a href="SiteMap.html">Site Map</a></div> </div> <div id="imgCont"> <img src="Images/ContributionForm.jpg" border="0" width="427" height="287" alt=""> </div> </body> </html> CSS: Code: body { margin: auto; background-color: #bcb277; font-family: Veranda, Arial, sans-serif; } #Bar1 { background-color: #CC9900; height: 10px; } #TitleBar { background-color: #330033; height: 30px; color: green; font-weight: 25px; padding-top: 5px; padding-left: 10px; } #MenuBar { display: compact; /*float: left;*/ /*width: 100%;*/ background-color: #006600; padding: 2px; } #MenuItem { float: left; margin-left: 30px; color: white; } #imgCont { float: left; padding: 12px; background-color: #a99a66; } a:link { color: white; text-decoration: none; } a:visited { color: #DCDCDC; text-decoration: none; } a:hover { color: #A9A9A9; text-decoration: overline underline; } a:active { color: #8B0000; } |