多个<li>左浮动以后出现的问题,求高手_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:03:30
Original
1161 people have browsed it


父div下有6个

  • ,所有的
  • 都是统一的css,因为要
  • 的间隔,所以margin-left 了几个像素,但是箭头所指的地方也会有间隔
    如果父div有边框,还好看一些。但是如果父div是空白的,那么左侧的
  • 就不靠边,显得难看。请问怎么解决

    不想单独定义li的class,这样程序调用不方便
    求助


    回复讨论(解决方案)

    li1    li2   li3
    li4    li5   li6

    1,2,3,4,5,6 有class a
    1,4 有class b

    .a{    margin-left:5px;}.b{    margin-left:0px;}
    Copy after login

    li 的 父ul 定义个

    margin-left:-你的px值
    Copy after login
    Copy after login


    记得 ul clearfix

    li 的 父ul 定义个

    margin-left:-你的px值
    Copy after login
    Copy after login


    记得 ul clearfix



    谢谢,忘了ul的作用了,不过ul clearfix 这个以前没写过,我再看一下。

    虽然我已经不再迁就ie6了。但是还想问一下ul{margin-left:-6px;} ie6是不是不支持负值,怎么去支持ie6

  • 的margin-left 设为0px; 
      的margin-left 或者pading0left 设为你想要设的值不就行了么!

    • 的margin-left 设为0px; 
        的margin-left 或者pading0left 设为你想要设的值不就行了么!
        哪li之间的间隔往哪儿找去
  • Related labels:
    source:php.cn
    Statement of this Website
    The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
    Popular Tutorials
    More>
    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!