Several things about CSS centering

高洛峰
Release: 2017-02-14 14:49:17
Original
1270 people have browsed it

Horizontal centering:

1: Center the inline element and center its parent block element!

2: The block element is centered, margin-left, margin-right: auto; and pay attention to the width! If the width is 100%, it cannot be seen. If the width is 100%, do you still need to center it?


Vertical centering:

One: Set padding

Two: height = line-height

Three: display :table-cell vertical-align will work.

Four: Positioning and centering Various layout positioning can be solved!

For more related articles about CSS centering, please pay attention to the PHP Chinese website!

Related labels:
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