search
HomeWeb Front-endHTML TutorialCSS layout problem 100 points next page Is there any way to avoid writing repeated content such as navigation footer copyright information, etc._html/css_WEB-ITnose

刚开始学习css+xml   问一下有关布局问题

body {font-family: Arial, Helvetica, Verdana, Sans-serif;font-size: 15px;color:#666666;background:#FFDDAA;margin:0px;padding:0px;}.hidden {display: none;}#container {width:760px;background:#FFDDAA;margin:auto;}#main  {background:#FFCCCC;height:30px ;padding:15px 5px 0 0;}#main ul {list-style-type:none;margin:0;}#main ul li {float:right;margin:0 6px;}.sd {width:1.5px;height:17px;background:#FF00FF ;}#main ul li a:link {background:#FFB3FF;font-weight:bold; color:#CC6666}#main ul li a:visited {font-weight:bold;background:#B94FFF;}#main ul li a:hover {font-weight:bold;background:#BBFF00;}#header {background:#FFA488;height:150px;}#content {float:left;width:550px;background:#FFBB00;line-height:25px;}#content  h2{margin: 0;padding: 0;padding-bottom:10px;}#content  p {margin: 0;padding: 0;padding-bottom:15px;}#content  .padding {padding: 20px;}.aa { font-family:华文行楷;font-size:20px;color:#770077;font-weight:bold;text-decoration:none;}#side {float:right;width:205px;background:#FF7744;line-height:25px;}#side h2{color:#3399CC;margin: 0;text-align:center;}hr {margin:0;padding:0;}#side ul li a{margin: 0;padding: 0;padding-bottom:9px;}#side  .padding {padding: 20px;}#footer {clear:both;background:#D28EFF;font-family:??_GB2312;font-size:14px;color:#660077 ;height:66px;border-top: 1px solid #FF8888;padding: 13px 25px;line-height: 20px;text-align:center;}#footer a {color: #5555FF;text-decoration:inherit;}#footer a:hover {color: #770077;}h1 {margin: 0;padding: 0;}



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><meta name="aduhom" content=adu_hom@126.com> <title>css布局示例</title><link href="css/css.css" rel="stylesheet" type="text/css"> </head><body><div id="container"><div id="main"><ul><li><a href="http://blog.sina.com.cn/lovergoodbye" >关于我</a></li><li class="sd"></li><li><a href="http://blog.sina.com.cn/adudesigner" >留言本</a></li><li class="sd"></li><li><a href="http://blog.sina.com.cn/adudesigner" >CSS布局</a></li><li class="sd"></li><li><a href="http://blog.sina.com.cn/adudesigner" >WEB标准</a></li><li class="sd"></li><li><a href="http://blog.sina.com.cn/adudesigner" >我的博客</a></li><li class="sd"></li><li><a href="http://blog.sina.com.cn/adudesigner" >我的主页</a></li></ul></div><div id="header"><img src="/static/imghwm/default1.png"  data-src="imag/about.jpg"  class="lazy"   alt="我的个人主页"    style="max-width:90%"  style="max-width:90%"/></div><div id="content"><div class="padding"><h2><img src="/static/imghwm/default1.png"  data-src="imag/logo_enlighten.gif"  class="lazy"    alt="人生格言"    style="max-width:90%"  style="max-width:90%"/></h2><p><strong>"永远做你害怕的事,你应该每一两天做一些你不想做的事."</strong>这两句话,讲的都是同一个真理,它是人生进步的基础和上升的阶梯。容易走的都是下坡路,谁不想安安稳稳的走完人生,谁愿意累死活地跟自己过不去呢?可是,如果不这样,我们就不可能进步。让自己进步的方法很多,“每天做点困难的事”,“是逼”自己进步的办法。如果你是一位营销人员当众演讲是你最发怵的事情,那你就每天“逼”自己对着镜子练习讲话:如果你是一位公关人员,恰巧又是一个内向的人,那你就每天“逼”自己主动与主要的业务伙伴联系,或是打电话,或是相约见面。生存空间被无限压缩,每周工作时间被无限延伸,与此同时,有不少人被“剥夺”了工作的权利,被市场无情的淘汰。但那些每周工作时间不断延长的人们,却在愈加发奋的“提升”自我。我们固然希望工作时间越来越少、休息时间越来越多,然而,事实是无情的、残酷的、就像草原上的羚羊与狮子的生死角逐。记住,与其让别人淘汰自己,不如自己淘汰自己。</p><h2><img src="/static/imghwm/default1.png"  data-src="imag/logo_enlighten.gif"  class="lazy"   alt="我的联系方式"/></h2><p>姓名:杜修圣<br/>电话: 13426193533<br />传真: (07) 875 7547<br />Email: <a href="mailto:adu_hom@126.com" >adu_hom@126.com</a><br />职业: 网页设计师<br/>偶像:Lee_hom<br/>兴趣爱好:DIY网站,看球赛,看电影,听音乐<br/></p><p><a href="http://blog.sina.com.cn/lovergoodbye" class="aa">我的个人主页</a></p></div></div><div id="side"><hr><h2 id="文章分类">文章分类</h2><hr><ul><li><a href="#" >XHTML教程</a></li><li><a href="#" >CSS2.0教程</a></li><li><a href="#" >CSS布局</a></li><li><a href="#" >WEB标准</a></li><li><a href="#" >DIV+CSS教程</a></li><li><a href="#" >CSS布局实例</a></li><li><a href="#" >CSS酷站及模板</a></li></ul><hr><h2 id="资源链接">资源链接</h2><hr><ul><li><a href="#" >XHTML教程</a></li><li><a href="#" >CSS2.0教程</a></li><li><a href="#" >CSS布局</a></li><li><a href="#" >WEB标准</a></li><li><a href="#" >DIV+CSS教程</a></li><li><a href="#" >CSS布局实例</a></li></ul><hr><h2 id="站点导航">站点导航</h2><hr><ul><li><a href="#" >XHTML在线手册</a></li><li><a href="#" >CSS2.0在先手册</a></li><li><a href="#" >JavaScript在线手册</a></li><li><a href="#" >.net在线视频</a></li></ul></div><div id="footer"><a href="#" >About</a> - <a href="#" >Services</a> - <a href="#" >Portfolio</a> - <a href="#" >Contact Us</a> - <a href="#" >Terms of Trade</a><br/>幼稚园下的一片天空,本博版权归 <a href="#" >幼稚园卧底</a> 和<a href="#" >京城Designer</a>所有<br/>北京网通提供网络带宽</div></div></body></html></body></html>




我的问题是   在这种布局里面    我点一下链接   我只希望在主窗口content 中变化内容  其它的导航部分不变化  页眉  页脚 也不能变,   我打开下一页   还要把这些内容一起写入下一页里面,是不是有点太累了!!!!100分诚心求教 一下,谢谢


回复讨论(解决方案)

可以外部连接一个网页到此网页!和CSS文件类似

可以外部连接一个网页到此网页!和CSS文件类似

你可以在底部链接一个外部网页!和CSS文件类似

这是个经典问题。解决方案有如下几种(但不限于):
1、用iframe框架分割窗口,分别装载页头、页脚文件;
2、以include方式包含页头页脚文件;
3、以Ajax方式load页头页脚文件或代码;
4、以模板页或母板页方式设置页头页脚;

我的做法:
用不同的div完成不同的信息,用js更换div的内容即可.

我是新手能不能给些代码参考一下

nbsp;HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">



 
css布局示例
 







Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
What is the purpose of the <datalist> element?What is the purpose of the <datalist> element?Mar 21, 2025 pm 12:33 PM

The article discusses the HTML <datalist> element, which enhances forms by providing autocomplete suggestions, improving user experience and reducing errors.Character count: 159

What is the purpose of the <progress> element?What is the purpose of the <progress> element?Mar 21, 2025 pm 12:34 PM

The article discusses the HTML <progress> element, its purpose, styling, and differences from the <meter> element. The main focus is on using <progress> for task completion and <meter> for stati

What is the purpose of the <meter> element?What is the purpose of the <meter> element?Mar 21, 2025 pm 12:35 PM

The article discusses the HTML <meter> element, used for displaying scalar or fractional values within a range, and its common applications in web development. It differentiates <meter> from <progress> and ex

What is the viewport meta tag? Why is it important for responsive design?What is the viewport meta tag? Why is it important for responsive design?Mar 20, 2025 pm 05:56 PM

The article discusses the viewport meta tag, essential for responsive web design on mobile devices. It explains how proper use ensures optimal content scaling and user interaction, while misuse can lead to design and accessibility issues.

What is the purpose of the <iframe> tag? What are the security considerations when using it?What is the purpose of the <iframe> tag? What are the security considerations when using it?Mar 20, 2025 pm 06:05 PM

The article discusses the <iframe> tag's purpose in embedding external content into webpages, its common uses, security risks, and alternatives like object tags and APIs.

How do I use the HTML5 <time> element to represent dates and times semantically?How do I use the HTML5 <time> element to represent dates and times semantically?Mar 12, 2025 pm 04:05 PM

This article explains the HTML5 <time> element for semantic date/time representation. It emphasizes the importance of the datetime attribute for machine readability (ISO 8601 format) alongside human-readable text, boosting accessibilit

What are the best practices for cross-browser compatibility in HTML5?What are the best practices for cross-browser compatibility in HTML5?Mar 17, 2025 pm 12:20 PM

Article discusses best practices for ensuring HTML5 cross-browser compatibility, focusing on feature detection, progressive enhancement, and testing methods.

How do I use HTML5 form validation attributes to validate user input?How do I use HTML5 form validation attributes to validate user input?Mar 17, 2025 pm 12:27 PM

The article discusses using HTML5 form validation attributes like required, pattern, min, max, and length limits to validate user input directly in the browser.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools