相关疑难解决方法(0)

在'input'元素之前或之后生成CSS内容

在Firefox 3和Google Chrome 8.0中,以下工作正常:

<style type="text/css">
    span:before { content: 'span: '; }
</style>

<span>Test</span> <!-- produces: "span: Test" -->
Run Code Online (Sandbox Code Playgroud)

但是当元素是<input>:

<style type="text/css">
    input:before { content: 'input: '; }
</style>

<input type="text"></input> <!-- produces only the textbox; the generated content
                                 is nowhere to be seen in both FF3 and Chrome 8 -->
Run Code Online (Sandbox Code Playgroud)

为什么它不像我预期的那样工作?

html css

179
推荐指数
3
解决办法
19万
查看次数

标签 统计

css ×1

html ×1