我试图使用不同字体和透明背景的自定义文本框(输入),我发现了两篇关于如何编辑输入字体系列和使背景透明的文章。带有输入标签的自定义文本框
Is background-color:none valid CSS? Why doesn't <input> inherit the font from body?
但我想
HTML:
<div id='test' class='menuInput' style='background-color:blue;' onClick='alert("Test");'><input type="text"></div>
CSS:
input,.menuInput{
margin-top:10px;
text-align:center;
font-size:35px;
margin:0px auto;
font-family:FixedSys;
padding-bottom:6px;
height:35px;
border:2px solid black;
width:400px;
background-color:transparent;
color:white;
margin-bottom:15px;
}
但它不工作?背景颜色仍然是白色的,字体家族也没有改变
编辑:感谢您的答案,但它仍然不工作?我试过
.menuInput input[type="text"]{
margin-top:10px;
text-align:center;
font-size:35px;
margin:0px auto;
font-family:FixedSys;
padding-bottom:6px;
height:35px;
border:2px solid black;
width:400px;
background-color:green;
color:white;
margin-bottom:15px;
}
而且它还没有工作?
我敢肯定我有那种字体,因为我用它来做别的事情!
不能重复发布该代码。 –
?你什么意思? –
使用发布的HTML进行测试,并且发布的任一CSS片段都不会*重现文中描述的问题。发布者自己的评论作为答案表明,该问题不包含用于实际再现问题的足够信息。 –