CSS - How To Remove Body Border And Text Spacer?
Similar TutorialsWhen I allow scripts and active x to run in IE I get a dotted border around each letter of hyperlinked text. It looks fine in other browsers and also in IE if I block scripts. Does anybody have any ideas how to fix this or if it really is a CSS problem? Thanks Hi, I'm trying to create a border around the body, no matter how wide the window is. Here is an example:click here You will notice that the right hand border is to far right. He's the css for the body tag: Code: body { background-image: url(images/bkg.gif); background-repeat: repeat-x; font-family:"Lucida Grande", "Lucida Sans Unicode", "bitstream vera sans", "trebuchet"; background-color: #414548; border-style:solid; border-width:24px; border-color:#414548; border-bottom-width:200px; width:98%; height:100%; margin-left:0; margin-right:0; } I think the problem isn't in the body CSS, but maybe some place else. I can't figure it out. Can someone help? thanks I can only get margin to work with the body element. border & padding don't. Can someone explain why pls. Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Untitled Document</title> <style type="text/css"> body { margin: 0px; border: 10px; } </style> </head> <body> <div>This is some text</div> </body> </html> Also, i get the same result if I define a simple class and use div. e.g. .myclass { margin: 0px; border: 10px; } <div class="myclass"> some text </div> Only the 'margin' works within the class. Thanks for taking the time to read my question. I'm having a bit of a brain stall here. I want to get rid of the border around the href image, using css. How???? Code: <div class="Valid"> <p> <a class="ValidLink" href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0 Strict" height="31" width="88" /></a> </p> </div> Thanks, Brad Hi, Is it possible to remove the border from a select box? Many thanks Is it possible to remove the embossed bored from a select box. That is just destroying the whole look of my page and i there is a way please let me know. Nick I have a CSS menu. How to I remove the RIGHT border for that last link item? I tried a bunch of stuff, I can change the colour of it but I can't seem to get rid of it. Quote: /* ------------------------------------ PVII Menu CSS Express Drop-Down Menu by Project Seven Development www.projectseven.com ------------------------------------ */ /*body { font-family: "Trebuchet MS", Arial, sans-serif; font-size: 100%; background-color: #FFFFFF; margin: 24px 0; padding: 0; background-image: url(images/p7exp_pbg.jpg); background-repeat: repeat-x; }*/ /* Container for the menu. We set top and bottom borders only because the menu container stretches the entire window width. Note that this container can go inside a fixed width element that is centered on the page, if you so desire. It can even go inside a table cell. It carries a background image for aesthetics. */ #menuwrapper { border-top: 1px solid #000; border-bottom: 1px solid #333; background-color: #FFFFFF; background-image: url(../images/menu_bg.gif); background-repeat: repeat-x; } /*Clears the floated menu items. Assigned to a BR tag placed just before menuwrapper's closing DIV tag*/ .clearit { clear: both; height: 0; line-height: 0.0; font-size: 0; } /* p7menubar is the root UL and p7menubar ul applies to all the sub-menu ULs. We set padding and margin to zero to eliminate all indentation, turn bullets off, and set a font-family different from the global font-family declared for the body element above. This sets font for just the menu. Do not add a font-size here. */ #p7menubar, #p7menubar ul { padding: 0; margin: 0; list-style: none; font-family: Arial, Helvetica, sans-serif; } /* Root-Level Links. Do not change the first two properties. Adjust padding values to make the root links taller and to offset them from the left and right edges of the link box. The border right creates a separator between links. Font-size is set here and will apply to all menu levels. Font color is set to light gray. */ #p7menubar a { display: block; text-decoration: none; border-right: 1px solid #333; font-size: 1em; color: #FFFFFF; padding-top: 5px; padding-right: 14px; padding-bottom: 5px; padding-left: 14px; } /* Class assigned to those Root-Level links that have associated Sub-Menus. The top and bottom padding assigned this element must be the same as that assigned to the p7menubar a element. The right padding is increased to accomodate the display of background image depicting a downward pointing arrow. */ #p7menubar a.trigger { padding: 5px 16px 5px 10px; background-image: url(../images/p7PM_dark_south.gif); background-repeat: no-repeat; background-position: right center; } /* The Root-Level list items. Floating left allows them to appear horizontally. Width is for IE5 Mac. The last rule in this style sheet will set the width for this element to auto for all other browsers - hiding it from IE5 Mac. The width is proportional. As you add and edit root menu items, you will need to test this width to ensure it is wide enough to accomodate all text. */ #p7menubar li { float: left; width: 9em; } /* Sets width for Sub-Menu box and the List Items inside - in proportional em units. This allows the sub-menu width to expand if users resize the text in their browsers. */ #p7menubar li ul, #p7menubar ul li { width: 12em; } /* The sub-menu links. We set color and turn off the right border, which would otherwise be inherited from the root link rule. We set top and bottom padding less than the root items and increas the left padding to indent the sub-menu links a small amount in from the root links. */ #p7menubar ul li a { color: #666666; border-right: 0; padding-top: 3px; padding-right: 12px; padding-bottom: 3px; padding-left: 16px; } /* Sub-Menu Unordered Lists describes each dropdown sub-menu grouping. Positioned Absolutely to allow them to appear below their root trigger. Set to display none to hide them until trigger is moused over. Background Color must be set or problems will be encountered in MSIE. Right and bottom borders are set to simulate a raised look. A gradient background image is assigned. */ #p7menubar li ul { position: absolute; display: none; background-color: #FFFFFF; border-right: 1px solid #333333; border-bottom: 1px solid #333333; background-image: url(../images/menu_bg_pulldown.gif); background-repeat: repeat-x; } /* Changes the Text color and background color when the Root-Level menu items are moused over. The second selector sets color and background when Root-Level items are accessed with the keyboard tab key. The third selector sets an active state to support keyboard access in MSIE. The fourth selector is assigned to IE5 and IE6 Windows via the P7_ExpMenu script. Note that IE7 supports hover on elements other than links and so behaves like Firefox, Opera, and Safari - making the menu operable even if JavaScript is not enabled. */ #p7menubar li:hover a, #p7menubar a:focus, #p7menubar a:active, #p7menubar li.p7hvr a { color: #000000; background-color: #999999; } /* Set the Sub-Menu UL to be visible when its associated Root-Level link is moused over. The second selector is assigned to IE5 and IE6 via the P7_ExpMenu script. */ #p7menubar li:hover ul, #p7menubar li.p7hvr ul { display: block; } /* Sets the Text color of the Sub-Level links when the Root-Level menu items are moused over. The second selector is assigned to IE5 and IE6 via the P7_ExpMenu script. The color set should march the normal Sub-Level link color in the rule: #p7menubar ul li a. The background color must be transparent to allow the underlying gradient background on the UL to show through. */ #p7menubar li:hover ul a, #p7menubar li.p7hvr ul a { color: #000000; background-color: transparent; } /* The normal hover class for Sub-Level links. The Important directive is required for older browsers. We set a background color, which shows over the gradient background. We set text color to white. */ #p7menubar ul a:hover { background-color: #606060!important; color: #FFFFFF!important; } /* The single backslash \ character inside this comment causes IE5 Mac to ignore the following rule, which allows other browsers to render top-level menu items to their natural width. Do not edit this rule in any way. */ #p7menubar li {width: auto;} I just don't know how to get rid of the border around my image links... When you go to the site, everything looks okay, but when you press the link ("blog"), a border appears around it. And if you click it and then return back, the border is there all the time. Why? I have written "border: none;" pretty much everywhere in my css I can think of! I'm running out of ideas... This is probably something really simple so please help me out, I'm not much of a programmer as you can see.. The same border-problem repeats also on that blog-page which is a wordpress layout and should have nothing to do with my css!? The site is he http://prettydisturbed.com/ And my css around the problem looks like this: Code: #blog { display: block; float: left; width: 96px; height: 62px; background: url('../img/blog_mo.jpg') no-repeat 0 0; border: none; } a #blog img { border: none; text-decoration: none; } #blog:hover { background-position: 0 -62px; border: none; } #blog:visited { border: none; } #blog span { display: none; border: none; } p { font-family: Tahoma, Arial, sans-serif; font-size: 13px; color: #000000; margin: 0; padding: 0; border: none; text-decoration: none; } a:link { text-decoration: none; color: #ffffff; font-size: 13px; border: none; } a:visited { text-decoration: none; color: #ffffff; font-size: 13px; border: none; } a:hover { text-decoration: none; color: #ff39da; font-size: 13px; border: none; } a:active { text-decoration: none; border: none; } is there a way to make all text on a page a certain size unless otherwise noted, this is what i have and its not working and im not sure how else to do it body { margin:0px; font-size: 10px; } or would i have to do it for each "span" or "div" "p" i have? This is the weirdest thing, and I don't know what is wrong, and its driving me crazy. I have the following html code. Code: <body> <div id="container_bg"> <div id="container"> <div id="brand_bar"> <div id="logoleft"> Logo1 </div> <div id="logoright"> Logo2 </div> </div> <div class="header"> Big Image goes here </div> <div class="body"> <div id="left"> Left Column </div> <div id="right"> Right Column </div> </div> </div> </div> <div class="clear"></div> <div id="footer_bg"> Footer goes here </div> </body> </html> The css is as follows... Code: body { margin: 0px; background: #CCC; font-family: Arial, Helvetica, sans-serif; font-size: 10px; text-align: center; } .clear { clear: both; } #logoleft { float: left; width: 350px; } #logoright { width: 347px; } #container_bg { width: 768px; margin: 0px auto; background-image: url(../images/container_bg.gif); background-repeat: repeat-y; padding-bottom: 20px; } #footer_bg { width: 768px; height: 40px; margin: 0px auto; background-image: url(../images/footer_bg.gif); } #container { width: 700px; margin: 0px auto; text-align: left; } #left { float: left; width: 250px; } #right { width: 450px; } The weird thing is...I can't make left and right add up to 700 or its "bigger" than its container. I actually have to make the total add up to 697 or they won't stay on the same line. Is there just a mysterious 3 px space between divs...or am I missing something? The same with logoleft and logoright...if I make them the same (350px) to add up to 700px...it won't stay on the same line...what is going on? I posted something the other day, but that thread was elaborate but not helpful at all, because it missed a useful example with CSS sheet and everything. So here's another attempt and hopefully people know where the problem resides. I've stripped down the following page as far as I could within limited time. Before you click and open this URL, I think it's best to read my introduction first, because the problem often only occurs the first time after opening IE5.5 or IE6.0. With IE6.0 it might be that it _does_ work for you now. I notice that the bug is very infrequent with IE6.0. Sometimes it feels like IE6.0 cached the right page and doesn't want to show the wrong page the first time anymore. With IE5.5 it's still consistent on first time though... it will show the bug! A refresh may fix the page. Which is basically like opening the page a second time. http://www.stack.nl/~rem/problem.html It's a page with 3 big sections: header, middle, footer. I've stripped the footer as far as possible and reduced the header. The footer stays at the bottom of the window/viewport or bottom of the page if the page is longer and requires scrolling. What problem to look for? The news section to the right, it should have 2 identical blocks (in this example). But it cuts off the second block entirely and cuts the end of the first one. Basically where the form ends on the left side. On reload of the page the error will be "fixed". By accident I stumbled upon this thread (<- link) where they also seem to discuss the cut off of contents when the regular body text is shorter than the float text. Though for me the problem only appears on the page with the form and not with other pages. They couldn't figure out the trigger or cause either and the thread stopped in 2002. I'm trying that <p></p><p></p> workaround... If anybody knows some other workarounds or knows what triggers this problem. Feel free and invited to post any suggestion that can solve this matter. Adding more contents text is no option alas. Hi folks, don't usually post in the CSS forum here, but in the php forum I have got great help so give it a go. Basically I need to know how to center two divs on a page which themselves have float:left attribute. When I set text-align:center on the body a couple of other divs aligned perfectly so I did not have to worry about different res's. But I need these two divs (leftnav and content) next to each other and acheived this by setting the float:left attribute. The CSS code is below, I hope you can help, i have tried but these two divs in one outer div (without any float set) but didn't work. Code: body { font-family: "Lucida Sans"; font-size: 12px; margin: 0px 0px 10px; border-top: 0px none #000000; border-right: 0px none #000000; border-bottom: 5px none #000000; border-left: 0px none #000000; scrollbar-arrow-color: #D20000; scrollbar-3dlight-color: #4F4F82; scrollbar-darkshadow-color: #4F4F82; scrollbar-face-color: #f4f4f0; scrollbar-highlight-color: #FFFFFF; scrollbar-shadow-color: #d0d0d0; scrollbar-track-color: #ffffff; text-align: center; display: block; } .leftnav { float: left; color: #000000; font-size: 12px; font-family: "Trebuchet MS"; border-top: 1px solid #000000; border-right: 1px none #000000; border-bottom: 1px none #000000; border-left: 1px none #000000; padding: 0px; white-space: nowrap; width: 220px; margin: 10px 0px 0px 10px; clear: both; text-align: left; } .content { background-color: #FFFFFF; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #000000; border-right-color: #000000; border-bottom-color: #000000; border-left-color: #000000; float: left; white-space: normal; margin-top: 10px; margin-left: 0px; margin-bottom: 10px; font-family: "Trebuchet MS"; font-size: 13px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; width: 1000px; margin-right: 0%; list-style-type: none; text-align: left; } Thanks very much. Note: as a new user it would not let me use a link(url) Problem:when viewing in IE8 - the text looks grainy notes: Using this page as an example: fineprintnotes.com/bergincapital1210/about-us-bergin-co-difference -text looks smooth and easy to the eye when viewing in Firefox and Chrome -text looks smooth when using the "compatibility view" feature in IE8 - but want that look as a default for visitors -for example - when visiting other website using IE8 such as: savantcapital.com The text renders- when viewing in IE8- like Firefox and Chrome or in other words smooth and not grainy -i have the same font face as that site and not sure what a fix could be - read up on what possible fixes I could find on the internet - such as "emulate IE 7" tag for example on this page: url blocked -- Welcome to Internet Explorer 8 Readiness Toolkit Questions - has anybody had this issue? - i don't notice the savantcapital.com website defaulting to Ie7 (using emulate ie 7 tag - how does their text look cleaner than my website? same goes for morganstanley.com (as another example) - i find it hard to degrade the wesbite to fix the text issue- i am not sure if thats how to put it- but would like it to use a more DOM compliant browser like ie8 if it has option in stead of reverting to IE7 view. Any thought? or fixes? Thanks in advance. one other note: I tried to do screen shots but it wasn't communicating the issue - the images altered the drasticness of the difference - i feel - right now i have the website not emulating ie7 Jamie Hi, I have tried many times but for the life of me cannot understand css. It seems more of a nightmare than tables themselves. I would appreciate if anyone could give me an example of replacing a few spacer images with the css and html corresponding code for the following. Code: <td width="1"><img src="./images/clearpixel.gif" width="1" height="1" border="0" alt=""></td> <td width="8"><img src="./images/clearpixel.gif" width="8" height="1" border="0" alt=""></td> Hopefully I will be able to understand it more then. Thanks much in advance. Gibs I have an image I am using for my submit button, it has this "Link Box" around it that I want to go away. I just want the image shown and not the border or whatever is happening here. I assume it is because it is a link. I use an external style sheet for the rest of the page, so if there is a suggestion for me to reference a style from the style sheet, this would be a huge help. I have read about everything I could and still cannot find my answer. Is there a way to get rid of the box around my image using CSS? Here is what I have: <input name="imageField" type="image" onClick="return valLoginForm(frmLogin)" src="images/b_login.gif" width="60" height="18" > Thank you for your help. I have googled; I have read; I have read some more.... </popeye>That's all I can reads and I can't reads no more!</popeye> a {text-decoration:none} YEA! ....now; what if I only want to remove the underline on links in my menu and NOT the whole freakin' document???? lol..sorry I just spent the last three hours trying to fix this and no luck so far. the DOCTYPE is XHTML STRICT. Let say you have this: <a href="#"> <img src="some.gif" alt=""> Some text </a> I want to have underline for the text on hover, but not for image. How do I do that for the above A IMG text? I want both the IMG and text within the A tag. Would appreciate a solution that worked in at least: IE, FF, OP, NE, Safari For me it is working in IE and OP but not in the gecko browsers.... FF, NE Regards I'm a noob when it comes to CSS, so please go easy on me . I want to display a border to enclose text - like this: Code: <h4 style="border: solid">Some text</h4> The result, however, is that the border ends up extending to the end of the line enclosing a bunch of whitespace after the text. If I enclose the text in a table I get the result I want, but that's a very verbose solution. Is there a way to do it with just CSS? Thanks, David Hello, I'm using css to display a list using a unordered list. I want to put a border around the whole thing and I want to have some text that sits on top of the border (and indented a little). Can someone tell me how I could do this without making a specific absolute position style to do it? This is a mockup of what I'm trying to do - Where you see "i want text here" is where I want to put text: This is the css I have for the box so far: Code: #main_content ul.cfcheader { border-style:solid; border-width:12px; border-color:#d9e7f2; } #main_content ul.cfcheader li { position: relative; list-style: none; width: 548px; padding-left: 48px; text-align: left; margin-bottom: 20px; } I'm a wicked css noob so any help you could give would be helpful!1 TIA! For some reason the bottom border on my text in SPAN.standard_field_type_info works fine in firefox but on IE7 (I don't have IE6 anymore to test) it is not shown. I am pretty sure it is a margin/padding thing hiding the border but I can't remember how to fix it. Anyone got the rather simple solution? Cheers. PHP Code: DIV.standard_field_container { width: 98%; padding: 0.4em; border: 1px solid #8B8B8B; background-color: #E2E2E2; overflow: hidden; } DIV.standard_field_left { width: 10em; float: left; margin-right: 1.5em; font: bold 0.8em Verdana, Arial, Helvetica, sans-serif; } DIV.standard_field_right { font: normal 0.8em Verdana, Arial, Helvetica, sans-serif; } SPAN.standard_field_type_info { font-weight: normal; color: #ff0000; border-bottom: 1px dashed #ff0000; cursor: help; } |