两个div并排的实现代码 div并排

两个div并排的实现代码 div并排

两个div并排的实现代码,一般在使用过程中,最好外面再包括一个用来定位居中显示。这里主要是了解下css的左右浮动布局给开始学习css的朋友。

关键词:

<!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> <meta http-equiv=”Content-Type” content=”text/html; charset=gb2312″ /> <title>css两个div并排</title> <style type=”text/css”> <!– .onediv{width:90px; height:50px;float:left;margin:0 0 0 5px; border:1px #000 solid; background:#FF0000} .twodiv{width:90px; height:50px;float:left;margin:0 0 0 5px; border:1px #000 solid; background:#99CC00} –> </style> </head> <body><div class=”onediv”>左</div><div class=”twodiv”>右</div> </body> </html>

提示:您可以先修改部分代码再运行

两个div并排的实现代码 div并排

相关文章:

你感兴趣的文章:

标签云: