• 技术文章 >web前端 >html教程

    DIV+CSS实操一:经管系网页总体模块布局_html/css_WEB-ITnose

    2016-06-24 11:33:18原创430
    首先我们先来打开经管系网页,看看网页效果是怎么样的。通过所学Web前端开发的知识,我们一步一步模仿出

    标准的网页。我们知道DIV+CSS可以实现网页模块的总体布局,这基本取代了HTML中用table布局,DIV+CSS布局

    更加灵活,改写代码方便。

    经管系原网页截图:



    我先开始做网页的整体模块布局草图:


    下面开始编写代码:

    第一次HTML代码:

    经管系
    
    Dreamweaver8
    CSS样式表Style.css代码:

    /*第一次添加的代码*/* {    margin:0px; 	padding:0px;}body {    padding:0px; 	margin:0px; 	font-size:12px;}#top {	background-image: url(images/head.jpg);	background-repeat: no-repeat;	height: 120px;	width: 998px;	margin-right: auto;	margin-left: auto;}#nav {	background-image: url(images/n_nav_bg.gif);	background-repeat: repeat-x;	height: 37px;	width: 998px;	margin-right: auto;	margin-left: auto;}#adpic {	background-image: url(images/h4.jpg);	background-repeat: no-repeat;	height: 218px;	width: 998px;	margin-right: auto;	margin-left: auto;}#news {	height: 720px;	width: 998px;	margin-right: auto;	margin-left: auto;}#link {	background-image: url(images/n_title_bg.gif);	background-repeat: repeat-x;	height: 40px;	width: 998px;	margin-right: auto;	margin-left: auto;}#copyright {	background-color: #E2E2E2;	height: 80px;	width: 998px;	margin-top: 0px;	margin-right: auto;	margin-left: auto;	border-top-width: 5px;/*设置5像素的上边框*/	border-top-style: solid;	border-top-color: #006042;	margin-bottom: 0px;}#news #news_left {	float: left;	height: 720px;	width: 233px;	margin-right: 5px;}#news #news_mid {	float: left;	height: 720px;	width: 455px;	margin-right: 5px;}#news #news_right {	height: 720px;	width: 300px;	float: left;}#news #news_left #news_left_top {	height: 248px;	width: 233px;	background-color:#FF0000;}#news #news_left #news_left_mid {	height: 240px;	width: 233px;	background-color:#00FF00;}#news #news_left #news_left_bottom {	height: 232px;	width: 233px;	background-color:#0000FF;}#news #news_mid #news_mid_top {	height: 488px;	width: 455px;	background-color:#000000;}#news #news_mid #news_mid_bottom {	height: 232px;	width: 455px;	background-color:#999999;}#news #news_right #news_right_top {	height: 248px;	width: 300px;	background-color:#FFFF00;}#news #news_right #news_right_mid {	height: 240px;	width: 300px;	background-color:#00FFFF;}#news #news_right #news_right_bottom {	height: 232px;	width: 300px;	background-color:#FF00FF;}
    浏览器运行的结果为:




    版权声明:本文为博主原创文章,未经博主允许不得转载。

    声明:本文原创发布php中文网,转载请注明出处,感谢您的尊重!如有疑问,请联系admin@php.cn处理
    上一篇:在Word指定位置插入富文本域值(html文本)_html/css_WEB-ITnose 下一篇:CSS基础学习十三:盒子模型_html/css_WEB-ITnose
    大前端线上培训班

    相关文章推荐

    • html5如何播放视频• html和html5有什么区别• html怎么设置元素不可见• html +CSS+div学习――第二课_html/css_WEB-ITnose• HTML meta refresh 刷新与跳转(重定向)页面_html/css_WEB-ITnose

    全部评论我要评论

  • 取消发布评论发送
  • 1/1

    PHP中文网