HTML / CSS:将列表填充重置为默认值 [英] HTML / CSS : Reset List Padding to Default

查看:107
本文介绍了HTML / CSS:将列表填充重置为默认值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 * {margin:0; padding:0;} 这是第一次它打破了我的东西。 列表边栏和边距也为0,因此缩进会丢失。,我想将其重置为原始状态,这是怎么回事?



我试过这个没有成功:

  ul,ol {
margin:auto; / * This Works * /
padding:auto; / *这不是:( * /
}

/ p>

解决方案

复位点是为了消除浏览器默认值导致的变化。换句话说, 因为不同的浏览器可能有不同的默认值。



但是,你可以选择自己的默认值,我想这就是你在这里想做的。 >

一个好的方法是查看一个浏览器的默认样式表(你应该可以通过搜索找到如何做)。例如,你可以看到Firefox默认样式表,网址为:resource://gre/res/html.css


I'm using *{margin:0; padding:0;} and this is the first time that it breaks me in something. List paddings and margins are 0 too, so the indentation is lost. and I would like to reset them to their original state, how is this possible?

I've tried this with no success:

ul,ol{ 
   margin :auto; /* This Works */
   padding:auto; /* This Not :( */
}

So how should I fix this?

解决方案

The point of a reset is to eliminate variations due to browser defaults. In other words, there is no definitive way to "unreset" because different browsers may have different defaults.

However, you can choose your own default values, and I think that's what you're trying to do here.

A good way to do this is to look at a browser's default stylesheet (you should be able to find how to do this by doing a search). For example, you can see the Firefox default stylesheet with this URL: resource://gre/res/html.css

这篇关于HTML / CSS:将列表填充重置为默认值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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