<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>自适应居中 - div-css.net</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <mce:style type="text/css"><!-- html,body,ul,li,dl,dd,dt{margin:0;padding:0;} .wrap { position:relative; width:100%;text-align:center;overflow:hidden;} .container {float:left; position:relative; left:50%;} .container p{position:relative;right:50%;float:left;margin:10px;display:inline;padding:10px;border:solid 1px #aaa;} .container span{ display:block;} --></mce:style><style type="text/css" mce_bogus="1">html,body,ul,li,dl,dd,dt{margin:0;padding:0;} .wrap { position:relative; width:100%;text-align:center;overflow:hidden;} .container {float:left; position:relative; left:50%;} .container p{position:relative;right:50%;float:left;margin:10px;display:inline;padding:10px;border:solid 1px #aaa;} .container span{ display:block;}</style> </head> <body> <div class="wrap"> <div class="container"> <p><span class="word">之前搜集过几个未知大</span></p> <p><span class="word">之前搜集过几个未知大</span></p> <p><span class="word">之前搜集过几个未知大</span></p> </div> </div> </body> </html> 更多关于前端技术文章请关注:http://www.xinran001.com/bbs/