Home > Web Front-end > CSS Tutorial > How to Align Wrapped Bullet Points with Their First Line in CSS?

How to Align Wrapped Bullet Points with Their First Line in CSS?

Susan Sarandon
Release: 2024-12-05 03:31:10
Original
934 people have browsed it

How to Align Wrapped Bullet Points with Their First Line in CSS?

How to Align Wrapped Bullet Item Lines with First Line

When creating bulleted lists, it's often desirable to have wrapped line items align with the first line. Instead of wrapping underneath the bullet, the wrapped portion should continue at the right of the bullet.

CSS and HTML Implementation:

To achieve this alignment, enclose the bullet in a separate div element and wrap both divs inside a container div.

.row2 {
    padding-left: 20px;
    overflow: hidden;
    max-width: 500px;
}
.red-square-5 {
    position: absolute;
    width: 5px;
    height: 5px;
    margin-top: 0.5em;
    background: #f00;
}

<div>
Copy after login

With this approach, the bullet position remains absolute, while the bullet item text wraps to the right of the bullet.

The above is the detailed content of How to Align Wrapped Bullet Points with Their First Line in CSS?. For more information, please follow other related articles on the PHP Chinese website!

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