views:

102

answers:

3

Hello everybody, I have this jquery for my menu buttons, what I want is to get top-corner rounded for my menu, this is a whole code:

    <html>
<style type="text/css">
#menuBarHolder { width: 860px; height:45px; background-color:#000; color:#fff; font-family:Arial; font-size:14px; margin-top:20px;}
#menuBarHolder ul{ list-style-type:none; display:block;}
.firstchild { border-left:1px solid #ccc;}
#container { margin-top:10px;}
#menuBar li{  float:left;  padding:15px; height:16px; width:70px; border-right:1px solid #ccc; }
#menuBar li a{color:#fff; text-decoration:none; letter-spacing:-1px; font-weight:bold;}
.menuHover { background-color:#999;}
.menuInfo { cursor:hand; background-color:#000; color:#fff; width:74px; font-size:11px;height:100px; padding:3px; display:none;  position:absolute; margin-left:-15px; margin-top:0px;
-moz-border-radius-bottomright: 5px; -moz-border-radius-bottomleft: 5px;
    -webkit-border-bottom-left-radius: 5px; -webkit-border-bottom-right-radius: 5px;
    -khtml-border-radius-bottomright: 5px;   -khtml-border-radius-bottomleft: 5px;
    border-radius-bottomright: 5px;border-radius-bottomleft: 5px;
}

</style>

<!--[if IE]>
<style type="text/css">
#menuBar li a{width:50px;}
.menuInfo { margin-left:-65px; width:80px;}
</style>

<![endif]-->

<script src="http://jqueryjs.googlecode.com/files/jquery-1.2.6.js"&gt;&lt;/script&gt;
<script type="text/javascript">

$(document).ready(function()
{

$('#menuBar li').click(function()
{
  var url = $(this).find('a').attr('href');
  document.location.href = url;

});

$('#menuBar li').hover(function()
{

   $(this).find('.menuInfo').slideDown();
},
function()
{

  $(this).find('.menuInfo').slideUp();

});

});
</script>
<center>
<div id="menuBarHolder">
<ul id="menuBar">
<li class="firstchild"><a href="javascript:#">Home</a><div class="menuInfo">I am some text about the home section</div></li>
<li><a href="javascript:#">About Us</a><div class="menuInfo">I am some text about the services section</div></li>
<li><a href="javascript:#">News</a><div class="menuInfo">I am some text about the clients section</div></li>
<li><a href="javascript:#">Equipment</a><div class="menuInfo">I am some text about the portfolio section</div></li>
<li><a href="javascript:#">Services</a><div class="menuInfo">I am some text about the about section</div></li>
<li><a href="javascript:#">Project</a><div class="menuInfo">I am some text about the blog section</div></li>
<li><a href="javascript:#">Contact Us</a><div class="menuInfo">I am some text about the follow section</div></li>
</ul>
</div>
</div>
</center>
</html>

Thanks for your help.

+2  A: 

The below code of CSS3 should do it:

Add below code inside within the body of the <head> tags:

<style type="text/css">
    -webkit-border-top-left-radius: 5px;
    -webkit-border-top-right-radius: 5px;
    -moz-border-radius-topleft: 5px;
    -moz-border-radius-topright: 5px;
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
</style>

But note that currently only modern browsers support the CSS3.

Note: For cross-browser solution, you can use the:

JQuery Curvy Corners Plugin

So if you really want curved corners, I would recommend you to go with JQuery Curvy Corners Plugin.

Great Resource:

Create your own corners here:

http://border-radius.com/

Sarfraz
and where should I exactly add these lines to my page ?
Sohail
@Sohail, the CSS either goes in the css stylesheet `#element_needing_rounded_corners {/* css3 stuff */}` or inside `<style>` tags in the `<head>` of the html page.
David Thomas
A: 

According to your CSS above you're only specifying that the bottom left and bottom right should be rounded.

If you want top left and top right rounded instead change:

-moz-border-radius-bottomright: 5px; 
-moz-border-radius-bottomleft: 5px;
-webkit-border-bottom-left-radius: 5px;
-webkit-border-bottom-right-radius: 5px;

To

-moz-border-radius-topright: 5px; 
-moz-border-radius-topleft: 5px;
-webkit-border-top-left-radius: 5px;
-webkit-border-top-right-radius: 5px;

If you want all four corners rounded just do:

-moz-border-radius: 5px;
-webkit-border-radius: 5px;
Michael Shimmins
A: 

try look at jquery UI , it got themes too,

if i want to make all my div content cornered i just do like this,

<div class="ui-wiget-content ui-corner-all">bla bla</div>

they've just have all the class setup.

you can examine their css file to know how their do it, but its not work for IE, huhuhu.

Nazmin
wondering when did IE will follow gecko base browser rendering...
Nazmin