Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating rounded corners in IE7 / IE8

I am creating a rounded corners tabs, that works fine in IE9, Mozilla and Chrome, but not in IE7/IE8.

Here is the code:

<div id="navbar">
<div id="holder">
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">About Us</a></li>
<li><a href="#">Contact Us</a></li>
<li><a href="#">News</a></li>
</ul>
</div>
</div>
#navbar {}
#holder {
border-bottom:1px solid #000;
overflow:hidden;
}

#navbar #holder ul {
margin:0;
padding:0;
list-style:none;
margin-top:15px;
}

#navbar #holder ul li { }
#navbar #holder ul li a {
text-decoration:none;
float:left;
margin-right:5px;
border:1px solid #000;
padding:15px;
text-align:center;
width:90px;
border-bottom:none;
display:block;
behavior:url(border-radius.htc);
border-radius:5px 5px 0 0;
}

#navbar #holder ul li a:hover {
background:#C09;
color:#fff;
}

Can you please let me know the code so that it works for IE7/IE8 as well?

like image 456
Balkar Kalsi Avatar asked Aug 04 '11 12:08

Balkar Kalsi


People also ask

How do you round the corners of an iframe?

The way to go is wrapping the iframe in a circular div as other users suggested. The only difference being that you have to add an additional style position:relative to the wrapper for it to work in Chrome browser. Show activity on this post. Wrapping the <iframe> in a <div> should work.


2 Answers

Use jquery corner , it will work on all major browser

http://jquery.malsup.com/corner/

You can even configure the corners the way you like!!

like image 199
Vijay Avatar answered Oct 23 '22 06:10

Vijay


IE 7/8 do not support border-radius. I hear IE9 does though.

This site contains a hack for getting rounded borders in IE7/8 though: http://dimox.net/cross-browser-border-radius-rounded-corners/ . You'll need to download border-radius.htc and put the following code in your CSS:

.rounded-corners {
  behavior: url(http://yoursite.com/border-radius.htc);
}
like image 40
tskuzzy Avatar answered Oct 23 '22 08:10

tskuzzy