问答详情
源自:6-1 Float与流体布局

哪位大牛能帮忙看一下,为什么不能给one和two这两个加边框???一加边框就失效!!!

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>无标题文档</title>

<script type="text/javascript">


</script>


<style type="text/css">

*{margin:0;padding:0;}

body{

background-color:#ccffff;

padding-top:20px;

}

.main{

background-color:#fff;

width:700px;

margin:0 auto;

padding:20px;

}

.list{

border:1px solid red;

overflow:hidden;

}

.one{

width:100%;

float:left;

}

.one1{

border:1px solid blue;

margin-right:76px;

}

.two{

float:left;

width:56px;

margin-left:-56px;

}

</style>

</head>


<body>

<div class="main">

<div class="list">

<div class="one">

<div class="one1">

<p>一個人的晚餐!茶泡飯!飯、飯、飯… 今日不減肥,先把病治好再說! 我認真吃完這,燒就會退了吧?! 開動啦~~~~~~~~~~~~~~~~~~</p>

<img src="http://img.mukewang.com/53e2e9b10001948000890120.jpg" height="120">

</div>

</div>

<a href="http://t.sina.com.cn/xuruoxuan" class="two">

                <img title="徐若瑄VIVIAN" src="http://img.mukewang.com/53e2e9470001dfd200500050.jpg">

            </a>

</div>

</div>

</body>

</html>


提问者:qq_枫_ 2016-12-04 21:00

个回答

  • 慕粉4131441
    2016-12-05 08:32:47

    *{margin:0;padding:0;

    box-sizing: border-box;}

    加上这个试试