为什么不使用星号重置CSS? [英] Why not reset CSS using the asterisk?

查看:108
本文介绍了为什么不使用星号重置CSS?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


可能重复:

(为什么)是CSS星型选择器被认为有害吗?

我注意到许多CSS开发人员通过在开始时明确声明它们(例如Yahoo和meyerweb版本)来重置大量HTML元素的边距,字体和填充。所以我问自己,为什么不使用*全局简单重置?我知道这打破了一些元素,如按钮和块引用的布局,但那些可以很容易地重新设置,这是一个必须如果你真的想重置布局,因为按钮在所有浏览器中有不同的外观。

I noticed that many CSS developers reset the margin, font and padding of a big number of HTML elements by explicitly declaring them all in the beginning (e.g.Yahoo and meyerweb versions). So I ask myself, why not simple reset globally using the *? I know that this break the layout for some elements like buttons and blockquotes but those can easily be restyled, which is a must if you really want to reset the layout because buttons have different looks in all browsers.

推荐答案

我认为你刚才回答自己 - 这不是简单的重新设置按钮和表单控件,因为所有用户代理都有非常具体的样式迎合他们。

I think you just answered yourself - it's not simple restyling buttons and form controls because all user agents have very specific styling catering toward them.

这篇关于为什么不使用星号重置CSS?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆