2013-05-17 53 views
0

我有以下的CSS和HTML。除了字体粗体外,所有样式都应用。以这种方式可以设置输入风格吗?风格输入字体粗体?

<span> 
    <input type="submit"> 
</span> 

span input { 
    background: none; 
    border: none; 
    font-weight: bold; 
    text-decoration: underline; 
} 
+0

为什么不试试呢? – mash

+1

[不知道你有什么问题,它看起来很大胆](http://jsfiddle.net/7n7Re/)。 – zzzzBov

+1

适合我的作品,你确定没有其他风格重写吗? – Jerryf

回答

0

这是应该工作的样式代码。因为它是封闭在<style>标签

<head> 
<style type="text/css"> 
.inputClass{ 
font-weight: bold; 
} 
</style> 
</head> 

<body> 
<form method="post.php" action="POST"> 
<input id="input" class="inputClass"> 
</form> 
</body> 

这会工作,而不是原来的代码。

让我知道这是否适用于您或您正在寻找的解决方案。

+0

字体重量后缺少括号。 – Jerryf

+0

谢谢@Jerryf,编辑。 –

+0

这应该只是一个原始的代码应该工作。这个问题不会对未来的访问者有所帮助,除非会澄清阻止原始代码运行的原因,例如没有披露的样式表。 –