Home > Web Front-end > HTML Tutorial > There is a ul tag and a span tag in a div tag. How to make the ul tag and span tag display on the same line? (The code and screenshots are as follows:)_html/css_WEB-ITnose

There is a ul tag and a span tag in a div tag. How to make the ul tag and span tag display on the same line? (The code and screenshots are as follows:)_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:55:16
Original
2481 people have browsed it

我的代码如下:



无标题文档


li{
float:left;
}
a{
  text-decoration:none;
 }

 


  


  • 1



  • 2



  • 3



  • 4



  • 5




  • abcdefg

     





    我的代码实现的效果图,在第二楼:


    回复讨论(解决方案)





      ul{float:left;margin-top:2px;}
    li{
    float:left;
    }
    a{
      text-decoration:none;
     }


      ul{float:left;margin-top:2px;}
    li{
    float:left;
    }
    a{
      text-decoration:none;
     }




    为什么要margin-top:2px?为啥非得是2像素?如果得到2像素的?




      ul{float:left;margin-top:2px;}
    li{
    float:left;
    }
    a{
      text-decoration:none;
     }




    为什么要margin-top:2px?为啥非得是2像素?如果得到2像素的?

    用来对齐的,不一定用2px

    用来对齐的,不一定用2px

    谢谢
    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 Recommendations
    Popular Tutorials
    More>
    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template