How to Indent Multiple-Line Label Text on Forms with Limited Width?

DDD
Release: 2024-10-24 07:21:02
Original
386 people have browsed it

How to Indent Multiple-Line Label Text on Forms with Limited Width?

Indent Label Text on Multiple Lines for Limited-Width Forms

In a form with limited width, while longer label text may wrap onto multiple lines, only the first line is often indented due to the associated input element. This can result in an unorganized appearance.

To address this issue and indent all lines consistently, you can employ CSS:



.checkbox-field {</p>
<div class="code" style="position:relative; padding:0px; margin:0px;"><pre class="brush:php;toolbar:false">display: flex;
flex-direction: row;
Copy after login

}

<div class="checkbox-field"></p>
<div class="code" style="position:relative; padding:0px; margin:0px;"><pre class="brush:php;toolbar:false"><input type="checkbox" id="check">
<label for="check">Field 2 Label, may be longer than normal, This is an example for this lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem</label>
Copy after login



The CSS code:

The HTML code:

With these adjustments, the label text will wrap and indent consistently, resulting in a visually organized form.

The above is the detailed content of How to Indent Multiple-Line Label Text on Forms with Limited Width?. For more information, please follow other related articles on the PHP Chinese website!

source:php
Previous article:Can JavaScript Access Values of Invalid CSS Properties? Next article:How to Indent Wrapped Label Text in CSS for Forms with Limited Width?
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
Latest Articles by Author
Latest Issues
Related Topics
More>
Popular Recommendations
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!