CSS - Rounding Image Corners
ok guys so on my website i am designing a forum which contains images, the images need to be shown from other websites using the normal <img src=''> however i need the corners of all images to be rounded but ive been having a look and i can only find creating rounded shapes using css but not actually rounding the corners of images, is there any way of doing this?
Similar TutorialsGreetings, 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 I have created a simple menu using .css to create tabs. Are the tabs are currently rectangles. What I'm looking to do is round off the the upper right corner of the last tab. The .css currently does not call any image. I'm not opposed to adding an image to accomplish this....I just don't know how to do it. Any help would be greatly appreciated. Thanks! Stephen Here is how the current menu displays: http://www.rustbug.com/test/tab-play-page.html Here is the .css I am using: body { margin: 20px; padding: 0px; background: #fff; font: 13px Verdana, Arial, Helvetica, sans-serif;} pre {text-indent: 30px} #tabmenu { color: #0045ad; margin: 12px 0px 0px 0px; padding: 0px; z-index: 1; padding-left: 10px; } #tabmenu li { display: inline; overflow: hidden; list-style-type: none; } #tabmenu a, a.active { color: #0045ad; background-color:#F0F0F0; font: Verdana, Arial, Helvetica, sans-serif; border: 1px solid #ccc; padding: 5px 12px 2px 12px; margin: 0; text-decoration: none; } #tabmenu a.active { background: #fff; font-weight:bold; border-bottom: 3px solid #fff; } #tabmenu a:hover { color: #0045ad;} #tabmenu a:visited { color: #0045ad; } #tabmenu a.active:hover { background: #fff; color: #0045ad; } #content { font: 0.9em/1.3em "bitstream vera sans", verdana, sans-serif; text-align: justify; background: #fff; padding: 20px; margin-top:2px; border: 1px solid #ccc; z-index: 2;} #content a { text-decoration: none; color: #0045ad; } #content a:hover { background: #898B5E; } 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; } 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. 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 What is the best way to make your element corners rounded with CSS? I'm kind of looking for a good tutorial. I used this tutorial to create my rounded corner boxes. Now if I change the font in the content of the box to italics, IE goes bananas. I read about the "Holly Hack" by setting the height to 1%. I can't seem to get it work with these rounded corner boxes. I'm not sure what div to apply it to. Here is the relevant html for the boxes: Code: <div class="bluebox"> <div class="hd"><div class="c"></div></div> <div class="bd"> <div class="c"> <h4>Something</h4> <p>Content Goes Here</p> </div> </div> <div class="ft"><div class="c"></div></div> </div> And the css is this: Code: .bluebox { margin:0 auto 8px auto; color:#fff; } .bluebox .hd .c{ font-size:1px; height:16px; } .bluebox .ft .c{ font-size:1px; /* ensure minimum height */ height:18px; } .bluebox .hd { background:transparent url(images/tlb.gif) no-repeat 0px 0px; } .bluebox .hd .c { background:transparent url(images/trb.gif) no-repeat right 0px; } .bluebox .bd { background:transparent url(images/mlb.gif) repeat-y 0px 0px; } .bluebox .bd .c { background:transparent url(images/mrb.gif) repeat-y right 0px; } .bluebox .bd .c .s { background:#1caaec url(images/msb.jpg) repeat-x 0px 0px; } .bluebox .ft { background:transparent url(images/blb.gif) no-repeat 0px 0px; } .bluebox .ft .c { background:transparent url(images/brb.gif) no-repeat right 0px; } .bluebox h4 { font:0.9em Verdana, sans-serif; font-weight:bold; padding-left:5px; } .bluebox p { font:0.8em Verdana, arial, sans-serif; font-style:italic; padding:2px 10px 8px 5px; text-align:justify; color:#000000; } Any ideas where to stick the Holly Hack? 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 was looking for the best way to implement rounded corners for my website and its been difficult evaluating the different methods and deciding which way is the best way to go. So far the mountaintop method looks the most promising. The idea is to create a transpatent gif with the corners of the image as a white mountain shape. When you make this the background of the CSS div, the color of the background offsets and creates the image of rounded corners. I am having a small issue implementing that as well, for example, ive created two images one for the top and one for the bottom, but I am not quite sure how to implement it as you cannot specify two background images per CSS div. Anyone have any thoughts on this? Hi all, I would like to create a menu that has the following: current - top left rounded corner, top right rounded corner and background of the same colour (see the below image for example). These have to be in Validate CSS and without images I have found the following but it is not a Validate CSS and those not work in IE Any help please? Underneath please find the following: What I have found (not CSS Validate) Link for the webpage (work only in Firefox - rounded corners) Image (example) CSS (code) XHTML (code) Thanks in advance Ziffa27 1 Code: -moz-border-radius-topleft: 5px; -moz-border-radius-topright: 5px; 2 http://www.amaze.com.mt/menu/index.html 3 4 Code: html, body, header, menu, ul, li { margin: 0; padding: 0; } #header { background: #000000; height: 120px; } #menu { background: #000000; height: 40px; padding-left: 100px; } #menu ul { list-style: none; } #menu li { float: left; width: inherit; margin: 0 0.4em; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 10px; } #menu li a { color: #999999; display: block; padding: 15px 10px; text-decoration: none; } #menu li a:hover { color: #FFFFFF; } #menu ul li.current a { background-color: #FFFFFF; -moz-border-radius-topleft: 5px; /*work only in Firefox*/ -moz-border-radius-topright: 5px; /*work only in Firefox*/ color: #000000; } #menu ul li.current a:hover { color : #000000; } 5 Code: <html> <head> <title>Welcome to Amaze! - Menu</title> <style type="text/css" media="all">@import url(style.css);</style> </head> <body> <div id="header"> </div> <div id="menu"> <ul> <li><a href="#">Home</a></li> <li><a href="#">About Us</a></li> <li class="current"><a href="#">Services</a></li> <li><a href="#">Contact Us</a></li> </ul> </div> </body> </html> Hi: I'm told that forms cannot have rounded corners and that tables can. Question: How do you do it? Working to set up a template that has containers with rounded corners WITH outlines. I have the round corners and sides...just can figure out how to add the top and bottom line to complete the container. If I use a border-top it extends past the rounded corners. Any help would be greatly appreciated Link to the page in progress: http://www.rustbug.com/test/journey-home-page.html Here is my code: 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> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <style type="text/css"> body {color:#000000;background-color:#ffffff;background-attachment:fixed;font-family: Arial, Helvetica, sans-serif;line-height:1.25em;font-size:100%;} #wrapper {margin:0 auto;width:720px;background-color:#f6f5f3;padding-top:1em;padding-bottom:2em; overflow:hidden;} #container1 {float:left; display:inline; width:435px; height:auto; background-color:#FFF; border-top:1px #e3e2e1 solid; margin-left:1em; margin-bottom:1em;} #container2 {float:right; display:inline; width:235px; height:auto; background-color:#FFF; margin-right:1em;} p.roundcont { font-size:90%; margin:0 10px 0 10px; color: #999999;} .roundtop { background: url(images/tr.gif) no-repeat top right;} .middle { border-left:1px #e3e2e1 solid; border-right:1px #e3e2e1 solid;} .roundbottom { background: url(images/br.gif) no-repeat top right;} img.corner { width: 8px; height: 8px; border: none; display: block !important;} </style> </head> <body> <div id="wrapper"> <div id="container1"> <div class="roundtop"><img src="images/tl.gif" alt="" width="8" height="8" class="corner" style="display: none" /></div> <div class="middle"><p class="roundcont">Hello</p></div> <div class="roundbottom"><img src="images/bl.gif" alt=""width="8" height="8" class="corner" style="display: none" /></div> </div> <div id="container2"> <div class="roundtop"><img src="images/tl.gif" alt="" width="8" height="8" class="corner" style="display: none" /></div> <div class="middle"><p class="roundcont">aasdf s asdf sdf sfsdfsdf asdf sdf. afas sdf sfsdf. adf asdf sdf .asdfsdfsdgfga fasdf adfdaf asdf a.</p></div> <div class="roundbottom"><img src="images/bl.gif" alt=""width="8" height="8" class="corner" style="display: none" /></div> </div> <div id="container1"> <div class="roundtop"><img src="images/tl.gif" alt="" width="8" height="8" class="corner" style="display: none" /></div> <div class="middle"><p class="roundcont">Hello</p></div> <div class="roundbottom"><img src="images/bl.gif" alt=""width="8" height="8" class="corner" style="display: none" /></div> </div> </div> </body> </html> 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 Hi All, In one of my websites, I like to have boxes (rounded corners) like here, which is almost ok, except the rightside repeater is not repeating and not in the place. Do anybody know how to fix this? Any help would be appreciated. EDIT: Tried in different way, please have a look at it here 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. Hi i know there prolly loads around, iv been searching for ages but cant find one that will do the job. I want to create rounded corners in CSS but completely CSS no javascript no images etc. i found one called spiffy corners, it would have been perfect but it was only does complete box color, i only want borders, i wouldnt figure out how to change it to just borders Any one have any ideas? http://www.spiffycorners.com/ The page I'm working on and The css script as you can see, the inside of the corners are not rounded. How do I resolve this? 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. |