调整列表样式图像位置? [英] Adjust list style image position?

查看:122
本文介绍了调整列表样式图像位置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法调整列表样式图像的位置?



当我对列表项使用填充时,图像将保持在其位置, t与padding ...

解决方案

不是真的。



使用 的组合,可以在列表项中应用此填充。背景填充 样式可以创建类似于

的东西。

  li {
background:url(images / bullet.gif)no-repeat left top;
padding:3px 0px 3px 10px;
/ *重置样式(可选):* /
list-style:none;
margin:0;
}

您可能希望将样式添加到父列表容器请定位您的项目符号列表项,此A List Apart文章具有良好的开始参考。 p>

Is there a way to adjust the position of list-style-image?

When I use padding for list items the image will stay at its position and won't move with padding...

解决方案

Not really. Your padding is (probably) being applied to the list item, so will only affect the actual content within the list item.

Using a combination of background and padding styles can create something that looks similar e.g.

li {
  background: url(images/bullet.gif) no-repeat left top;
  padding: 3px 0px 3px 10px;
  /* reset styles (optional): */
  list-style: none;
  margin: 0;
}

You might be looking to add styling to the parent list container (ul) to position your bulleted list items, this A List Apart article has a good starting reference.

这篇关于调整列表样式图像位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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