尽量用CSS来描述修饰页面

在设计程序的时候,我们鼓励多用css,少用直接在html标签里指定属性的方法。
例如:
<input type="text" width="100" height="20" value=""/>
我们推荐多用style之类的来修饰,改成:
<input type="text" style="width:100px;height:20px" value=""/>
如果不是特殊个例的修饰,都可以写到一个css里面,例如:
css里:
.my_input{
    width:100px;
    height:20px;
}
然后页面引用:
<input type="text" class="my_input" value=""/>
编程慢慢养成习惯就好了,程序的分层慢慢就形成,这就是设计模式。

猜你喜欢

转载自blog.csdn.net/Cinway/article/details/51476418