如何使用HTML布局web页面?(代码示例)


本文摘自PHP中文网,作者青灯夜游,侵删。

本篇文章给大家带来的内容是介绍如何使用HTML布局web页面?(代码示例)。有一定的参考价值,有需要的朋友可以参考一下,希望对你们有所帮助。

一, 效果图。

二,代码。

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

<!DOCTYPE html>

<html>

 

<head>

    <meta charset="utf-8">

    <title>html 列表</title>

</head>

 

<body>

    <!--使用div元素的网页布局-->

    <div id="container" style="width:500px">

        <div id="header" style="">>

            <h1 style="margin-bottom:0">main title o f web page</h1>

        </div>

        <div id="menu" style="height:200px;width:100px;float:left">

            <b>menu</b>

            <br> html

            <br> css

            <br> javascript

        </div>

        <div id="content" style="height:200px;width:400px;float:left">

            ontent goes here

        </div>

        <div id="footer" style="clear:both;text-align:center">

            Copyright ? W3CSchool.cc

        </div>

        <!--使用table元素的网页布局-->

        <table width="500" border="0">

            <tr>

                <td colspan="2" style="">>

                    <h1>main title of web page</h1>

                </td>

            </tr>

            <tr>

                <td style="width:100px">

                    <b>menu</b>

                    <br>html

                    <br>css

                    <br>javascript</td>

                <td style="height:200px;width:400px">

                    content goes here</td>

            </tr>

            <tr>

                <td colspan="2" style="text-align:center">

                    Copyright ? W3CSchool.cc</td>

            </tr>

        </table>

</body>

 

</html>


参考资料:《菜鸟教程》

以上就是如何使用HTML布局web页面?(代码示例)的详细内容,更多文章请关注木庄网络博客

相关阅读 >>

HtmlHtml5有什么区别

Html怎么打开一个新的网页

Html的<Html> 标签

Html和xml的区别分析

什么是Html属性

Html如何设置文字颜色白色

Html param标签怎么用?Html param标签属性实例详解

Html的元素如何设置焦点

单选框的type属性值为什么

Html dom是什么

更多相关阅读请进入《Html》频道 >>




打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...