Home > Web Front-end > HTML Tutorial > Text positioning problem in css ul li_html/css_WEB-ITnose

Text positioning problem in css ul li_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:16:52
Original
1662 people have browsed it

I know a little bit about css...

Can you please help me how to set the positioning of text in ulli







The picture above is the style to be modified. The picture below is my own. Can you help me locate the position of the picture above?


Reply to the discussion (solution)

Set padding-left in li and set it, the width will be reduced by the amount

Isn’t the padding moved down as a whole?

You first go to see the box model

Padding is the inner spacing. It can be set up, down, left and right.
For example, padding: 1px 2px 3px 4px; corresponds to the top, right, bottom and left sides respectively. distance.
You can also set it individually through padding-left:1px; padding-top:2px; etc.


我试试看
Copy after login

If it is like the one in your picture If this is just to display text content, I would choose to add to li: text-indent:20px;

Oh, I don’t see the vertical or centered position, so add line-height:30px;, This value is generally set to the same height as li, and there will be no problem in each browser.

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