CSS - How To Get Rid Of Line 'leading' With Css
my problem could best be summed up by looking at this test html :
http://hatchetman82.4000webs.com/test.html it contains 2 DIVs, and in IMG inside every DIV. the image is (probably) allined as text, which means there's a small margin between the DIV content area lower border and the IMG border. this space (colored yellow) does not originale from any padding, spacing or margin attribute (or at least tinkering with those didnt help). setting the line-height on the DIVs to 100% helps a bit (shrinks the gap a little), but causes problems with, for instance, a SPAN inside one of those divs. i've also tried all sorts of values for vertical-align on the DIVs to no avail. any help in eliminating the gap would be greatly appreciated. Similar TutorialsHow do I adjust the leading in CSS? I want two lines of texts to appear closer to each other. How do I do this? Help is appreciated. 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; } Hello, I use always use the <br /> tag and I just found out in using the clearing of divs like; Code: <div style="clear:both; margin-top:5px"></div> for next line or breaking of line. Is this a good thing to use? Hi all, How to go to next line if the width of the content is more than specified width? Thanx/Chandar Thanks for taking the time to read my question I have a row of pictures as nav links, and under them I want to put a row of text stating what each link is Picture Picture Picture Picture Text Text Text Text Each pic is 52px wide, so I made the containers for the text 52px wide. both have left and right margins of 10px (I made the .NavText margin 11 to compensate for the 1px border) yet they don't line up!! What am I missing? Thanks, Brad 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"> <head> <meta name="description" content="Canada Carriage - A supplier of great carriages from XXXXXXX." /> <meta name="keywords" content="Horse drawn vehicle, Carriages, Carts, Horse carriages, Horse carts, Coyaltix, Manitoba, Canada, Dealer, Equine, FEI, CDE, Combined Driving Event, Pleasure driving, Competition driving, Custom made, Fine quality, Affordable prices, European manufactured, Drive Canada" /> <meta name="Revisit-After" content="7 Days" /> <meta name="Robots" content="index, follow" /> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Canada Carriage</title> <link rel="stylesheet" type="text/css" href="LC.css" media="screen" /> </head> <body> <div class="MainCont"> <img class="HomeLogo" src="images/logo.jpg" /> <div class="NavHolder"> <a href="LisaClarkDesigns_About.htm"><img class="ImgNav" src="images/AboutNav.gif" alt="Click here to navigate to the About Lisa Clark Designs page." /></a> <a href="LisaClarkDesigns_Portfolio.htm"><img class="ImgNav" src="images/PortfolioNav.gif" alt="Click here to navigate to the Lisa Clark Designs Portfolio page." /></a> <a href="LisaClarkDesigns_Fees.htm"><img class="ImgNav" src="images/FeesNav.gif" alt="Click here to navigate to the Lisa Clark Designs Fees page." /></a> <a href="LisaClarkDesigns_Contact.htm"><img class="ImgNav" src="images/AboutNav.gif" alt="Click here to navigate to the Lisa Clark Designs Contact page." /></a> <div class="NavText">About</div> <div class="NavText">Portfolio</div> <div class="NavText">Fees</div> <div class="NavText">Contact</div> </div> </div> </body> </html> css Code: body { background-color: #000000; font-family: Verdana, Arial, Helvetica, sans-serif; margin: 0px; padding: 0px; } .MainCont { width: 800px; margin: 0px auto; padding: 0px; } img.HomeLogo { margin-left: auto; margin-right: auto; margin-top: 200px; margin-bottom: 0px; display: block; } img.ImgNav { border: 1px solid #999999; padding: 0px; margin: 0px 10px 0px 10px; width: 52px; } .NavHolder { margin-left: auto; margin-right: auto; margin-top: 100px; margin-bottom: 0px; padding: 0px; display: block; width: 314px; background-color: orange; } .NavText { padding: 0px; margin: 0px 11px 0px 11px; width: 52px; color: #ffffff; font-size: 12px; float: left; display: inline; background-color: red; } Hello, At my blog test site You'll notice the Quote: << Hello World! | Gettin' Closer >> text in the middle. Just as you see it above, I'd like that all on one line, but can't seem to figure out how to do it. Driving me nuts. Anyone? The CSS code controlling that is Code: .alignright { text-align: center; display: inline; } .alignleft { text-align: center; display: inline; } Thanks! Chris i have a series of divs that look like this Code: <div> <div></div> <div></div> </div> <div> <div></div> <div></div> </div> Each of the inner divs use the float attribute but when it comes to the second outer div it doesnt automatically go onto the next line it sort of continues from where the last div left off. Why is this... 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. I have a left-hand side nagivation TD containing plain-text links. The TD is a fixed width and I want to be able to indent automatically the second line of text in a link should the text for the text for the link exceed the fixed width of the TD. Anyone know how to achieve this effect? An example of what I might want it to look like... Code: Link one Link two A longer link three Link four I can't get IE7 or IE6 to look corectly. IE8 and other browsers appear to be fine. Any suggestions? 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 id="ctl00_ctl00_ctl00_ContentPlaceHolderDefault_head"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>HOME - My Company </title> <link rel="stylesheet" type="text/css" href="/css/CC_Style.css" /> </head> <body> <div id="wrapper"> <div id="main"> <div id="bannerHolder"> <img id="banner" src="../media/108/banner_home.jpg" alt="" /> <div id="banner2"> </div> </div> </div> <div class="clearfix"> </div> <div id="footer"> Copyright @ 2002-2010, My Company, Inc. <a href="#">PRIVACY STATEMENT</a> | <a href="#">SITEMAP</a> </div> </div> </body> </html> CSS Code: /*LAYOUT*/ *{ padding: 0px; margin: 0px; } body { text-align: center; background-image: url(../images/bg.gif); background-repeat: repeat-x repeat-y; } #wrapper { margin: auto; text-align: center; width: 960px; background-color: #FFF; } /*--------------- B A N N E R S --------------*/ #bannerHolder { padding: 0; margin: 0; border: 0; text-align: left; background-color: #fff; height: 198px; } #banner { width: 655px; height: 198px; } #banner2 { float: right; height: 198px; background-color: #e5f2fb; width: 304px; } /*--------------------- M A I N -----------------------*/ #main { background: #fff; height: 300px; } #news /* News Bar for Banner DocTypes */ { border-left: solid 1px #ccc; float: right; margin: 15px 0 15px 0; padding: 0 15px 0 15px; width: 274px; height: 350px; } /*--------------------- F O O T E R -----------------------*/ #footer { height: 22px; line-height:22px; font-size: 10px; color: #aaa; border-top: solid 1px #ccc; text-align: right; padding-right: 15px; } #footer a { font-family: Arial, Helvetica, sans-serif; color: #3a80a2; } /*----------------- F I X E S -----------------*/ .clearfix { clear: both; } Hi. Here is my code: Code: <?php echo $this->getPriceHtml($_product, true) ?> <?php if($_product->isSaleable()): ?> <button class="form-button" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><span><?php echo $this->__('Add to Cart') ?></span></button> <a href="#" class="buttony"><span class="stock">In stock</span></a> <?php else: ?> <a href="#" class="buttony"><span class="nostock">Out of stock</span></a> <?php endif; ?> <a href="#" class="buttonx"><span class="<?php echo $_product->gettesting() ?>">This item is Brand <?php echo $_product->gettesting() ?></span></a> This works perfectly, however, even though there is room for both the In Stock / Out of Stock button and the Mandatory / Optional Button, they sit one under the other, even though there is no <br />. I want them to sit on the same line. How can this be achieved? i need to justify a single line of text. As there is text-align-last in IE it works perfectly.. but i need it to be cross browser - ie. FF and Safari.. so this is not the sollution.. as i got just a certain number of links i've tried this way: Code: <div class="table"> <div class="tr"> <div class="firsttd"><a href="">link</a></div> <div class="td"><a href="">link</a></div> <div class="td"><a href="">veri long text</a></div> <div class="td"><a href="">link</a></div> <div class="td"><a href="">link</a></div> <div class="td"><a href="">long text</a></div> <div class="td"><a href="">link</a></div> <div class="td"><a href="">link</a></div> <div class="lasttd"><a href="">link</a></div> </div> </div> simulation the table through CSS : Code: .table { display:table; width: 100%; } .tr { display:table-row; } .td { display:table-cell; text-align: center; background-image: url(images/redbg.gif); background-position: right; background-repeat: no-repeat; } .firsttd { display:table-cell; text-align: left; background-image: url(images/redbg.gif); background-position: right; background-repeat: no-repeat; } .lasttd { display:table-cell; text-align: right; } but another problem shows up.. when the link text is long.. the cell width is not set equally - i.e. it goes too long and IE6/7 doen't displays it correctly - it goes vertically instead of horizontally.. here a live link: http://89.215.52.231/templates/26/ i'm talking about the black footer navigation.. Hey there. Is it possible to add a line break so that the following markup... html Code: Original - html Code <dl> <dt>Posts:</dt> <dd>33</dd> <dt>Topics:</dt> <dd>4</dd> </dl> <dl> <dt>Posts:</dt> <dd>33</dd> <dt>Topics:</dt> <dd>4</dd> </dl> ...looks like this? Posts: 33 Topics: 4 Basically, I want it to be like display: block, but only to the RIGHT of the text. Does that make sense? Just like adding a <br />, but with different HTML. http://www.concrete-creative.com/sharecipe/findfriends.html The dropdown menus don't always show the bottom horizontal line... I see them on all major browsers, but my friend is using an older version of FF and doesn't see the line on the Friend's dropdown (she's using 2.0.0.02 and I'm using 3.0.5). I cannot replicate the bug and I've gone thru all the code and don't understand why it wouldn't show on ONE dropdown, but does on another - with the exact same code. Can anyone see what I might be missing?! The CSS can be viewed he http://www.concrete-creative.com/sharecipe/sharecipe.css (scroll down to /* Navigation */ to see the styles for the menus) THANKS for any input! how can i keep these 2 divs i have on the same line, i tried min-width for the div they are in and it works perfect but IE doesn't support it, i even tried a extra div to use as a spacer but IE seems to make keep them on the same line even though there is already enough space for it, here is the html i'm using Code: <div id="ms_all" ><!-- Start all mapserver --> <div id="ms_main_map_div"> <input alt="Map" id="ms_main_image" type="image" name="mapa" src="map_img.phtml?[data_to_img]" /> </div> <div id="ms_side_bar" > <!-- A bunch of form stuff --> </div><!-- End Side Bar --> </div><!-- End all mapserver --> and here is the css Code: #ms_all { /*padding:5px;*/ height:610px; min-width:810px; position:relative; } #ms_main_map_div { padding:2px; left:5px; float:left; /*top:2px;*/ width:600px; } #ms_main_image { cursor:crosshair; width:600px; height:600px; } #ms_side_bar { right:2px; float:right; padding-top:20px; /*top:10px;*/ padding:2px; width:200px; /*clear:both;*/ } i want the 'ms_main_map_div' and the 'ms_side_bar' to be on the same line, but the 'ms_side_bar' stuff keeps jumping to the bottom of the page if it doesn't fit in the window, so does anyone know of a way to get IE to display this the right way or maybe make IE support the min-width thing, preferably keeping my CSS and XHTML valid The top image on my site lines up perfectly with the buttons in firefox but is off by a pixle in internet explorer! please help! my site is on digitalplus.webs.com Hi, i need to delvelop something like "SomeName X". Currently i am doing with DIV(1 DIV for 'SomeName' and 1 DIV for 'X' and finally float-left to another DIV). Since these names(like "Somename1 X",'Somename2 X"...) are populated in the div container, when it reaches the right end of the container, "X" alone getting wrapped to the next line. But it has to be along with 'SomeName' always. As other forums says, I tried with table but it didn't work since the final div container is fixed and i get multiple names with variant length. I tried clear:both, float left - it too didn't work. I have seen like the one in facebook - compose page. I would like to know how to implement this. Any help appreciated. Thanks in advance. |