Home > Web Front-end > HTML Tutorial > CSS centering can be centered as the browser becomes larger or smaller_html/css_WEB-ITnose

CSS centering can be centered as the browser becomes larger or smaller_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:44:07
Original
1267 people have browsed it

Key code:

Use of external DIV: text-align:center;

Use of internal DIV: margin-left:auto;margin-right:auto

Example:

<div style="text-align: center">    <div style="margin-left: auto;margin-right: auto;">        <fieldset>            <legend>居中</legend>        </fieldset>    </div></div>
Copy after login

 

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