当前位置: 代码迷 >> Web前端 >> 带抉择的器的样式定义(一)
  详细解决方案

带抉择的器的样式定义(一)

热度:218   发布时间:2012-12-24 10:43:13.0
带选择的器的样式定义(一)

css中定义样式时也是可以分类别的,比如说input元素中,只定义type=button的样式

<style type="text/css">
input[type='button']
{
width:100px; height:100px;border:1px solid red;
}
</style>
<input type="button" value="click me" />
<input type="text" />

上述中只要按钮的样式定义成宽高100px,边框红色。

这种css定义就是根据属性起个过滤的作用。

比如说下述代码:

<style type="text/css">
.input[he='hi']
{
width:50px;
width:50px;
border:1px solid yellow;
}
</style>
<input type="text" he="hi" />
<input type="text" />
</style>

就是给属性he='hi'的input元素定义样式。

  相关解决方案