CSS - Css Line Spacing Problem
hey guys i'm having a problem with CSS line spacing. firefox is displaying correctly of course, and IE is scrunching the lines closer. here is an example (firefox on the right, IE on the left):
here is the CSS: Code: #galleriesTextContainer { height: 130px; margin: 0px; padding: 0px; margin-left: 8px; line-height: 8pt; } .galleriesText { margin: 0px; padding: 0px; color: white; font-family: Arial, Verdana, Sans Serif; font-size: 11px; } Code: <div id="galleriesTextContainer"> <span class="galleriesText">dolphy day 2005 (132 images)<br />dolphy day 2004 (101 images)<br />buffalo wild wings (47 images)<br />lemoyne 2005 (425 images)<br />lemoyne 2004 (28 images)<br />lemoyne 2003 (147 images)<br />syracuse nationals 2004 (43 images)<br />nyc / jersey 2005 (245 images)<br />minutes monte (29 images)<br />my truck (67 images)<br />phil's t-type (70 images) </span> </div> Similar TutorialsI'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! Hi I have a classic CSS:- ul.none { FONT-SIZE: 70%; line-height: 10pt; COLOR: #000000; list-style-position: intside; list-style-type: none; font-family: Verdana, Arial, Helvetica, sans-serif; position:relative; width:150px; padding:10px; text-align:center; BACKGROUND-COLOR: #EDF5F5; border: 1px solid #0000000; } AND THE HTML:- <ul class="none"> <li>NEWS 1</li> <li>NEWS 2</li> <li>NEWS 3</li> <li>NEWS 4</li> <li>NEWS 5</li> </ul> I want to have a larger gap between each <li> item, without using a <p> or a <br>? Line height or spacing does not work, it spaces out everything. E.g if the text in the <li> is longer than a line it makes this line higher, which means it looks well daft if you see what i mean. because everything is so spaced out. Margin and Padding do not work for what i wish to achieve. Could anyone Help please. Hi, I am having difficulty with the line-spacing on several pages of this website. One can be seen on this page the line spacing is not correct (it overlaps). The spacing should be like the home page and I haven't specified line spacing anywhere in the CSS. Also, some of the main headings on pages do not left align...they are in tables. Sometimes they are centered and sometimes they are just indented a little. I am trying to fix someone else's work and it's proving to be difficult. I'm trying out coding a skin for IPB, and there's an odd gap beneath all my footer tables/body elements. I've attached an image so you can see what I mean as it's all hosted on my PC. Code: <table width="100%" border="0" cellpadding="0" cellspacing="0" style="padding: 0px;" bgcolor="#363636"> <tr height="30"> <td style="background: url(style_images/tmp/cat_foot_bg.gif);" height="25"> <img src="style_images/tmp/cat_foot_far_left.gif" alt="" /> </td> <td style="background: url(style_images/tmp/cat_foot_bg.gif);"> <img src="style_images/tmp/cat_foot_left.gif" alt="" /> </td> <td style="background: url(style_images/tmp/cat_foot_bg.gif);" width="100%"> </td> <td style="background: url(style_images/tmp/cat_foot_bg.gif);"> <img src="style_images/tmp/cat_foot_right.gif" alt="" /> </td> <td style="background: url(style_images/tmp/cat_foot_bg.gif);"> <img src="style_images/tmp/cat_foot_far_right.gif" alt="" /> </td> </tr> </table> <!-- End Footer table --> <!-- End Category --> <br /> <!-- Begin new forum --> <div style="display:none" id="fc_7"> <!-- Begin Header table --> <table width="100%" style="background-image:url(style_images/tmp/cat_top_bg.gif)" border="0" cellpadding="0" cellspacing="0"> <tr width="100%"> <td height="32" width="8" align="left"> <img src="style_images/tmp/cat_top_far_left.gif" width="8" height="32" alt=" " border="0" /> </td> <td height="32" width="103" align="left" valign="top"> <img src="style_images/tmp/cat_top_left.gif" width="95" height="32" alt=" " border="0" /> </td> <td width="100%" style="background-image:url(style_images/tmp/cat_top_bg.gif)" align="left"> <div align="left" class="desc"><strong><a href="http://localhost/forums/index.php?showforum=7">Yahoo ****</a></strong></div> </td> <td style="background-image:url(style_images/tmp/cat_top_bg.gif)" valign="top"> <a href="javascript:togglecategory(7, 0);"><img src="style_images/tmp/cat_top_right.gif" alt=" " border="0" /></a> </td> <td style="background-image:url(style_images/tmp/cat_top_bg.gif)"> <img src="style_images/tmp/cat_top_far_right.gif" alt="" /> </td> </tr> </table> <--! End Header table --> </div> The <br /> is what I added today....it has no effect if I remove it. The first table is what the bottom of the "row" would be, it's the bottom of the category in the screenshot. I assume it's CSS as my header image has the same spacing between my content, and my content has the same between my footer. There is no CSS for the html or body. In Firefox, it renders great, but IE has that white spacing... I'd be grateful for any help as this has baffled me for the past few days alone I dont understand the purpose of Browser that behave differently from each other. Couldn't the browser makers just make it result consistently? This is my code to make my line spacing bigger or padding. I try to do other style changes and it also has the same problems. In Firefox, doing it this way works but in IE, nothing happens. Code: h1 { font-size: 10px; font-weight:bold; line-height:50px; padding:10px 10px 10px 10px; } Code: h1 { font-size: 10px; font-weight:bold; padding:10px 10px 10px 10px; } Then on my web page I put this in on the text I want to customise. Code: <h1>Sample Text</h1> h1 text is inside my little div box. Am I doing this wrong to achieve what I want? I'm not that familiar with css yet...so this might be a stupid question. I'm creating this website for my department. on the index page, there are several lists of links. between the links there is line spacing. but some link name is too long it got wrapped under. the wrapped under text also have line spacing. this makes the viewer feels that there are 2 links instead of one. how can i make the wrapped under text go right under without the line spacing? here is the link if you wanna see how it looks like now. http://www.scienceevents.uwaterloo.ca/ for example under the first left hand side menu, international year of astronmy is one link. but it looks like 2 links. how can i make them move together? this is the css for the primary nav Code: #primary_navigation { background:url(../images/primary_navigation_bg.jpg) no-repeat; /* This controls the background image on the home page. */ width:960px; height:200px; margin-top:20px; font-size:0.75em; clear:both; } #primary_navigation ul { list-style:none; margin-left:-20px; height:110px; } #primary_navigation ul li { line-height:2.0em; margin-right:5px; } If I have a couple of paragraphs of text and would like to adjust the space when you press return to start a new paragraph, how would I add it to my styles code below. Right now, a hard and soft return is too big and I would like the spacing to be about half the font size of the text. How would I add it to my stylesheet code in this example: Code: .bodytext { font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #000000; text-decoration: none; text-align:right; font-weight: none; background-color: #ffffff; line-height:1.5; letter-spacing:-0.02em; } Is it possible to adjust the line spacing in text using CSS because pressing return in text, the spacing is either too big or too small. I want control of line spacing so that I can have text and paragraph control like I do with Word documents. eg. A B I want the distance from A to B to be either greater or smaller. Can you also control the space between letters? eg. AB I want the spacing between A to B further or closer. Is this all possible on a HTML page without having to use images for text or using tables to seperate each text line on a table to create different line spacing. On this page: http://www.poweredpages.com/newtarget/ctia/ there's an spacing problem in IE. Hover over one of the links on the main bar to get the sub link tray. Hover over the first two links in a vertical set, and it will work fine. Hover over the THIRD link, and in that link and any link below it there's extra padding on the top of it. But all these links have the exact same CSS associated with them. Very odd. Works fine in FF. Here's the code and the CSS: Code: <div id="showtray" class="tray" onmouseout="hide('showtray','linkinfo')" onmouseover="show('showtray','linkinfo')"> <div class="traynav"> <ul> <li><a href="/info/">General Information</a></li> <li><a href="/info/registration_packages.cfm">Registration Prices & Policies</a></li> <li><a href="/info/keynote_sessions.cfm">Keynote Sessions</a></li> <li><a href="/exhibit/">Exhibit Floor</a></li> <li><a href="/info/ed_sessions.cfm">CTIA Educational Sessions</a></li> </ul> </div> <!-- 5 links to a column ONLY! Any more and start a new column, lke this one --> <div class="traynav"> <ul> <li><a href="/info/seminars.cfm">Partner Seminars</a></li> <li><a href="/info/green.cfm">Green Practices</a></li> <li><a href="http://www.ctia.org/conventions_events/convinfo/info.cfm">Receive Information</a></li> <li><a href="/info/international.cfm">International Guests</a></li> </ul> </div> <div class="trayimage whitetext smalltext"><img src="images/show.jpg"><br />Stars of the Show</div> </div> Code: .tray{ position:absolute; z-index:500; top:30px; left:0px; visibility:hidden; background-image:url(../images/blackback.png); width:920px; height:130px; border-bottom:3px solid #4CADCE; padding:20px } .traynav{ float:left; padding-right:15px; } .traynav ul{ margin: 0px; list-style-type: none; padding: 0px; clear: both; font-family:Arial, Helvetica, sans-serif; font-size:11px; border-top: 1px dotted #c2dae2; } .traynav ul li{ list-style-type: none; padding: 0px; clear: both; border-bottom: 1px dotted #c2dae2; font-size:11px; margin:0px; width:200px } .traynav li a:link, .traynav li a:visited { color: #FFFFFF; display: block; background-image: url(../images/arrow_orange.gif); background-position: 4px 7px; background-repeat: no-repeat; padding-top: 5px; padding-right: 8px; padding-bottom: 5px; padding-left: 15px; text-decoration: none; } .traynav li a:hover, .traynav li a:active { background-color:#4cadcf; } .trayimage{ float:left } .trayimage img{ border: 1px dotted #c2dae2; } Thanks Well, I am stumped as they say. I have a horizontal menu bar which I am unable to get it to display with the same amount of space above and below it with IE and firefox. So if you would take a look at this page http://www.cacct.com/new/mission.php and here is the style sheet http://www.cacct.com/new/css/sitestyle.css The menu content is called by a php include. Notice the difference between IE and firefox. What I would like is the same amount of light blue above and below. Things I have tried... Adjusting the padding and margins to header and maincontent. Tried placing the menu bar in a div but in Firefox the bar actually hangs over the bottom edge of the div. I put a border around the div so I could see it. In IE it is contained within the div (though it is a bit too long for a single line there so wraps around). This probably wouldn't work anyway since the menu is a drop down and needs to overlap the maincontent. Just to look at it, I moved the menu bar up to different places. Inside the header below the address still same problem. Between the logo and address same problem. When I move it to the top, above the logo it appears to be the same distance from the top of the border. So, anyone have any ideas on how to get that spacing the same? tk I'm stumbling through learning CSS with the help of some great people (here and elsewhere), and I've almost got a complete, working template, but I'm having a problem with (surprise) IE. I'm using nav boxes on the left and the right, and within the nav boxes I'm using unordered lists to define the menu options. In Firefox it works perfectly, in IE it adds an additional space to the bottom of each list item. Does anyone have any clue what's going on? I've tried to define the margins to 0, but that doesn't seem to do anything. http://www.mcconaha.com/css_refined.php http://www.mcconaha.com/css_refined.css Code: <div class="navbox"> <h3>Navigation</h3> <ul> <li><a href="#">. News</a></li> <li><a href="#">. Junk</a></li> <li><a href="#">. Pics</a></li> <li><a href="#">. Downloads</a></li> <li><a href="#">. Links</a></li> </ul> </div><!-- end navbox --> I just launched my first website and I am having a little problem with spacing, it is pretty obvious. I tried the _ hack, and I played with some padding, but I couldn't get the thing to budge in IE. the site is (psugmb.com) Please help! Thank you! ::Kyle In IE, there is a space between my div's. Can someone help me fix it? Attached is a sample htm and graphics or see he PHP Code: <div id="red" align="center"> <img src="red.gif" width="500" height="100"> </div> <div id="blue" align="center"> <img src="blue.gif" width="500" height="100"> </div> Thanks. Hi, Why there is such a big vertical space between table and element (div class="frm_container) in Internet Explorer 6. There is no space like that in Mozilla Firefox. What can I do about it? Thank you. Code: <head> <title>Title</title> <style type="text/css"> .frm_container { padding: 0px; margin: 0px; border: 1px solid #000; background-color: #fff; } </style> </head><body><div class="frm_container"> <form name="register" enctype="multipart/form-data" method="post" > <table><tr> <td align="right">Username:</td><td><input type="text" name="user" /></td> </tr></table> </form></div></body></html> Ok, I finally constructed the basic layout. But, I've encountered yet another problem. There seems to be a space for some odd reason between one of my images in the content div and one of the images in my news div. I want them to sit flush. Here's an image to show what my problem is: http://www.octavewebdesign.com/csshelp/spaceproblem.gif Here is the actual website: http://www.octavewebdesign.com/chilesxc/index.html The css can be found he http://www.octavewebdesign.com/chilesxc/style.css Any tips would be great. Please view in FF, as IE seems to mess it up... which is another problem for another day. Thanks. -Justin (but, if anyone has any solutions for the IE problem then that would be great to add it. For some reason IE makes the margins larger than they're supposed to be. The margin is set to 39 px, but it acts like a 50px margin for some weird reason. This causes the menu div to drop down below the content div.) Hey guys, First post here. I've scoured the web for answers, searched this forum, and visited many CSS sites (alistapart, maxdesign.com.au, positioniseverything, htmldog, etc.) and haven't seen a problem like this. I'm learning CSS as we speak (or more correctly, as I type), and here's the issue. I have a space between my #header and #page. I can't get rid of it unless I put a border around the #page. I've posted four screens here so you can see what's going on in Safari and Firefox (the two browsers I use). #1 is what the site looks like now (as the code is below). #2 is with the #header removed, #3 is with the #header removed and a 1px border put around the #page, and #4 is with the #header there and the #page has a 1px border. It seems to me that the #page has a top margin, and I've tried margin-top: 0px; and tons of other combos, but I can't get that space to go away unless I put a border around #page. Here's my css: Code: /* basic elements */ body { font: 8pt/16pt georgia; color: #000000; background: #AEAEAE url(images/butterflybg.gif) no-repeat top center; } p { font: 8pt/16pt georgia; margin-top: 0px; text-align: justify; } h1 { font: italic bold 14pt georgia; letter-spacing: 1px; margin-bottom: 0px; color: #000000; } h2 { font: normal bold 12pt georgia; letter-spacing: 1px; margin-bottom: 0px; color: #000000; } h3 { font: normal 12pt georgia; letter-spacing: 1px; margin-bottom: 0px; color: #000000; } a:link { font-weight: bold; text-decoration: none; color: #FFFFFF; } a:visited { font-weight: bold; text-decoration: none; color: #D4CDDC; } a:hover, a:active { text-decoration: underline; color: #9685BA; } /* divs */ #header { background: url(images/2006_Header.png) no-repeat; width: 697px; height: 127px; padding: 0px; margin: 0px auto; } #page { width: 697px; background: url(images/2006_WideExt.png) repeat-y center; margin: 0px auto; padding: 0px; } #nav { background: url(images/2006_LNav.png) no-repeat left; padding: 0px; margin: 0px; width: 175px; height: 306px; float: left; } #content { background: none transparent; margin-top: 0px; } #text { } #footer { text-align: center; } And my html: Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" > <head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /> <title></title> <link rel="stylesheet" type="text/css" href="style.css" /> </head> <body> <div id="header"> </div> <div id="page"> <div id="nav"> </div> <div id="content"> <div id="text"> <p>put text here</p> </div> <div id="footer"> <a href="http://devshed.com" title="Forums">xhtml</a> </div> </div> </div> </body> </html> Am I overlooking something simple? My site is displaying properly and in good way to the bullet that i've used in menu in FF. But in IE 7 bullet and text is too close which make menu un attractive. How can i fix this? any suggestion. if you want you can see nepalmedia . com . np thanks. Hi guys.. I have a script that spits out a series of divs.. The first 'wrapper' Div is position:relative, and I have placed other divs inside it, positioning them using position: absolute; left: 20px, etc... It renders perfectly on all my tested browsers, and yet when I make the script repeat, so that each div-set is loaded from the database, they just stack on top of each other on the page, rather than underneath each other.. All I am really doing is stacking divs, I thought that whatever went on in the 'child' divs didnt affect the parents ?? Like so: Code: <div style="position: relative;"> <div style="position: absolute; left: 20px; top: 40px;"> some content </div> <div style="position: absolute; left: 150px; top: 40px;"> other content </div> </div> Ive tried setting things like display: block;, clear: both, etc, but the sets of divs just 'pile' on top of each other... Any ideas :/ Many thanks, Mike. http://www.webpagedesignrus.co.uk/DECS Look at the text near the picture, I need to space it out a bit but only on the left side... I made the td have the id of "left": Code: #left { margin-left: 30px; } Code: #left { margin-left: 30; } I can't get it to work... Hello, this is my first attempt at a website and first attempt at using CSS as well. With much reading and the help of an online CSS layout creator I've been able to get pretty far, but have been having many roadblocks recently. For instance, the second heading in my layout is not displaying correctly in IE, but looks fine in FireFox. Please take a look at http://www.onlinecasinoboss.com/new_page_1.htm The second heading should lay directly underneath heading number 1, with a 2px margin in between header 2 and the main page layout. Also the text in the right, left and center columns starts as if it had a 12px or greater top margin. This problem exists in BOTH IE and FF. Please help, and thanks for anyone that takes the time to help a newbie web designer out. |