qq408204462 2016-07-19 12:29 采纳率: 0%
浏览 2294

关于初学html中分块问题!

 <!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<style type="text/css">
<title>福建师范大学</title>
a:link {color:white;}   
a:visited {color:black;}    
a:hover {color:blue;}   
a:active {color:white;}
a.leftmargin {margin-left: 10cm}
a
{
float:center;
width:5em;
text-decoration:none;
color:white;
background-color:white;
border-right:1px solid white;
}
a:hover {background-color:white} /*点击时的背景颜色*/
p{
margin-left: 350px;
margin-top: 0px
white-space: nowrap
}
li {display:inline}
.main{
    width: 1050px;
    height: 800px;
    float:center;
    background-color: #ff3300;
}
.top {
    width: 1000px;
    height: 124px;
}
.top2{
    width:1000px;
    height: 34px;
    float:center;
        background-color: #FBB98C;
}
.left{
    width: 300px;
    height: 393px;
    float:left;
    background-color: #FBB98C;
}
.center{
    width: 490px;
    height: 400px;
    margin-left: 305px;
    background-color: #9BF460;
    float:center;
}
.right{
    width:205px;
    height:450px;
    margin-left: 800px;
    background-color: #90A4F7;
}

</style>
</head>
<body>
<div class="main">
<div class="top">

</div>

<div class="top2">
<ul>
<li><a href="#" target="_blank">English</a></li>
<li><a href="#" target="_blank">新闻资讯</a></li>
<li><a href="#" target="_blank">学校概况</a></li>
<li><a href="#" target="_blank">教育科学</a></li>
<li><a href="#" target="_blank">科学研究</a></li>
<li><a href="#" target="_blank">招生就业</a></li>
<li><a href="#" target="_blank">信息公开</a></li>
</ul>
<p>
站内搜索:<input type="text">
</p>
</div>

<div class="left">

</div>

<div class="center">

</div>

<div class="right">

</div>
</div>
</body>
</html>

这个里面我为什么最右边那块蓝色那块一直弄不上去呢!!跪求解答 T T

  • 写回答

1条回答 默认 最新

  • Go 旅城通票 2016-07-20 01:35
    关注

    加margin-left干嘛,也算宽度的,float没有center这个css属性值

          .left {
                width: 300px;
                height: 393px;
                float: left;
                background-color: #FBB98C;
            }
    
            .center {
                width: 490px;
                height: 400px;
                background-color: #9BF460;
                float: left;
            }
    
            .right {
                width: 205px;
                height: 450px;
                float:left;
                background-color: #90A4F7;
            }
    
    评论

报告相同问题?

悬赏问题

  • ¥15 安卓adb backup备份应用数据失败
  • ¥15 eclipse运行项目时遇到的问题
  • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
  • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
  • ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站
  • ¥50 成都蓉城足球俱乐部小程序抢票
  • ¥15 yolov7训练自己的数据集
  • ¥15 esp8266与51单片机连接问题(标签-单片机|关键词-串口)(相关搜索:51单片机|单片机|测试代码)
  • ¥15 电力市场出清matlab yalmip kkt 双层优化问题
  • ¥30 ros小车路径规划实现不了,如何解决?(操作系统-ubuntu)