当前位置:懂科普 >

综合知识

> 布局设计怎么写代码 网页布局代码

布局设计怎么写代码 网页布局代码

1.网页布局代码

7个div就可以 例如:

布局设计怎么写代码 网页布局代码

<div style="width: 176px;"></div>

<div style="width: 176px;"></div>

<div style="width: 176px;"></div>

<div style="width: 490px;"></div>

<div style="width: 490px;"></div>

<div style="width: 490px;"></div>

<div style="width: 490px;"></div>

2.css div 母版页布局的代码怎么写

<html>

<head>

<style>

body{

margin:0px;

padding:0px;

text-align:center;

font-family:"宋体", "新宋体";

background-color:#ffffff;

}

#container{

width:800px;

height:auto;

position:relative;

text-align:left;

margin:0px auto;

padding:0px;

}

#top{

height:50px;

width:800px;

background-color:#090;

}

#middle{

margin-top:10px;

width:800px;

height:auto;

overflow:hidden;

}

#left{

margin:0px 0px 0px 10px;

background-color:#3F0;

width:250px;

float:left;

display:inline;

}

#right{

margin:0px 10px 0px 0px;

background-color:#30F;

width:400px;

float:right;

display:inline;

height:100px;

}

#bottom{

width:780px;

margin:10px 0px 0px 10px;

clear:both;

height:70px;

background-color:#0C0;

}

</style>

</head>

<body>

<div id="container">

<div id="top">

top

</div>

<div id="middle">

<div id="left">

left

</div>

<div id="right">

right

</div>

</div>

<div id="bottom">

bottom

</div>

</div>

<script type="text/javascript">

document.getElementById("right").style.height=document.getElementById("middle").scrollHeight+"px";

document.getElementById("left").style.height=document.getElementById("middle").scrollHeight-0+"px";

</script>

</body>

</html>

right 里面加内容的话 left会一起拉长 你可以加 br 测试

注意的是 right要固定高度

middle:height:auto;overflow:hidden; 要加上这2个

满意的话加分谢谢^^

3.电脑排行榜的布局用安卓怎么写代码

1、把手机屏幕分成上下。上下两部分都采用Linearlayout方式布局

2、下半部分LinearLayout高度固定,上半部分LinearyLayout设置layout_weight权重,占满剩余屏幕空间

3、下半部分LinearLayout中添加按钮,就是把按钮放到了底部

<LinearLayout>

<LinearLayout

android:layout_height="wrap_content"

android:llayout_weight="1">

//上半部分设置高度自适应,并且权重为1

</LinearyLayout>

<LinearLayout android:layout_height="50px">

<button andtoid:text="底部按钮"/>

</LinearyLayout>

</LinearLayout>

4.DIV+CSS两列布局如何写代码呢

html xmlns=headmeta ; charset=gb2312 /title两列固定宽度/titlestyle#left{background-color:#00cc33;border:1px solid #ff3399; width:250px;height:250px;float:left;}#right{background-color:#ffcc33;border:1px solid #ff3399; width:250px;height:250px;float:left;}/style/headbodydiv id=left左列/divdiv id=right右列/div/body/html。

标签: 代码 网页 布局
  • 文章版权属于文章作者所有,转载请注明 https://dongkepu.com/zonghezhishi/8edeev.html