When I was interviewed, I was asked: How to make a section of an uncertain -high text vertically in the middle?
Let's summarize now:Write the structure in the body
<div ID = main> <div ID = login> DJSHDK AWJDSD SEDE SFCDF VDJ SH DKAW JDS DSE DESF CDF VD JSH DKAWJD SDS EDS Ede SFCDFV JSH DKAWJD SDS Ede SFCDFV. </Div> </d> </d> </d> IV>Method 1:
#Main {Position: Relative; // Use relative positioning width: 200px; height: 200px; overflow: hidden; background-color: #ff0; padding:} #login {pOSI Tion: absolute; /* Use absolute positioning*/top: 50%;/*from 50%of the parent element high*/left: 50%; background-color: #eee; -50%); /*CSS3 style,: translateMethod two:
#Main {width: 200px; height: 200px; background-color: #eee; display: table; /*Let the label element be presented in the form of the table* /} #login {display: table-cell; 6 Can't recognize Display: Table-Cell;*/Vertical-Align: Middle;}
The above -mentioned method of illegal and highly high -level texts in DIV is the entire content that Xiaobian shared with you. I hope to give you a reference. I also hope that everyone will support VEVB Wulin.com.