Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rounded corners for <input type='text' /> using border-radius.htc for IE

I want to create an input fields with rounded corners.

HTML:

<div id="RightColumn"> <input type="text" class="inputForm" /> </div> 

CSS:

.inputForm {     -moz-border-radius:10px; /* Firefox */     -webkit-border-radius: 10px; /* Safari, Chrome */     -khtml-border-radius: 10px; /* KHTML */     border-radius: 10px; /* CSS3 */     behavior:url("border-radius.htc"); }  #RightColumn {     background-color:White; } 

But IE doesn't show any borders for input fields - neighter rounded nor simple borders. When I remove CSS-style for #RightColumn, IE shows an input fields with rounded corners. But I need background for #RightColumn.

How can I create it?

like image 823
Sir Hally Avatar asked Jul 18 '10 09:07

Sir Hally


People also ask

Which CSS property is used to add rounded corners to the border of an element?

The border-radius CSS property rounds the corners of an element's outer border edge. You can set a single radius to make circular corners, or two radii to make elliptical corners.


1 Answers

Oh lord, don't do it this way. HTC files are never a good idea for performance and clarity reasons, and you're using too many vendor-specific parameters for something that can easily be done cross-browser all the way back to IE6.

Apply a background image to your input field with the rounded corners and make the field's background colour transparent with border:none applied instead.

like image 142
hollsk Avatar answered Sep 27 '22 21:09

hollsk