CSS - Removing Space Between Paragraphs
What is the correct way to remove the space between paragraphs?
I have p { margin-top: -12px; } but IE/Win appears to be clipping the top of the topmost paragraph containers. What is the most compatible way to do this? Similar TutorialsHello, I have a table formatted by CSS within which there are two styles of text, headers and content. I have the content formatted using a class (conftabledetail), with the statement: .conftabledetail {font-size:10px;} I did that to make the content more compact and distinguishable from the headers. I would like to force a space between the paragraphs of content without using a <br> tag. I read that there is an "adjacent selector" which can be used to locate adjacent tags and apply a style, for example p + p {margin-top:1em;}, which would put a 1em space between adjacent paragraphs. Apparently this selector does not work when used against a subclass, because I can't get this statement to work: p + p.conftabledetail {margin-top:1em;} I CAN get this statement to work: p.conftabledetail {margin-top:1em;} But that's not what I want to do. Anyone have any ideas as to what I need to change or do differently? It would also be nice to do this with a <div> tag so I don't have to repeat the class identifier on every <p> tag... Thanks, Chris If you look at this page: http://www.heavens-host.com/index.php In Opera and Firefox there is no space between the heading tag in the middle and right columns. In IE however, there is a big gap. I have both of them set to a margin and padding of 0px; Am I missing something to get this working in IE? Here is the middle colum header and relevant css Code: <div> <h3><span>Welcome to</span> <span>Heavens Host</span></h3> <img> <p>Text</p> </div> #middle_column { padding:0px; margin:0px; width:392px; float:left; } #middle_column p { margin:15px; } .dark_heading { color:#134774; margin:0px; padding:0px; } .light_heading { color:#3196F7; margin:0px; padding:0px; } .section_heading { padding:0px; margin: 0px 0px 0px 15px; } And here is the right column Code: <div> <h3><span>Client</span> <span>Testimonial</span></h3> <img> <p>Text</p> </div> .right_content { width:200px; padding:10px 0px; margin:0px; height:150px; } .right_content p { margin:5px; } .right_content h3 { width:190px; margin:0px 5px 0px 0px; padding:0px; text-align:right; } I have something similar to the following: <div id="outer"> <div id="inner">Stuff</div> </div> #inner { top: -175px; } which lets me position background elements as needed so everything blends together well. The idea is that the outer layer background element needs to start lower than the inner layer and repeat until it contains the entire inner layer, and then stop. However, since I shift the inner layer upwards 175px, it gets the top where it needs to be, but it seems like it leaves 175px of the outer background repeating at the bottom...I don't need this space at the bottom. How can I remove it or make it disappear? An old draft of the file can be seen at Old Draft. The outer layer is the "carpet" background that repeats down the side and fades off in each direction. It needs to start where it does so it doesn't overlap the faded walls (applied to body tag). However, I want the desk area starting where it is now rather than where the faded walls end (too low on the page), so I shifted it upwards... I want to get rid of all carpet below the desk area, but the outer div expanded to contain the inner div, then the inner div was shifted upwards out of the top of the outer div, but outer div bottom did not shift upwards as well. I'm experimenting using css, on the page http://www.philmorris.biz/view.php?id=3278941167 The problem I have is the way that each line on the description has its own highlight- something that I've only experienced with css One thing I've noticed is that each line of the description is it's own paragraph, however since the description is pulled straight from eBay, there's not much I can do about that. Are there any obvious things I'm not thinking of? Thanks Hi all, I'm trying to use CSS to apply style to ONLY images that are within paragraphs on my site. Code: <p> <img ... /> </p> In the past, some time ago, I thought I learned that "p img {...}" would accomplish what I'm trying to to. However, it applies the style to all images, not just images within paragraphs... Any one know any other methods? I have a couple hundred images already coded in, so just simply applying a class to the previous images isn't something I'd like to do. Thanks much, dbeg. I have a bunch of text with nice formatting using paragraphs and I want to have a spacing between the paragraphs. I could easily do that by: Code: p { margin-bottom: 25px; } But that will make it so the last paragraph to also have a margin like that, how can I make it so that the last paragraph have a bottom margin of 0? Just the last one in that bunch of text. Now that, this is dynamic content generated by WordPress. WordPress text is place using paragraphs but the last paragraph on each post also has a margin that shouldn't be there, or my current design of course. Is there a way around this? This site is entirely CSS built and is database driven so it is completely dependent on classes and Id's. I have a conflict with <H5> in this page/site template I'm trying to edit. H5 is used for the title in the header and needs to be white. As you can see by the example of the my news section it looks just as I want it (H5 is the bigger bolder text that starts each paragraph) MyNews.jpg Code: <div class="bodyNews"> <h4>My News</h4> <h6> <h5>News 1</h5> Content ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. </h6> <h6> <h5>News 2</h5> Content ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. </h6> <h6> <h5>News 3</h5> Content ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. </h6> </div> And here's the CSS: Code: div.myNews {} h4 { font: 15px Georgia,serif; font-weight: normal; color: #6b3616; text-transform: uppercase; display: block; margin: 25px 0 2px 0; } h5 { font: 14px Georgia,serif; font-weight: normal; color: #6b3616; margin-right: 4px; display: inline; } h6 { font: 11px/14px Verdana,sans-serif; color: #3d412d; margin: 10px 4px 2px 0; } So the problem is the H5 though it looks fine in this news part it messes with the header H5 and I can't change the class there... There must be another way to do this... Can anyone offer an alternative? See the site he Template M i have a div that has a background img. when i have p's within this div the background img only shows up if theres a line of text there. i specified the height: 277px to fix this (if theres a better way, pls let me know). and tried to put overflow:visible within p's but its still clipping. any ideas? containing div: Code: #content .col { width: 303px; height: 277px; background: url(../images/one_third_box_top.png) no-repeat; float: left; } p: Code: #content p, ul { padding: 0 25px 0 30px; line-height: 1.5em; overflow: visible; } edit: this problem is in mozilla, but not in IE... weird. theres also one minor thing on a totally different subject. paths.. my paths a Code: /pub /css main.css /images foo.jpg foo2.jpg index.html obviously i have a link to the main.css in the index file but when i try to use url(images/foo.jpg), foo.jpg wont load? the path looks right unless im missing something... instead i have to url(../images/foo.jpg) for it to work... i always thought the '../' meant parent directory of the file (which is index.html since its linked from it)... right? thanks in advance. Hi! Should I do this? p { margin-top: 2em; margin-bottom: 2em; } or this: p { margin-bottom: 2em; } Same question for headers (h1, h2, etc) Thanks! Hi I have been using CSS for menus, content, etc for a while now, its great. But now I am using a table to display a list of products pulled from a database. I recently read that the table will not start to display until the whole of the <table> tag has loaded. This has become an issue, I think, because the table is slow to load. Should I consider scrapping the table and using CSS instead to display the list of products? Would CSS help at all? Thanks Jake Hi there, I have a menu system which uses <UL> etc, but it displays the bullet point. Is there a way to remove these bulllets? Many thanks! In ff3 at least theres white space under my log in box and I cant figure out how to get rid of it. I must have played with it over 30 minutes now and Its stumping me the url is www.devwebsites.com heres the code Code: <style type="text/css"> body { color:#333333; font-family:verdana,geneva,lucida,'lucida grande',arial,helvetica,sans-serif; font-size:small; font-size-adjust:none; font-style:normal; font-variant:normal; font-weight:normal; line-height:normal; } a:link, body_alink { color: #FFFFFF; text-decoration: underline; } a:visited, body_avisited { color: #4B5970; text-decoration: underline; } a:hover, a:active, body_ahover { color: #FF6600; text-decoration: underline; } #nav { padding:0; color: #FFFFFF; background: url(images/navbar1.png) 0 0 repeat-x; float:left; list-style-type: none; width:947px; border:1px solid #42432d; border-width:1px 0; } .login{ float:right; height:54px; margin:0; background-color: #cccccc; width:325px; font-family:verdana,geneva,lucida,'lucida grande',arial,helvetica,sans-serif; font-size:11px; font-size-adjust:none; font-stretch:normal; font-style:normal; font-variant:normal; font-weight:normal; line-height:normal; } #nav a:link, #nav a:visited { color:#FFF; padding:10px 10px 10px 10px; float:left; width:auto; border-right:1px solid #42432d; text-decoration:none; text-shadow: 2px 2px 2px #555; text-transform:uppercase; } #nav li:first-child a { border-left:1px solid #42432d; } #nav a:hover { color:#FFF; } .logo{ margin-top:25px; margin-left:25px; float:left; } .search{ margin-right:40px; margin-top:100px; float:right; } #toplogo{ margin-left:25px; margin-top:10px; float:left; border: 1px solid black; width:945px; height:70px; } .align{ float:left; padding-top:15px; padding-left: 10px; width:200px; } .footer{ clear:both; } </style> </head> <body> <div class="logo"> <img src="images/devwebsites.gif" title="BBoardX Home" height="100px" width="575px"alt="banner" /> </div> <div class="search"> <form action="#" style="display:inline"> Search Forums <input type="text" value="" name="search" style="background:url(images/browse.gif) left no-repeat; padding-left:25px;" /> <input type="button" value="Search" name="buttonSearch" /> </form> </div <div id="toplogo"> <div class="align"> <img src="images/folder-16.gif"alt="folder" /> BBoardX Forums </div> <div class="login"> <form action="login.php"> User Name<input type="text" name="username" value="User Name" onclick="if(this.value=='User Name')this.value=''"; onblur="if(this.value=='')this.value='User Name'"; /><input type="checkbox" name="remember" />Remember me<br /> Password <input type="text" name="password" value="" /> <input type="button" name="logged" value="Log in" /> </form> </div> and yes ryan420 i know what your going to say when (if) you see this thread link lol I would like to remove the right and left toolbars from a website I visit. The website is http://www.fark.com. how would i go about this using css with mozilla. What do I need to add to my usercontent.css? Sorry if this is the wrong place to post. Thanks. Hi everyone, Just two really quick questions. Is there a way to get the list-style-image property to work for in-line unordered lists? And is there a way to remove the first bullet in the list? Thanks for any help. Hey everyone, I am wondering if there is a way to get rid of the border that a:active has by default. Because I find that border annoying. I thought adding border: 0 would do the job, but doesn't appear to, anyone have any thoughts? Hi All, I have my site that uses CSS, however at times I want certain parts of it to not use the CSS. Not whole pages, just a section of a page. Is there anyway to remove all CSS formating in a section? So eg: <div style='none'> Some HTML </div> TIA Charlie I have a page that has a bunch of thumbnails on it and using css to format those images, i've added a margin to both sides for spacing. The class is applied to the href and set to have the img as a descendant. When the page renders in FF, there is no problem. But when it renders in IE, i get the nice little hyperlink underline where the margin is between two thumbnails. Any help would be great. HTML <a href="hometour/defiancemo/P9010045.jpg" class="thumbs" target="_blank"> <img src="hometour/defiancemo/thumbs/P9010045.jpg" alt="" /> </a> CSS a.thumbs img {margin: 0px 5px 10px 5px;text-decoration: none;color: #019934} Im trying to remove the bullet icon from the unordered list but I can't make it work in FF or IE... XHTML: Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <link rel="stylesheet" type="text/css" href="css/menu.css" /> <title>Test</title> </head> <body> <div class="menu"> <ul> <li><a href="#">Home</a></li> <li><a href="#">Community</a></li> <li><a href="#">General</a></li> </ul> </div> </body> </html> and the CSS: Code: ul.menu { list-style: none; padding: 0; margin: 0; } It's probably something really obvious! Hey guys! I have the following code in my CSS that controls the links in my document. The trouble is all my visited links appear as not underlined and all my unvisted links appear underlined? could someone help me to remove this? I can't get it to work PHP Code: #nav.a:link{ color: #FFF; text-decoration: none; background: transparent; padding: 0px 0px 0px 5px; } #nav a:visited { color: #FFF; text-decoration: none; background: #9CC9E3; background: transparent; padding: 0px 0px 0px 5px; } #nav a:hover { color: #9CC9E3; text-decoration: none; background: #9CC9E3; background: transparent; padding: 0px 0px 0px 5px; } Thanks Charlie I am trying to create a print-friendly page using css and as well as formatting the background and font i want to remove the other 3 frames on the site. I have tried to assign them class="noprint" so i can remove them using ".noprint { display: none; }" but they still appear on the print preview in ie6 & ff1.0. The background and font are correctly formatted to the instructions in the css file so i know that some of it is working. Could it be that the class is not being correctly assigned, what is the proper technique to assign a frame a particular class? Do i have to assign a class to all the elements within the frame too? Any help would be hugely appreciated as i'm tearing my hair out here! SalP |