tags:

views:

507

answers:

6

Hi, at the top of my css file i say:

* {
border:none;
margin:0; 
padding:0;
}

but i want to have text input boxes to have a border so a few lines down i say:

input[type="text"] {
border-width:1px;
border-style:solid;
border-color: black;
}

No luck! Am I missing something about how CSS works? Doesn't the input declarations override the *?

+1  A: 

You need to specify a border-style as well. By default, it is none. You probably want solid:

input[type="text"] {
    border-width: 1px;
    border-color: black;
    border-style: solid;
}

Or shorthand:

input[type="text"] {
    border: 1px solid black;
}
strager
it does not work with the border-style added.
Ian McCullough
i have updated my question.
Ian McCullough
Your border: black; is overriding the other border definitions. Change border: to border-color.
strager
+1 Your proposal is even better than mine.
Gumbo
border-color does the same thing :(
Ian McCullough
+1  A: 

I think input[type="text"] is not supported by all browsers.

jeroen
That is true. IIRC It's a CSS3 selector.
strager
strange...shouldnt it work on firefox 3.5 then?
Ian McCullough
@strager: The attribute selector was introduced in CSS 2. See http://www.w3.org/TR/CSS2/selector.html#attribute-selectors
Gumbo
A: 

If it is IE6 you cannot do attribute selectors.

http://dev.l-c-n.com/CSS3-selectors/browser-support.php

ChaosPandion
A: 

The input="text" was not specified for my input elements

D'OH!

Ian McCullough
A: 

What if you give the input-tag a class, and refers that class in the CSS. And why do you have *{border: none;}? Is it because you don't wan't the borders to be shown around the images? Because then you could use the img{botder: none;} instead, and not have the problem...

Kim Andersen
A: 

i want to do [input type="text"] round help me