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 -moz-border-radius-topleft: 5px; -moz-border-radius-topright: 5px; Code (markup): 2 http://www.amaze.com.mt/menu/index.html 3 4 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; } Code (markup): 5 <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> HTML:
border radius will not work on non-mozilla browser. If you don't want to use image for rounded corner, then most likely the solution is using javascript to handle that. I've heard about CurvyCorners Script, but i never try it.
Though the validator flags the vendor extensions as invalid (-moz -webkit etc.) they ARE valid markup and defined by the W3C spec so you can feel free to use them. Webkit has rounded corners now but I don't recall if Opera does. Forget IE. It could take another 3 years or more.
For smooth rounded corners, using image or script. The script uses anti-aliased technology, which blends the edges colors look smooth.
Non-image css rounded corners that works in all browsers? Gotcha covered. http://battletech.hopto.org/html_tutorials/rounded_css_borders/ Though really - just suck it up and use an image... given the simplicity that's one markup hook and one image via sliding doors... even with hover/current states that's one simple image. BTW, I'm seeing little to no good reason for that wrapping DIV.
Hi Unigogo / Deathshadow Unigogo - I want them to be CSS Validate so script it is not good Deathshadow - Erik J already show me that code in sitepoint.com Thanks to all