CSS - Getting A Border To Display On Three Sides
Is it possible to tell CSS to make the border for say, a table, show on three sides? (Not one, not four, not two....three sides)
Similar TutorialsThis problem just started happening, but frustratingly I can't remember what I was changing when it started happening. The problem is that (almost) all the images on the site seem to be "bumped" 1px out of place, with a black border showing on the top and left hand sides of the images. This is not showing up with ALL images, however. I've embedded an image and you can see the effect on the logo, on the graphics in the body text, and on the sub-menu items (with the 'empty' box icons). However the effect does not occur on the menu items with the 'full' box icons. OK, apparently, I CAN'T EMBED AN IMAGE. Or a link to an image. Or a link to the site in question. SO I have no idea how I am actually supposed to get help for this problem. If someone can PSYCHICALLY DEDUCE what the problem might be without being able to view the site or an image of the problem, that'd be ACE! GAAAAH Alright, let's see if we can do this with JUST the CSS & HTML. Here is the CSS: Code: html { margin: 0; padding: 0; min-height: 100%; height: auto; } body { margin: 0; padding: 0; background-color: #FFFFFF; background-image:url('background-index.gif'); font-family:Verdana, Arial, Helvetica, sans-serif; color: #666666; min-width: 900px; min-height: 100%; } img { border:0; } a:link { text-decoration: none; color: #0096db; } a:hover { text-decoration: underline; } a:visited { color: #00abc7; text-decoration: none; } #header { width:900px; height:80px; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #0096db; } #logo { float:left; width:140px; margin:0; padding:0; } #head_nav { width:760px; position:relative; float: right; background-color: #ebf9ff; height: 80px; margin:0; padding:0; } #clear_both { clear:both; } #sidenav { float:left; width:100px; padding-left:10px; padding-top:0; margin-top:0; } #content_wrap { float:right; width:760px; background-color: #ebf9ff; background-image:url('content-background.gif'); } #content { float:left; width:500px; } #content h1, h2, h3, ul { padding-top: 15px; padding-left: 15px; } #content p { padding-left: 15px; } #focus_box { width:260px; float: right; margin-top:0; padding-top:0; } #focus_box h1 { padding-top:15px; } #focus_box p, h1, ul { padding-left:15px; } table.blue_highlight { border-bottom-width:1px; border-bottom-style:solid; border-bottom-color:#0096db; margin-left:15px; margin-right:15px; padding-top:15px; padding:0; margin:0; } #menu2 { float: left; width: 200px; } #main { float: right; } p { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 9pt; color: #666666; } ul { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 9pt; color: #666666; } h1 { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12pt; font-weight: 700; color: #0096db; } h2 { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11pt; color:#666666; font-weight: bold; } a:link { font-family: Verdana, Arial, Helvetica, sans-serif; text-decoration: none; color: ; } /*!!!!!!!!!!! MENU STYLES FOR LEVEL1MENU !!!!!!!!!!!*/ #level1menu { position:absolute; bottom:0px; padding-left:60px; } #sitemap li { margin-left: 15px; } #sitemap ul { margin-bottom:15px; } #sitemap ul li ul { margin-left:15px; } And here is the HTML: Code: <%@ LANGUAGE="VBSCRIPT" %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "(URL address blocked: See forum rules)"> <html xmlns="(URL address blocked: See forum rules)" lang="en" xml:lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>BB Group Homes</title> <link href="styles.css" rel="stylesheet" type="text/css" /> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "(URL address blocked: See forum rules)"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <style type="text/css">@import "style.css";</style> </head> <body class="developments"> <div id="header"> <div id="logo"> <!--#INCLUDE FILE="logo.asp" --> </div> <!--END LOGO--> <div id="head_nav"> <!-- #INCLUDE FILE="menutop.asp" --> <!-- END MENU_TOP --> <div id="level1menu"> <!-- #INCLUDE FILE="level1menu.asp" --> </div> <!--END level1menu--> </div> <!--END HEADER --> <div id="clear_both"></div> <div id="sidenav"> <!-- #INCLUDE FILE="menu_developments.asp" --> </div> <div id="content_wrap"> <img src="banner_developments1.png"> <div id="focus_box"> <!-- #INCLUDE FILE="focus_boxes.asp" --> </div> <div id="content"> <h1>Developments</h1> <table class="blue_highlight"> <tr> <td><a href="golfsociety.asp"><img src="Golf_society_residence_logo.gif"></a></td> <td><h2>Golf Society Residence</h2> <p>The Golf society project was initiated for a variety of reasons, some of which include the scenic environmental landscape, increasing trend of Bodrum as a holiday destination for tourists and natives, the beach and the close proximity to the airport.</p> <p><a href="golfsociety.asp">-> More</a></p></td> </tr> </table> <table class="blue_highlight"> <tr> <td><a href="thevillage.asp"><img src="thevillagelogo.gif"></a></td> <td><h2>The Village Bodrum - Tuzla</h2> <p>You will find everything you have dreamed of at Vita Park Golf Resort, a world-c1*** destination in the heart of the peninsula Bodrum, the famed pearl of the Aegean Sea. </p> <p><a href="thevillage.asp">-> More</a></p> </td></tr></table> <table class="blue_highlight"> <tr> <td><a href="bluemarina.asp"><img src="bluemarinalogo.gif"></a></td> <td><h2>Blue Marina Bodrum - Yalikavak</h2> <p>Blue Marina Apartments, overlooking the spectacular view of Yalıkavak amongst the centeranian olive trees, designed for all year long living, your comfort and every desire is planned to the finest detail. </p> <p><a href="bluemarina.asp">-> More</a></p> </td></tr></table> <table class="blue_highlight"> <tr> <td><a href="bluelife.asp"><img src="bluelifelogo.gif"></a></td> <td><h2>Blue Life Bodrum -Yalikavak</h2> <p>Each villa has a magnificent sea view which can not be blocked. They has own entrance & garden, swimming pool with 40 sqm, wooden terrace with 40 sqm for sunbathing, garage for 2 cars and is 100 metres distance to the sea. The living rooms have high vault ceilings.</p> <p><a href="bluelife.asp">-> More</a></p> </td></tr></table> <table class="blue_highlight"> <tr> <td><a href="bluelife.asp"><img src="bluelifelogo.gif"></a></td> <td><h2>Kalkan Luxus Villas</h2> <p>Each villa has a magnificent sea view which can not be blocked. They has own entrance & garden, swimming pool with 40 sqm, wooden terrace with 40 sqm for sunbathing, garage for 2 cars and is 100 metres distance to the sea. The living rooms have high vault ceilings.</p> <p><a href="bluelife.asp">-> More</a></p> </td></tr></table> <p></p> </div> </div> </body> </html> </body> </html> A lot of the images that are showing the 1px-off problem are contained in the SSIs (I don't think anyone here wants me to post the full content of the SSIs, do they?) but quite a few of the images in the main HTML are, as well: banner_developments1.png & all the logos. This would be a lot easier if I could show you a picture of what was going on. Hello, I got a website with a table on it. This is how it looks in firefox 2.0: http://img139.imageshack.us/img139/9822/helpffkr6.jpg And here's how it looks in IE6: http://img111.imageshack.us/img111/9675/helpiehi7.jpg As you can see, where FF do display the table border, IE does not. Here's the simplified table code and the related css code: Table -> Code: <table class="listings" style="width: 100%;"> <tr> <td colspan="2" class="darkRow">Category 1</td> </tr> <tr> <td style="width: 30%" class="lightRow">Thread 1</td> <td style="width: 70%" class="lightRow">This is thread number 1.</td> </tr> <tr> <td style="width: 30%" class="lightRow">Thread 2</td> <td style="width: 70%" class="lightRow">This is thread number 2.</td> </tr> </table> CSS code -> Code: <style type="text/css"> table.listings{ border-collapse: collapse; border-style: none; } table.listings tr{ border-style: solid; border-color: #4D3D4D; border-width: 1px; vertical-align: top; } .darkRow{ background-color: #4D3D4D; border-color: #4D3D4D; color: white; padding-left: 4px } .lightRow{ background-color: #BFACBF; border-color: #4D3D4D; color: #4D3D4D; padding-left: 4px; } </style> It seems as if IE doesnt support borders around a whole row, because when i add this: Code: table.listings td{ border-style: solid; border-color: #4D3D4D; border-width: 1px; vertical-align: top; } With that also IE displays a border but not only around the whole row, but around all the cells individually, which is not my intention. Does anybody have an idea what i can do about this? thanks in advance. Thanks for your time. Still learning design, so thanks for your help if they are easy solutions. Border Issue: In IE and FF I have a complete border on a few header div's. The bottom and top border is different color than the left and right borders. You can see that the dark brown bottom and top borders appear to lay overtop of the white left and right borders. Website is he http://onlinecasinoboss.true2formde...e.php?page=home Styling CSS is he http://onlinecasinoboss.true2formde...aster-style.css Layout CSS is he http://onlinecasinoboss.true2formde...ster-layout.css IE Layout Issue: In FF the three center content columns display how I want it to look. When you view the same home.html page in IE you can see that they don't space out how I'd like. It is most visible by compairing the boxes on the right of the center content. Thanks a ton for your time and help, I appreciate it. Hi all, I am trying to do the following: I want to have a page essentially divided into 3 sections: left side|middle|right side. On the left and right sides of the page, I would like to have a gradient that is a dark shade of gray starting from the edge of the screen and getting lighter as it reaches the middle section of the page. I have seen some tutorials on the web describing how this is accomplished, but I have not had much luck. I have been told that an easy way to do this would be to treat the page as a large table, with the centre cell being another table. I am pretty sure that this is poor design, but I am unsure about how to do this the proper way. As for the gradient portion, the tutorials indicate that I should make an image that is a few pixels in height and x number of pixels in width, and just do something similar to this: Code: .grad{ background:url("gradient.jpg") top left repeat-y; } where "gradient.jpg" is the image I created. I could then apply the "grad" class to any element I wish, but I can not get this to work. Any ideas would be helpful. Right, I'm a bit out of options on what else I can choose to do with my DIV tags and their properties but it's prolly a common problem. I'm trying to make a website where I have my main div in the center of the page. Next to that main div I want to have 2 DIV's, each on either side, which have a fixed width and a background image. Now the trick to it all, is that the sides should resize the moment I size the browser to a small one. I can get them to be on either side, but just getting them to resize and not my main window is something I can't seem to get the work. Anyone has any tips for me ? Hello all I have an elastic design in which an image clips to the appropriate size via overflow: hidden. Is there any way to control which sides are cropped? What I mean is, can one emulate the background-position property for IMGes with overflow: hidden? Thanks Tom Hi. Have created some simple tabs using table cells. Active tab should have bottom-border color equal to page background-color. Non-active tabs should have bottom-border=black. Works fine in IE, but does not work very well in Firefox. If I remove the border-collapse:collapse on the table, then firefox also work... but I would like to be able to keep the 1px border between each table cell. So is there a way to make this work in both IE and Firefox... and hopefully most other browsers... See code below: Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> <html> <head> <style type="text/css"> a.menu_top:link {color: #000000; text-decoration: none;} a.menu_top:visited {color: #000000; text-decoration: none;} a.menu_top:hover {color: #000000; text-decoration: none;} a.menu_top:active {color: #000000; text-decoration: none;} td.menu_top_passive { background-color: #777; border-left: 1px #000000 solid; border-right: 1px #000000 solid; border-top: 1px #000000 solid; border-bottom: 1px #000000 solid; text-align: center; cursor:pointer; font-weight: bold; padding: 5px 20px 5px 20px; margin: 0; } td.menu_top_active { background-color: #bbb; border-left: 1px #000000 solid; border-right: 1px #000000 solid; border-top: 1px #000000 solid; border-bottom: 1px #bbb solid; text-align: center; cursor:pointer; font-weight: bold; padding: 5px 20px 5px 20px; margin: 0; } </style> <script language="JavaScript"> function change(id, url) { for (i=1; i<6; i++){ eval("document.getElementById("+i+").className='menu_top_passive'"); } eval("document.getElementById("+id+").className='menu_top_active'"); } </script> </head> <body style="margin:0; padding:0; background-color:#bbb;"> <br><br> <center> 1. Load the page.<br> 2. Click Item 4.<br> 3. Click Item 2.<br><br> Why is the bottom border of the menuelements (table cells) not getting correct in Firefox?<br> None-active menuelements should have a border-bottom = black, active should have same bottom-border as page.<br> Notice that I use border-collapse on the table in order to get the cell-border 1px thick between the menuitems.<br> If I remove border-collapse, then there is no strange behaviour in Firefox.<br> Any way to get this working in Firefox without breaking it in IE? </center> <br><br><br> <table border="0" cellpadding="0" cellspacing="0" align="center" style="border-collapse:collapse;"> <tr> <td id="1" nowrap class="menu_top_active" onClick="change('1');"><a href="javascript:;" class="menu_top">Item 1</a></td> <td id="2" nowrap class="menu_top_passive" onClick="change('2');"><a href="javascript:;" class="menu_top">Item 2</a></td> <td id="3" nowrap class="menu_top_passive" onClick="change('3');"><a href="javascript:;" class="menu_top">Item 3</a></td> <td id="4" nowrap class="menu_top_passive" onClick="change('4');"><a href="javascript:;" class="menu_top">Item 4</a></td> <td id="5" nowrap class="menu_top_passive" onClick="change('5');"><a href="javascript:;" class="menu_top">Item 5</a></td> </tr> </table> </body> </html> I'm a little puzzled by this weird display bug by IE7, this bug doesn't occur in IE6. It had to do with the DIV's CSS's border-style. If you set it to double then you notice some random bugs with it. Some of the time, the border is displayed without a problem. Some of the time, it is displayed with some gaps in the line as if it is not being drawn upon. Some of the other time, it is not displayed at all. I noticed if I switch from one tab to another then back, the border appeared as if nothing had happened. I also noticed that if I open the view source that overlapp the web browser then closed it, the border appeared as if nothing had happened. How do you fix that problem? Thanks... I would like to set up a table with a different border than the cells inside it. Here's my code: 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 http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <style type="text/css"> TABLE {border: 1px solid black; border-collapse: collapse; width: 200px} TD {border: 1px solid #ccc} </style> </head> <body> <table> <tr> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> </tr> </table> </body> </html> That's all hunky dory in (gasp!) IE, but good browsers...they only show the lighter gray color. How do I get the table border to be different? Hi, This used to be my solution: Code: <table border=1 bordercolorlight='#CCCCCC' Bordercolordark='#FFFFFF'> But this only works well on IE - not Mozilla Now I want to use CSS: Code: .results { border: 1px solid #CCCCCC ; } Code: <table class='results'> --------------- The problem is, with CSS, only the TABLE acquires the border property. The cells within it don't. If I specify Code: <td class='results'> for all the cells in the table, this also won't work, because the cell borders overlap each other and some border lines seem thicker than others (because of overlapping). Is there any simple way I can specify the border property for the table - in ONE declaration? I want the table and td borders all to be a simple 1px width ...is that possible in one declaration? Thanks a lot! How do you create an inner border around a table in css, rather than a "solid" border which creates a border line around the table on the outer half. The border needs to butt up against an image, rather than leaving a pixel space. This is the coder I have so far. Nothing big: Code: .solid { border: solid 1px #000000; } Thanks. 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 Hi! Is is vicious to display a table as "display: block" to force margin-collapsing? Otherwise there's no margin collapsing with other elements. Thanks Hi all currently trying to move away from a table based layout into a cleaner looking css layout with a problem. http://www.prxa.info/area51/viewtopic.php?tid=1 The top section is the css version, where as the bit below it is using tables. I am trying to get the "container" class to encompass the whole top bit which i am doing, but the border of it refuses to appear? This is the css bits html: Code: <div class="container"> <div class="topicoptions"> <div style="float: left; width: 17%"> <a href="viewtopic.php?tid={$post['topic_id']}" class="topicoptions">#{$this->post_count}</a> </div> <div style="float: right; width: 83%; text-align: right;"> {$this->mod_options} {$topic_options} </div> </div> <div style="float: left; width: 17%"> <div class="contentbox"> <div align="center"> {$avatar} {$lang['postedby']} {$profile_link} <br /> {$post_count}<br /> {$lang['postedon']}: {$date_time} </div><br /> </div> </div> <div style="float: right; width: 83%; text-align: left;;"> <div class="contentbox1"> {$post['text']} <br /> <br /> {$signature_finish} {$edited} </div> </div> </div> As you can see "container" covers all of it, and the css is simply a 1px border, i cannot see where i am going wrong. I'm making a dashed border, and I was wondering how can I change the pixel size and color of the border? It's been awhile for me since I've used CSS or HTML but here's what I have(I know this isn't the proper formatting, but it's for a xanga site so the way it's entered doesn't really matter =\) <style="text/css"> #box { border-style:dashed; width:700px; position:absolute; } </style> <div id="box"> <div id="da"><p>Da..daa...da da Da</p> </div> <div id="muh"><p>muh numa nah</p> </div> </div> Hi, I'm trying to apply a background/border to a page. The site is at forsythproducedirect.com, and i'm trying to apply a similar background to pauleys.co.uk, minus the top green 'bar', so it'll just be running up the sides with the space behind the content still white. Does anyone have any idea how i'd go about it? I'd really appreciate any help! Cheers, Graeme how to create the free products heading over the border... with the border cut for tht part of the box ??? Hi guys. Can I change a table row border style like below?? Code: <tr style="border-bottom: solid 1px #DBDBDC";> Hey on my website: http://www.chamillionairechat.com I want there to be a border around the mainmenu and to look something like this: And this is the css i'm using for the mainmenu: Code: .mainmenu { background-color:#FFFFFF; padding-bottom:5px; border:1px border-color:#21511F; } So does anyone know what i'm doing wrong Thanks |