我有一个包含多个元素的 Div,一些主题共享一些共同的属性,在我的例子中 input[type="submit"] input[type="text"]
share 边界:0;边距:0px;
使用此代码我无法将样式应用于两个输入标签。
知道我在这里做错了什么吗?谢谢
#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;
}
最佳答案
你需要一个逗号:
#cse-search-box input[type="submit"],
#cse-search-box input[type="text"]
{
/* ... */
}
关于html - 选择子元素 - 输入标签问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7321738/