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

div centering problem_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 12:24:381173browse

div

abb218ce7a60a1d37f60e7be0a60e941
3108f3987dbdbaa185427ba2c49d537f11116b28748ea4df4d9c2150843fecfba68
;div style="float:left;" id="div33">22216b28748ea4df4d9c2150843fecfba68
16b28748ea4df4d9c2150843fecfba68

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;}
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;	}


Let’s see if this is the effect

Statement:
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