Select Child Elements - Input Tags Problems
I have a Div with inside several elemen开发者_StackOverflowts, some of theme share some common attributes, in my case input[type="submit"] input[type="text"]
share border: 0; margin: 0px;
With this code I'm not able to apply the Style to both Input Tags.
Any idea what I'm doing wrong here? Thanks
#cse-search-box input[type="submit"] input[type="text"] /*Problem here*/
{
border: 0;
margin: 0px;
}
#cse-search-box input[type="text"]
{
position:relative;
top:-6px;
height: 28px;
padding: 0px !important;
}
#cse-search-box input[type="submit"]
{
cursor: pointer;
background-color: Red;
font-weight: bold;
height: 30px;
}
You need a comma:
#cse-search-box input[type="submit"],
#cse-search-box input[type="text"]
{
/* ... */
}
With your version, you were selecting an input
inside an input
.
To fix, you need to separate them with a comma and make sure they both follow the same selector path:
#cse-search-box input[type="submit"], #cse-search-box input[type="text"]
精彩评论