如何?浮動與兩側皆自適應的流體布局

來源:互聯網
上載者:User

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>浮動與兩側皆自適應的流體布局</title>
<head>
<style>
body{font-size:14px;background:#6CF;}
a{color:#0082CB;text-decoration:none;}
p{margin:0;}img{border:1px #999 solid;border-radius:10px;}<!--邊框弧度-->
.body{width:200px;margin-left:auto;margin-right:auto;}
.mib_x{margin-bottom:10px;background-color:#CCC;}
.list{padding:10px;}<!--兩個框中內邊距-->
.body1{overflow:auto;resize:both;}<!--表示允許使用者調整大小-->
.mib_vip { display: inline-block; width: 11px; height: 10px; margin-left: 1px; background: url(data:image/gif;base64,R0lGODlhCwAKAJEDAPyZCveDBuJmBP///yH5BAEAAAMALAAAAAALAAoAAAIdhD1zopgTXgMpsBdylVCPK2UCKI0j95hoRa0NVwAAOw==); }
.mib_head_a{float:left;margin-right:20px;}
<!--下面是固定式配置寫法-->
.letter { display: table-cell; *display: inline-block; width: 2000px; *width: auto; }
.mib_sms{line-height:22px;padding-bottom:6px;font-size:14px;}<!--字型-->
.mib_select{width:80px;padding:5px;font-size:100%}
</style>
</head>
<body>
<p class="body">
<p class="body1 mib_x">
<p class="list">
<a href="http://t.sina.com.cn/xuruoxuan" class="mib_head_a">
<img id="mibHeadImg" title="徐若瑄VIVIAM" src="http://img.mukewang.com/53e2e9470001dfd200500050.jpg" >
</a>
<p class="letter">
<p class="mib_sms"><a title="徐若瑄VIVIAN" href="http://t.sina.com.cn/xuruoxuan">徐若瑄VIVIAN<i title="新浪認證" class="mib_vip"></i></a>
:一個人的晚餐!茶泡飯!飯、飯、飯… 今日不減肥,先把病治好再說! 我認真吃完這,燒就會退了吧?! 開動啦~</p>
<p class="picture2">
<img src="http://img.mukewang.com/53e2e9b10001948000890120.jpg" height="120">
</p>
</p>
</p>
</p>
<!--底部列表-->
<p class="mib_x">
<p class="list">
<p class="mib_sms">選擇頭像寬度:<select id="minselect" class="mib_select">
<option value="56px">56px</option>
<option value="70px">70px</option>
<option value="84px">84px</option>
</select></p>
</p>
</p>
</p>
<script>
var Select=document.getElementById("minselect"),headimg=document.getElementById("mibHeadImg");
if(Select&&headimg){
Select.onchange=function(){
headimg.style.width=this.value;
};
}
</script>
</body>
</html>


還有點小問題,寬度沒調好。。。

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.