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)

不言
Release: 2019-01-24 10:29:34
forward
5364 people have browsed it

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:

Copy after login
            
  •                          
                                                  
            
  •         
  •                          
                                                  
            
  •         
  •                          
                                                  
            
  •         
  •                          
                                                  
            
  •     
        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;
        }
Copy after login

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!

Related labels:
css
source:segmentfault.com
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