html两栏布局怎么设置

html两栏布局怎么设置,第1张

可以用flex,float,table等方式实现。

flex设置方式相对比较简单,只要根据需要,对内部的两部分内容分开就可以了。

float设置方式要考虑左右两部分的内容,并且要记得清除浮动,以免影响显示。

table方式可以设置两边的内容都是单元格。

还有其他的实现方式,可以根据实际项目进行选择。

<html>

<body>

<table border="0" width="100%" cellpadding="10">

<tr>

<td width="50%" valign="top">

This is some text. This is some text. This is some text. This is some text. This is some

text.

</td>

<td width="50%" valign="top">

Another text. Another text. Another text. Another text. Another text. Another text. Another

text.

</td>

</tr>

</table>

<table border="0" width="100%" cellpadding="10">

<tr>

<td width="50%" valign="top">

This is some text. This is some text. This is some text. This is some text. This is some

text.

</td>

<td width="50%" valign="top">

Another text. Another text. Another text. Another text. Another text. Another text. Another

text.

</td>

</tr>

</table>

</body>

</html>


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/7333017.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-04-04
下一篇 2023-04-04

发表评论

登录后才能评论

评论列表(0条)

保存