Home > Web Front-end > HTML Tutorial > Introduction to css styles for html tags to be displayed in the center of the browser

Introduction to css styles for html tags to be displayed in the center of the browser

高洛峰
Release: 2017-03-04 15:18:44
Original
1401 people have browsed it

In order to meet certain needs during the layout process, it is a very common practice to center the html tag in the browser. There is a good example below. You can refer to it. css style:

The code is as follows:

<style type="text/css"> 
#login{ 
position:absolute; 
top:50%; 
left:50%; 
margin-left:-标签一半宽度; 
margin-top:-标签一半高度; 
} 
</style>
Copy after login


html part:

The code is as follows:

<p id="login"></p >
Copy after login

More html Please pay attention to the PHP Chinese website for related articles about the CSS style for displaying tags in the center of the 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