Home > Web Front-end > HTML Tutorial > div centering problem_html/css_WEB-ITnose

div centering problem_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:24:38
Original
1201 people have browsed it

div


111

;div style="float:left;" id="div33">222



How to make div33 Chinese text centered horizontally on div11, fixed cannot be used Width, can you only use css style to center?

Note that it should be centered on div11, not horizontally centered within div33

Reply to the discussion (solution)

1111111111111111

Yes,

.button_all {	text-align: center;}
Copy after login
Reference: http://www.cnblogs.com/bisonjob/archive/2008/01/17/1042328.html

Just use it without fixed width Percentage

#div11
{
vertical-align:middle;
}

Since you want to be centered, why float

	#div11{	  width:100%;	  background-color:blue;	}	#div33{	  width:100%;	  text-align: center;	  background-color:yellow;	}
Copy after login


Let’s see if this is the effect

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