htmlcss网页设计实例?html模板下载
很多朋友对于htmlcss网页设计实例和html模板下载不太懂,今天就由小编来为大家分享,希望可以帮助到大家,下面一起来看看吧!
求一个html或者css、js的网页设计作业
<!DOCTYPE HTML>
<!-- saved from url=(0014)about:internet-->
<html lang="en-US">
<style type="text/css">
<!--
*{margin:0;padding:0;border:0;}
body{
font-family: arial,宋体, serif;
font-size:12px;
}
#nav{
width:180px;
line-height: 24px;
list-style-type: none;
text-align:left;
/*定义整个ul菜单的行高和背景色*/
}
/*==================一级目录===================*/
#nav a{
width: 160px;
display: block;
padding-left:20px;
/*Width(一定要),否则下面的Li会变形*/
}
#nav li{
background:#CCC;/*一级目录的背景色*/
border-bottom:#FFF 1px solid;/*下面的一条白边*/
float:left;
/*float:left,本不应该设置,但由于在Firefox不能正常显示
继承Nav的width,限制宽度,li自动向下延伸*/
}
#nav li a:hover{
background:#CC0000;/*一级目录onMouseOver显示的背景色*/
}
#nav a:link{
color:#666; text-decoration:none;
}
#nav a:visited{
color:#666;text-decoration:none;
}
#nav a:hover{
color:#FFF;text-decoration:none;font-weight:bold;
}
/*==================二级目录===================*/
#nav li ul{
list-style:none;
text-align:left;
}
#nav li ul li{
background:#EBEBEB;/*二级目录的背景色*/
}
#nav li ul a{
padding-left:20px;
width:160px;
/* padding-left二级目录中文字向右移动,但Width必须重新设置=(总宽度-padding-left)*/
}
/*下面是二级目录的链接样式*/
#nav li ul a:link{
color:#666; text-decoration:none;
}
#nav li ul a:visited{
color:#666;text-decoration:none;
}
#nav li ul a:hover{
color:#F3F3F3;
text-decoration:none;
font-weight:normal;
background:#CC0000;
/*二级onmouseover的字体颜色、背景色*/
}
/*==============================*/
#nav li:hover ul{
left: auto;
}
#nav li.sfhover ul{
left: auto;
}
#content{
clear: left;
}
#nav ul.collapsed{
display: none;
}
-->
#PARENT{
width:300px;
padding-left:20px;
}
</style>
<div id="PARENT">
<ul id="nav">
<li><a rel="external nofollow" href="#Menu=ChildMenu1" onclick="DoMenu('ChildMenu1')">我的网站</a>
<ul id="ChildMenu1" class="collapsed">
<li><a rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" href="#">网页教学网</a></li>
<li><a rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" href="#">管理</a></li>
<li><a rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" href="#">网页教学网</a></li>
<li><a rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" href="#">管理</a></li>
<li><a rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" href="#">网页教学网</a></li>
<li><a rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" href="#">管理</a></li>
</ul>
</li>
<li><a rel="external nofollow" href="#Menu=ChildMenu2" onClick="DoMenu('ChildMenu2')">我的帐务</a>
<ul id="ChildMenu2" class="collapsed">
<a rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" href="#">支付</a></li>
<li><a rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" href="#">管理</a></li>
<li><a rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" href="#">网上支付</a></li>
<li><a rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" href="#">登记汇款</a></li>
<li><a rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" href="#">在线招领</a></li>
<li><a rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" href="#">历史帐务</a></li>
</ul>
</li>
<li><a rel="external nofollow" href="#Menu=ChildMenu3" onClick="DoMenu('ChildMenu3')">网站管理</a>
<ul id="ChildMenu3" class="collapsed">
<li><a rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" href="#">登录</a></li>
<a rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" href="#">管理</a></li>
<li><a rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" href="#">管理</a></li>
<li><a rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" href="#">管理</a></li>
</ul>
</li>
<li><a rel="external nofollow" href="#Menu=ChildMenu4" onClick="DoMenu('ChildMenu4')">网站管理</a>
<ul id="ChildMenu4" class="collapsed">
<li><a rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" href="#">登录</a></li>
<a rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" href="#">管理</a></li>
<li><a rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" href="#">管理</a></li>
<li><a rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" href="#">管理</a></li>
<li><a rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" href="#">管理</a></li>
</ul>
</li>
</ul>
</div>
<script type=text/javascript><!--
var LastLeftID="";
function menuFix(){
var obj= document.getElementById("nav").getElementsByTagName("li");
for(var i=0; i<obj.length; i++){
obj[i].onmouseover=function(){
this.className+=(this.className.length>0?"":"")+"sfhover";
}
obj[i].onMouseDown=function(){
this.className+=(this.className.length>0?"":"")+"sfhover";
}
obj[i].onMouseUp=function(){
this.className+=(this.className.length>0?"":"")+"sfhover";
}
obj[i].onmouseout=function(){
this.className=this.className.replace(new RegExp("(?|^)sfhover\\b"),"");
}
}
}
function DoMenu(emid)
{
var obj= document.getElementById(emid);
obj.className=(obj.className.toLowerCase()=="expanded"?"collapsed":"expanded");
if((LastLeftID!="")&&(emid!=LastLeftID))//关闭上一个Menu
{
document.getElementById(LastLeftID).className="collapsed";
}
LastLeftID= emid;
}
function GetMenuID()
{
var MenuID="";
var _paramStr= new String(window.location.href);
var _sharpPos= _paramStr.indexOf("#");
if(_sharpPos>= 0&& _sharpPos< _paramStr.length- 1)
{
_paramStr= _paramStr.substring(_sharpPos+ 1, _paramStr.length);
}
else
{
_paramStr="";
}
if(_paramStr.length> 0)
{
var _paramArr= _paramStr.split("&");
if(_paramArr.length>0)
{
var _paramKeyVal= _paramArr[0].split("=");
if(_paramKeyVal.length>0)
{
MenuID= _paramKeyVal[1];
}
}
/*
if(_paramArr.length>0)
{
var _arr= new Array(_paramArr.length);
}
//取所有#后面的,菜单只需用到Menu
//for(var i= 0; i< _paramArr.length; i++)
{
var _paramKeyVal= _paramArr[i].split('=');
if(_paramKeyVal.length>0)
{
_arr[_paramKeyVal[0]]= _paramKeyVal[1];
}
}
*/
}
if(MenuID!="")
{
DoMenu(MenuID)
}
}
GetMenuID();//*这两个function的顺序要注意一下,不然在Firefox里GetMenuID()不起效果
menuFix();
--></script>
网页设计为什么要弄CSS样式
每次进行产品演示,我很快就会极力称赞 Dreamweaver MX 2004设计和呈现 CSS(或层叠样式表)的新功能。然而最近某位新用户问了一个问题,说实话,这个问题一下子让我张口结舌。这位用户只是问:“我为什么要使用 CSS?”当时我意识到,尽管我们这些每天与 HTML和 CSS打交道的人非常了解 CSS的优点,但仍有很多人并不了解。或者说并不完全了解 CSS所能提供的所有优点。本文是我对上面那位新用户的书面回答。CSS起源回顾 CSS的优点之前,我要先介绍一下它的历史。Web管理组织 W3C在 1996年 11月推荐使用 CSS,并批准了 CSS 1级规范。CSS 1级规范说明了用于 HTML页面的属性。这些属性代替了传统的字体标签和其他“样式”标记,例如颜色和边距。1998年 5月,W3C批准了 CSS 2级规范,将一些附加功能添加到 1级规范,并引进了定位属性。这些属性代替了表格标签普遍(但是错误)的用法,用来设计页面元素的表示。CSS规范的最新版本是 CSS 2.1,它改进了某些属性,并删除了在当前浏览器里没有作用或作用很小的属性。不幸的是,就像很多新技术一样,CSS经历了漫长的过程才被广泛采纳。其中的重要原因在于浏览器,以及为这些浏览器建立站点的 Web设计者们。CSS批准期间,Netscape Navigator(NN)仍然是主导浏览器,而该浏览器基本上不支持 CSS。Microsoft在其第 3版浏览器中添加了对 CSS非常有限的支持,但当时大多数的 Web设计者(本人在内)仍然将 NN作为首选平台进行页面编码。很多年来,每发行一个新版本,浏览器制作者们都扩展了对 CSS的支持。今天,Internet Explorer 6、Netscape Navigator 7、Mozilla、Opera和 Safari都全面支持 CSS。但这并不意味着我们作为 Web设计者和开发者的生涯不存在问题。尽管上述所有浏览器都支持 CSS Level 2,它们的兼容程度仍然各不相同。而且在某些情况下,特定属性仍然会带给你很多麻烦。也就是说,您仍然需要遵守老的信条“测试再测试”。但如果您坚持使用 CSS规范的核心属性,您将能够正确地呈现页面。但是为什么 W3C认为需要创建 CSS规范呢?当我创建基于 HTML的 Web站点和应用程序时,这一切对我又意味着什么呢?我认为,我们需要使用 CSS的理由以及它带来的优势可以分为以下三个主要方面:灵活性、呈现性和可访问性灵活性我确定几乎每个 Web设计者和开发者都经历过这样的痛苦时刻:当您小心地布置好页面,完成所有嵌套的表格后,客户要求进行一点“小小的”更改。这小小的更改可能只是“能不能把那个图形稍稍往左移动一点?”,也可能非常富有戏剧性:“我不喜欢这些标题,能把它们的字体弄大一点吗?改字体的时候,顺便把颜色也改了,怎么样?”如果只需要处理有限的几个页面,您可以深吸一口气,花上大半个小时做那些让人恼火的改动。但如果涉及到较大的站点(而这已经很常见),一个简单的更改无论如何也简单不了。这样的情形为什么会如此痛苦呢?因为定义页面外观的标记本身就是页面的一部分。要看到实例,您只需到任何站点的任何页面上去数一下 font和 table标签的数量。只要您能够从实际页面的流程(或代码)中删除这些标记,或者采用更好的办法,即将其外置,您就可以进行集中更改。而这就是 CSS所能做的。如果使用一个或多个外部样式表,通过修改样式表然后将修改后的版本上载,您就可以将更改应用到站点。想象一下,在传统的基于表格的布局中,将站点浏览从页面左侧移到页面右侧将有多么困难。这需要几个小时重复而乏味的工作。但是,如果您选择使用 CSS的定位属性(通常称作 CSS-P)来设计页面,只需更改外部样式表中的“浮动”或“位置”属性,即可更新页面。而且还有以下附加优势:您更新了站点中使用该样式的所有页面。呈现性由于宽带的广泛使用,很多开发者已经不再考虑在浏览器中呈现页面所花费的时间。但是,你们应该记住,很多目标用户仍然在使用拨号连接。传统的基于表格的布局是页面下载速度慢的主要原因。因为浏览器从服务器接收页面时,必须首先检查并“理解”一系列复杂的镶嵌式表格。它必须先找到镶嵌在最里面的内容,然后小心地逐步处理代码,直至到达最外层的容器,即 body标签。完成以上所有过程后,浏览器才能开始在屏幕上呈现内容。如果使用 CSS,浏览器从服务器接收内容后,立刻就可以开始呈现过程,因为页面中没有或只有很少的显示标记。使用外部样式表还有一个潜在的呈现方面的好处。在传统的基于表格的方法中,浏览器必须检索、分析并单独呈现每个页面。也就是说,浏览器在您的站点上显示第 30页时耗费的工作和显示第 1页时一样多。但是,如果使用外部样式表进行显示,站点的第一页将提示浏览器将页面使用的已链接样式表文件缓存起来。这意味着站点中所有使用上述样式表的后继页面下载速度会更快,因为浏览器已经缓存了样式表。最后一个与呈现有关的优点让我想起电影《莫扎特》。电影中,莫扎特问国王对自己的歌剧有什么看法。国王说很好,但是很沉闷。莫扎特一再追问,国王解释说,问题就在于“音符太多”。Web设计也可能有同样的问题,当然这里的音符指的是实际 HTML代码。代码越多,浏览器理解页面所花的时间就越长。大家也许都听说过有关官方应用程序的传言,它们编写了非常糟糕的代码,满是复杂的信息,然而文档页面却无法呈现。作为 Dreamweaver的用户,你们不会遇到这样的问题,但是如果编写了太多代码,你们也会感到内疚。典型的基于表格的设计就是一个很好的例子。在设计中使用 CSS后,您将减少客户需要下载的代码的数量。仅仅减少某些页面中的字体标签就可以大大减少代码的数量。在很多情况下,如果完全使用 CSS-P进行设计,代码的数量最多可以减少 50%甚至更多。代码减少就意味着页面下载的速度加快。
网页设计与制作的题目
网页设计一般分以下步骤:
1、平面设计,即效果图,工具有很多,比如PS,FW等。
2、代码实现,即参照效果图用代码写出静态页面,方法也有很多,比较容易用的工具就是DW。
3、实现后台管理,如果你知识需要静态页面即可,那么就把静态页面放一个文件夹内,然后放上相互的连接,如果需要网上可以访问到(即上线),那么你需要一个域名和后台管理。这后面就比较复杂了,看你想怎么经营你的网站。
网页设计的标准有很多,一般比较常见的标准有:
HTML标准,CSS3标准,新出现的HTML5标准,一般页面都遵循CSS3标准,
在规划网站目录结构时应遵循从大到小,从整体到细节的原则,也就是你要先规划好大的板块然后才来细分其中的分支,
版面布局一般是从上到下,从左到右
一般页面板块从上到下分别是:top(顶部); head(头部);nav(导航); banner(广告); mysite(我的位置); mian(主体); bottom(底部); copyright(版权)
.
HTML是超文本标记语言缩写即(Hypertext Markup Language)是超文本标记语言
HTML是一种规范,一种标准,它通过标记符号来标记要显示的网页中的各个部分。网页文件本身是一种文本文件,通过在文本文件中添加标记符,可以告诉浏览器如何显示其中的内容(如:文字如何处理,画面如何安排,图片如何显示等)。
HTML文档基本机构如下:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
<link rel="stylesheet" type="text/css" rel="external nofollow" rel="external nofollow" href="style.css">
</head>
<body>
</body>
</html>
<!DOCTYPE>声明位于文档中的最前面的位置,处于<html>标签之前。此标签可告知浏览器文档使用哪种 HTML或 XHTML规范
html是超文本标记
<head>标签用于申明作者和搜索引擎
meta标签通常用来为搜索引擎robots定义页面主题,或者是定义用户浏览器上的cookie
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
表示本文件是HTML格式,使用GB2312编码,当你是UTF8或者BIG5的时候按照这个写就行
<link rel="stylesheet" type="text/css" rel="external nofollow" rel="external nofollow" href="style.css">
表示引入一个style.css文件
<META>不影响页面效果,只有是搜索引擎要认一下
关于htmlcss网页设计实例的内容到此结束,希望对大家有所帮助。