CSS一边居左一边居右的代码?

{ margin:0; padding:0;} a{ width:910px; margin:20px auto;} l{ width:450px; border:1px solid #ccc; float:left; height:210px;} r{ width:450px; border:1px solid #ccc; float:right; height:210px;} .cf{ clear:both;} .f{ clear:both; height:90px; border:1px solid...
CSS一边居左一边居右的代码?
一个divfloat:left
另一个float:right
并设置每个的宽度,总宽度不超过最大宽度。如不懂,具体百度Hi。2010-01-15
我来回答你:把下面的代码复制到记事本中,保存,并保存为.html网页文件,打开就看到了!代码如下:

<!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>无标题文档</title>
<style type="text/css">
*{ margin:0; padding:0;}
#a{ width:910px; margin:20px auto;}
#l{ width:450px; border:1px solid #ccc; float:left; height:210px;}
#r{ width:450px; border:1px solid #ccc; float:right; height:210px;}
.cf{ clear:both;}
.f{ clear:both; height:90px; border:1px solid #ccc; margin-top:6px;}
.l{ width:400px; border:1px solid #ccc; float:left; height:210px; margin-top:6px;}
.r{ width:500px; border:1px solid #ccc; float:right; height:210px;margin-top:6px;}

</style>
</head>

<body>
<div id="a">
<h1>网站简单布局 兼容IE FF</h1>
<div id="l">左框</div>
<div id="r">右框</div><div class="cf"></div>
<div class="f"></div>
<div class="l"></div>
<div class="r"></div>
</div>

</body>
</html>

如果可以,请给我分!2010-01-15
mengvlog 阅读 7 次 更新于 2025-06-21 02:43:05 我来答关注问题0
  • 无标题文档 { margin:0; padding:0;} a{ width:910px; margin:20px auto;} l{ width:450px; border:1px solid #ccc; float:left; height:210p...

  • 是这样的,你把MORE这句写到“商信通”的前面的后面,然后给那个STYLE3的样式添一句 float:left就好了 代码如下:

  •  zm_nh 在一个表格中 两个字一个居左 一个居右,CSS怎样写

    .left{ float:left;} .right{ float:right;} 这样试了下也能做出你要的效果,参考下

  •  xssla <p>内的内容怎么设置一半居左和一半居右

    然后设置css样式 p{ text-align:right;} p span{ float:left;} 这样就可以了

  •  百度网友f3153a6 怎么让<li>标签里的两句话分别居左居右显示

    常用的方法是使用浮动。将中两句话分别设置样式并使用浮动。然后使用左,右浮动,这样就能左右显示了。给出页面代码: < span class="left"> 左边 右边 在css中写法 .left{float:left; width:50% ;} .right{float:right; width:50% ;} 这样就能使左边靠左,...

檬味博客在线解答立即免费咨询

CSS相关话题

Copyright © 2023 WWW.MENGVLOG.COM - 檬味博客
返回顶部