How can I center the text vertically on a label button? _html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:54:10
Original
1852 people have browsed it

  • Add


  • padding-top is because if not, the button There is a point below the icon that will be intercepted.

    But why does the a tag have padding-top but the text inside has not changed?
    As shown in the picture, how can I center the text in the button vertically?

    Image address: http://ccnna.img42.wal8.com/img42/501254_20141114101150/141593117443.jpg


    Reply Discussion (Solution)

    Use line-height, not padding-top

  • Add
  • Add

  • Use line-height, not padding-top

  • Add

  • Add



  • if If you use line-height, the text is fine, but part of the icon is cut off, as shown in the figure


    Use line-height, don't use padding-top
    < ;li class="click"> Add


  • < span> Add



  • If you use line-height, the text is fine, but part of the icon is truncated. As shown in the figure
    Set height and fixed height combined with line-height to vertically center the text
    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