CSS ?? ?? ?? ?? ???
??: box-sizing ??? ???? ?? ???? ?? ??? ???? ?? ??? ??? ? ????. ?? ??, ??? ?? ?? ? ?? ??? ???? ?? ?? ?? ??? "border-box"? ???? ???. ??? ?? ????? ??? ??? ??? ??? ????? ???? ??? ??? ????.
??: ??box-sizing: content-box|border-box|inherit
??: content-box ?? CSS2.1?? ??? ?? ? ?? ?????. ??? ??? ??? ??? ??? ??? ?????. ??? ??? ?? ??? ??? ??? ???? ????. border-box ??? ??? ??? ??? ?? ??? ??? ??? ?????. ?, ??? ??? ??? ???? ??? ??? ?? ??? ?????. ???? ??? ??? ?? ??? ??? ???? ???? ??? ? ????. ??? ?? ?? ?? ??? ?? ?? ???? ????? ?? ?????.?
??: Internet Explorer, Opera ? Chrome? ?? ?? ??? ?????. Firefox? ?? -moz-box-sizing ??? ?????.
CSS ?? ?? ?? ?? ?
<!DOCTYPE html> <html> <head> <style> div.container { width:30em; border:1em solid; } div.box { box-sizing:border-box; -moz-box-sizing:border-box; /* Firefox */ -webkit-box-sizing:border-box; /* Safari */ width:50%; border:1em solid red; float:left; } </style> </head> <body> <div class="container"> <div class="box">這個(gè) div 占據(jù)左半部分。</div> <div class="box">這個(gè) div 占據(jù)右半部分。</div> </div> </body> </html>
??? ????? ??? "???? ??" ??? ?????