如何在2个垂直列中划分网页 [英] how to divide web page in 2 vertical columns

查看:63
本文介绍了如何在2个垂直列中划分网页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨我想将我的页面分成2个垂直列1n 80/20比率。我想使用2列的表,但有些人建议使用div标签而不是table标签,因为每个其他浏览器的表格渲染都不同。所以如何使用div标签来达到预期的效果。



我想进一步将页面分成不同的部分/ section.is可能使用div标签?如果有可能那么该怎么办? div标签的哪些属性将被使用?请帮助



谢谢你

anoop

hi i want to divide my page in 2 vertical columns 1n 80/20 ratio. i thought of using tables with 2 columns but some suggested to use div tag instead of table tag as rendering of table is different for every other browser. so how to use div tag to achieve desired effect.

further i want to divide page in to different section parts/section.is possible using div tags? if its possible then how to do it ? which attributes of div tag is to be used? please help

thank u
anoop

推荐答案

<div style="width:100%;"> <!-- Main Div -->
Header
<div style="float:left; width:20%;">
Left  <!-- Set Div As your requirement -->
</div>
<div style="float:left; width:80%; margin-left:10px;">
Right  <!-- Set Div As your requirement -->
</div>
<div>
Footer
</div>
</div>


you will need to modify above styles in stylesheet for all pages.


 <div style="width:100%;"> 
Header
<div style="float:left; width:20%;">
Left  Column
<br />
some text goes here
<br />
</div>
<div style="float:right; width:80%; ">
Right Column
<br /> 
some text
<br />
Goes here<br />
</div>

</div>/xml>


永远不要使用框架或表格页面布局,因为它们管理和排除故障很麻烦,加上它们就像数字世界中的机械弹簧钟。使用DIV代替足够明亮的人建议,它们更灵活,易于布局和排除故障。它们还有助于集中和简化你的布局不像旧学校的框架和桌子。



干杯
Don't ever ever ever use Frames or tables for page layout, as they are cumbersome to manage and troubleshoot plus they are like mechanical spring clock in the digital world. Use DIVs instead as someone bright enough has suggested, they are more flexible and easy to layout and troubleshoot. They also help centralise and streamline your layout unlike the old school frames and tables.

Cheers


这篇关于如何在2个垂直列中划分网页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆