Home >Web Front-end >CSS Tutorial >How to align form labels on both ends with CSS (code example)

How to align form labels on both ends with CSS (code example)

不言
不言forward
2019-01-24 10:29:345371browse

The content of this article is about how to achieve the alignment of both ends of the form label in CSS (code example). It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you.

Main attributes:

text-align: justify;

text-align-last: justify; Seehttps://www .html.cn/book/css/properties/text/text-align-last.htm

Final effect:

How to align form labels on both ends with CSS (code example)

Code:


            
  •                          
                                                  
            
  •         
  •                          
                                                  
            
  •         
  •                          
                                                  
            
  •         
  •                          
                                                  
            
  •     
        li {
            clear: both;
            list-style: none;
        }
    
        .mark {
            display: block;
            float: left;
            overflow: hidden;
            width: 78px;
            height: 29px;
            padding-right: 10px;
            text-align: justify;
            text-align-last: justify;
            line-height: 2;
        }

Note:

English characters and numbers will not be aligned

How to align form labels on both ends with CSS (code example)

The above is the detailed content of How to align form labels on both ends with CSS (code example). For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:segmentfault.com. If there is any infringement, please contact admin@php.cn delete