CSS - Curved Corners With Border
I want to implement a navigation menu as a box with curved corners and a dotted border. What would be the best way to implement this. I have found some methods that achieve a box with the curved corners using just CSS but can't find any method to get them with borders. I am open to suggestions that require learning authoring software.
Similar TutorialsI've been working on getting a nice look to fit the body of my content in, but I'm having a little difficulty. Based on some tutorials and things I have read, it seems many people do this technique by applying background images to various tags. I know it has a set width. However, the height may vary depending on how long the body copy is, which is where the problem arises. I have it broken into three images (top, bottom, left_right) It seems to display properly in IE7. However, in Firefox, the top and bottom images do not connect with the left_right image. I've tried setting margins and padding for top/bottom to 0 as I thought that may be the issue, but it didn't fix it. Can view files at: http://www.russellholloway.com/beta/test.html http://www.russellholloway.com/beta/main.css I'm pretty new to working with CSS, so if there are any other errors that may arise from the way I have coded this, please let me know. I intend to position the whole content-wrapper div in a floating layout for the site. Essentially there will be menus / such to the left, logo / stuff above, and this body content area will be in the remaining space. CSS copied below: css Code: Original - css Code .content-wrapper { padding: 0; margin: 0px; position:relative; } .content-wrapper .footer { width: 710px; background:url(content_bottom.jpg) no-repeat bottom; padding: 0; margin: 0px; position:relative; min-height: 34px; } .content-wrapper .heading { margin: 0; background-image: url(content_top.jpg); background-repeat: no-repeat; width: 710px; padding: 0px; height: 35px; position:relative; } .content-wrapper .heading h3 { position: relative; top: 20px; left: 20px; } .body { background-image: url(content_lr.jpg); background-repeat: repeat-y; padding-top: 0px; padding-right: 20px; padding-bottom: 0px; padding-left: 20px; width: 670px; position:relative; margin: 0px; } .content-wrapper { Greetings, I have perhaps a strange problem. I am trying to use CSS to generate a border around .PNG images. My border consists of png images as well. For the border, I want rounded corners, which take seperate images, and then a middle image that repeats to fill in the space. My problem is that the middle image is repeating over the corner images. You can see it he http://www.3dbrewer.com/ Notice the borders around the random images at the top. It is going over the corners. The reason I have to do it this way is that the images vary in size. Here is the code I am currently using: Code: .pb div { background: url(../images/picture-tl.png) 0 0 no-repeat; } .pb div div { background: url(../images/picture-tr.png) 100% 0 no-repeat; } .pb div div div { background:transparent url(../images/picture-t.png) 0 0 repeat-x; padding:13px 0px 0px 0px; } .pb div div div div { background:url(../images/picture-l.png) repeat-y scroll left; padding:0px 0px 0px 13px; } .pb div div div div div { background:transparent url(../images/picture-r.png) repeat-y scroll right; padding:0px 13px 0px 0px; } .pb div div div div div div { background:transparent url(../images/picture-b.png) repeat-x scroll bottom; padding:0px 0px 13px 0px; } I plan on putting corners on the bottom too of course, but one step at a time. Any help would be appreciated Greetings, I'm trying to create a fieldset that has rounded corners and a solid border. From what I gather IE displays rounded corners by default, Firefox does not. The code below makes Firefox display rounded corners, but when a border is applied rounded corners won't display on IE. Is there anything I can do to enable rounded borders? Thanks, fieldset { border:3px solid #000000; -moz-border-radius: 8px; border-radius: px; background: #C4FC02; margin: 0 0 1em 0; position: relative; } I'm trying to make a basic 'business card' website for a family friend and I want to add a custom dotted border (alternating colours) around the inside of my container, but I'm not sure of the best way to achieve what this without lots of extra markup. Image of Current look Image of Desired look Here's the actual site. http://www.thenewsite.com/thelolmaster/ I'm making a menu with buttons that have curved edges. I can make the edges and everything fine, but how can I make it so if I hover over the whole <li>, it changes the background of the 3 <span> tags underneath it? You'll understand when you see the demo. The menu I'm talking about is the orange bar. It won't work in IE, check it in Firefox, Safari, Opera, or Chrome. Try hovering over the menu items that aren't highlighted, and they don't light up. itsjareds.leadhoster.com/spogg/phoenix.html Sorry about the non-clickable link, user restrictions.. Post if you need any clarification (I know it's not clear). Is there any method for creating drop shadows for curved borders using only CSS? I have been looking at a css drop-shadow method at Phoenity but it makes drop shadows for rectangles. I am trying to achieve a look similar to this: but what I currently am getting is this: 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... Hi, Does anyone know of a way to do the effect of rounding corners (see attached image) in CSS? As you'll see in the image, I just want 1 pixel to be offset and be in a different colour for each corner of my box. What is the best way to make your element corners rounded with CSS? I'm kind of looking for a good tutorial. I have copied this tutorial, but my divs are not showing rounded, but still square. http://www.sitepoint.com/article/ro...-css-javascript Tut link Can anyone see what I've done wrong? I have attached a screenshot as the webpage is located on a protected server. The header is what I'm trying to make round. I have stroked it in black to show you My html: Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd"> <html> <head> <title>Test Rounded Div</title> <link href="styles.css" rel="stylesheet" type="text/css" /> </head> <body> <div class="container" align="center"> <div class="header"> <div> <!-- upper left corner--> <div> <!-- bottom right--> <div> <!-- bottom left --> Header </div> </div> </div> </div> <div id="left">Left</div> <div id="right">Right</div> <div id="footer">Footer</div> </div> </body> </html> My CSS: Code: div.header { width: 200px; background: #4095BF url(img/blue_top_rt.gif) no-repeat top right; } div.header div { background: transparent url(img/blue_top_left.gif) no-repeat top left; } div.header div div { background: transparent url(img/blue_bottom_rt.gif) no-repeat bottom right; } div.header div div div { background: transparent url(img/blue_bottom_lt.gif) no-repeat bottom left; padding: 15px; } Thanks for reading my question Here is the link to the two pages in question. http://www.pierced.ca/Kelly/cardsRound.htm http://www.pierced.ca/Kelly/indexRound.htm I know my images for the rounded corners aren't round, that's not the problem. My problem is the positioning of the images. When I view the pages using IE, the "Menu" images line up perfectly, and it's just the bl.jpg and br.jpg images on the "Info" section that don't. When I view the pages using FireFox, the bl.jpg and br.jpg images on the "Menu" section are off. Any words of wisdom to get both to work? Thanks again, Brad 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! Hello, I am in the making of my first css site. I made some rounded corners boxes in photoshop and saved them as gif. When I load them in the css code, the image shows up as i wanted in the box divs, but the issue is that the white box around the rounded corners are there and is very disturbing. Any tips on how to remove these white edges? Any answer is appreciated Hi: I'm told that forms cannot have rounded corners and that tables can. Question: How do you do it? One problem I've had so far with CSS, is that I haven't found a good way to display rounded corners or anything that would change the perfect rectangle of a div. Previously, using tables, I would just set up a 9x9 table with a repeating background on the top bottom and sides, then an image in each corner. That allowed me a lot of flexibility. Is there some sort of equivalent to this in CSS, or a way of getting around it? I'm looking for suggestions for CSS based rounded corners. I've seen a number of nice tutorials that show how to do solid corner, but I'm interested specifically in corners with borders. Simple Machines Forum has something he http://mods.simplemachines.org/ But I'm having trouble digging the details out of the style sheets. I can't seem to make it work for me. I'm really trying to avoid any JS. I'm having trouble getting the corners to line up when the parent DIV has a border. The corner images want to sit inside the border. I understand why this is, but not how to do it correctly for what I want. Think of a box with, say, a 2 pixel border and rounded corners... Just like the example I've provided above. Ideas? I am writing in hopes someone can help me figure out some problems I am having. All problems occur on the following page: http://cbo4edu.org/newSite/home.html PROBLEM #1 I cannot figure out why Column 3 is positioned outside the wrapper div. I need the solid black border to align with the other borders on the right-hand side. PROBLEM #2 As you can see I am having trouble getting the rounded corner divs to display correctly in the 3rd column. Why are the top-right corners displaying the top-left? Why is the top edge of the lower rounded corner div absent? And why is the bottom-left corner have a blue line under it? I used the method presented he http://kalsey.com/2003/07/rounded_corners_in_css/ PROBLEM #3 I need to add a border between Column 1 & 2 and a border between Column 2 & 3. I have tried adding a border attribute to the CSS file but that does not display anything. Any help on any of these problems are much appreciated. Hi I'm trying to match the overhead menu element of a Coppermine theme to a phpBB style. I've just run into a few problems and I was wonding if anyone could help please? Coppermine here - http://www.brummiesfans.com/coppermine phpBB3 here - http://www.brummiesfans.com/main/ Where I would like some help please is in getting the menu bar to have the same rounded corners as in phpBB3. What I have tried to do is to use the CSS from phpBB3, but on this occasion, it has not worked. The code is shown below. I don't have a problem in Firefox, Safari or Chrome, as there is code in place to sort the rounded corners out in CSS, however I need the missing piece put into place for IE, and this is where I need help. In phpBB3 the div classes are called "corners-top" and "corners-bottom". The relevant graphics files have also been copied across. (e.g. www.brummiesfans.com/coppermine/themes/brummies/images/corners_right.png) If someone can suggest how the matter can be fixed then I'd be very grateful. The relevant bits of the template.html and style.css file wordings follow, which hopefully will be of help. TEMPLATE.HTML Code: <div class="navbar"> <span class="corners-top"><span></span></span> <div id="main_menu"> {SYS_MENU} {SUB_MENU} {ADMIN_MENU} <!-- Begin IE7 support --><img src="images/spacer.gif" class="menuheight" alt="" /><!-- End IE7 support --> <div class="clearer"></div> <span class="corners-bottom"><span></span></span> </div> STYLE.CSS Code: .post span.corners-top, .post span.corners-bottom, .panel span.corners-top, .panel span.corners-bottom, .navbar span.corners-top, .navbar span.corners-bottom { margin: 0 -10px; } span.corners-top { background-image: url("images/corners_left.png"); } span.corners-top span { background-image: url("images/corners_right.png"); } span.corners-bottom { background-image: url("images/corners_left.png"); } span.corners-bottom span { background-image: url("images/corners_right.png"); } div.headerbar span.corners-top { background-image: url("images/corners_left2.png"); } div.headerbar span.corners-top span { background-image: url("images/corners_right2.png"); } span.corners-top, span.corners-bottom, span.corners-top span, span.corners-bottom span { font-size: 1px; line-height: 1px; display: block; height: 5px; background-repeat: no-repeat; } span.corners-top { background-image: none; background-position: 0 0; margin: 0 -5px; } span.corners-top span { background-image: none; background-position: 100% 0; } span.corners-bottom { background-image: none; background-position: 0 100%; margin: 0 -5px; clear: both; } span.corners-bottom span { background-image: none; background-position: 100% 100%; } .headbg span.corners-bottom { margin-bottom: -1px; } .post span.corners-top, .post span.corners-bottom, .panel span.corners-top, .panel span.corners-bottom, .navbar span.corners-top, .navbar span.corners-bottom { margin: 0 -10px; } .rules span.corners-top { margin: 0 -10px 5px -10px; } .rules span.corners-bottom { margin: 5px -10px 0 -10px; } Thanks in advance for any assistance. Martin |