WEB前端开发经验总结(8)
作者:海啸 来源:Yaohaixiao博客 发布时间:2009-07-20 18:01:00
让我们再回顾一下行内元素的说明:行内元素在一个文本行内生成元素框,而不会打断这行文本。而我们这里要做的就是在一行内生成两个不同的元素框,而又不打破这行文本(直白的说法:在同一行显示)。好了,现在我们就得到了这部分的代码了:
<div>
<p>
<span><a href=”#1″>Homepage</a> | <a href=”#1″>About Us</a> | <a href=”#1″>Contact Us</a> | <a href=”#1″>Site Map</a> | <a href=”#1″>FAQs</a></span>
<span>Copyright © 2004 FD, All rights reserved.</span>
</p>
</div>
大功告成,现在我们就把这个页面里的全部XHTML代码都获得了,看看我们一步步的分析,对页面数据的的显示做了充分的语意化了。现在就把这个页面完整的代码给出来了,看看它是否也做到了,
尽量少的嵌套
页面里基本只显示用户需要看的数据(我们用CSS直接控制用户需要看的数据的显示的样式
页面对搜索引擎友好(没有CSS支持时,浏览页面时同样清晰,层次分明,十分容易查看数据。),已做了基本的SEO优化
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd“>
<html xmlns=”http://www.w3.org/1999/xhtml“>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=gb2312″ />
<meta name=”keywords” content=”Frame Design,a person of artistic mind,temperament,trun,What’s News,Green event,Couer Story,Cooperation,Project Work” />
<meta name=”description” content=”Frame Design,a person of artistic mind,temperament,trun,What’s News,Green event,Couer Story,Cooperation,Project Work” />
<meta name=”author” content=”Frame Design! Scripted by Yaohaixiao” />
<title>Frame Design</title>
</head>
<div><!–Top Sub Navigation–>
<a href=”#1″>Cart</a> | <a href=”#1″>Account</a> | <a href=”#1″>GuestBook</a> | <a href=”#1″>FAQs</a>
</div>
<div><!–LOGO and Main Navigation–>
<h1><a href=”#1″ title=”FrameDesign”>Frame Design</a></h1>
<ul>
<li><a href=”#1″>ARTICLES</a></li>
<li><a href=”#1″>TOPICS</a></li>
<li><a href=”#1″>ABOUT</a></li>
<li><a href=”#1″>CONTACT</a></li>
<li><a href=”#1″>FEED</a></li>
</ul>
</div>
<div><!–Banner–>
<img src=”img/banner.gif” alt=”Nature is the best physician” />
</div>
<div><!–Main Content–>
<div><!–Left Part–>
<h2>What’s News a person of artistic temperament[nature]</h2>
<div><img src=”img/tlt-banner.gif” alt=”What’s News” /></a>
<ul>
<li><a href=”#1″>A person of artistic temperament[nature]</a></li>
<li><a href=”#1″>A person of artistic temperament[nature]</a></li>
<li><a href=”#1″>A person of artistic temperament[nature]</a></li>
<li><a href=”#1″>A person of artistic temperament[nature]</a></li>
<li><a href=”#1″>A person of artistic temperament[nature]</a></li>
</ul>
<h2>Green event a person of artistic temperament</h2>
<ul>
<li><a href=”#1″>A person of artistic temperament[nature]</a></li>
<li><a href=”#1″>A person of artistic temperament[nature]</a></li>
<li><a href=”#1″>A person of artistic temperament[nature]</a></li>
<li><a href=”#1″>A person of artistic temperament[nature]</a></li>
</ul>
</div>
<div><!–Center Part–>
<p>
<strong>a person of an artistic turnof mind;</strong><br />
a person of artistic temperament[nature] <br />
a person of an artistic turn
</p>
<div><img src=”img/pic-1.gif” alt=”picture-1″ /></div>
<p>
<strong>a person of an artistic turnof mind;</strong><br />
a person of artistic temperament[nature] <br />
a person of an artistic turn
</p>
<div><img src=”img/pic-2.gif” alt=”picture-2″ /></div>
</div>
<div><!–Right Part–>
<h2>Couer Story</h2>
<p>
a person of an artistic turnof mind; a person of artistic temperament[nature] a person of an artistic turn
</p>
<div><img src=”img/Cooperation.gif” alt=”Cooperation” /></div>
<div><img src=”img/ProjectWORK.gif” alt=”Project WORK” /></div>
<p>
a person of an artistic turnof mind;<br />
a person of artistic temperament[nature]
</p>
</div>
</div>
<div><!–Footer–>
<p>
<span><a href=”#1″>Homepage</a> | <a href=”#1″>About Us</a> | <a href=”#1″>Contact Us</a> | <a href=”#1″>Site Map</a> | <a href=”#1″>FAQs</a></span>
<span>Copyright © 2004 FD, All rights reserved.</span>
</p>
</div>
<body>
</body>
</html>
看看我们得到的代码,是不是[b]结构清晰[/b]啊,页面上都是[b]运用合理的标签显示相应特征的数据(新闻标题、新闻列表、文字说明、图片、导航链接)[/b]了,做到了[b]XHTML标签充分的语意化[/b]。大家也看到了,没有多余的嵌套,做到了[b]尽量少的嵌套[/b]。而且页面里显示的基本是用户需要的数据,所以我们也做到了[b]页面里基本只显示用户需要看的数据[/b],而[b]我们用CSS直接控制用户需要看的数据的显示的样式[/b],由于我这里还没有添加任何的CSS样式,所以暂时我们还做不到,不过CSS的运用技巧会在我接下文章里介绍,很快我们做到这个也不是什么问题了。


猜你喜欢
- 所谓SQL注入,就是通过把SQL命令插入到Web表单递交或输入域名或页面请求的查询字符串,最终达到欺骗服务器执行恶意的SQL命令。我们永远不
- 如果是在Oracle10g之前,删除一个表空间中的数据文件后,其文件在数据库数据字典中会仍然存在,除非你删除表空间,否则文件信息不会清除。但
- 探究多个装饰器执行顺序装饰器是Python用于封装函数或代码的工具,网上可以搜到很多文章可以学习,我在这里要讨论的是多个装饰器执行顺序的一个
- 生成器是 Python 的基本组成部分。生成器是一个至少有一个“yield”表达式的函数。它们是可以
- defer关键字defer关键字可以让函数或语句延迟到函数语句块的最结尾时,即即将退出函数时执行,即便函数中途报错结束、即便已经panic(
- <'% '************************************************
- 1、字符串前加 u例:u"我是含有中文字符组成的字符串。"作用:后面字符串以 Unicode 格式 进行编码,一般用在中
- isset(PHP 3, PHP 4, PHP 5 )isset -- 检测变量是否设置描述bool isset ( mixed var [
- 通用用法但上图的字段名,类型需要根据不同接口填写,如某服务接口:因而对应的上传代码如下:# 输出参数:请求响应报文import reques
- input高级限制级用法1.取消按钮按下时的虚线框 在input里添加属性值 hideFocus 或者 HideFocus=true2.只读
- 之前已经go get安装了gin, 现在来玩下用go gin server作图片上传服务, 代码目录如下:taoge:~/test_gin$
- <?php/** * 车票接口类 * * @author chepiao100 * 
- 在上一期中作者向诸位简要介绍了 ASP 脚本语言之一 VBScript 的一些基本常识,本期将继续给大家讲解 VBScript 的脚本编写方
- 写在前面最近在更新我服务器上的python以及pip版本的时候,碰见了令人头痛的问题,就是我执行了升级指令之后,升级也正常的Successf
- 这题的官方难度是Medium,点赞1296,反对505,通过率35.4%。从各项指标来说看起来有些中规中矩,实际上也的确如此。这道题的解法和
- LABjs 是一个很小的 JavaScript 工具,用来根据需要加载 JavaScript 文件,通过使用该工具可以提升页面的性能,避免加
- Python Assert 为何不尽如人意?Python中的断言用起来非常简单,你可以在assert后面跟上任意判断条件,如果断言失败则会抛
- 这就意味着数据库和表名在 Windows 中是大小写不敏感的,而在大多数类型的 Unix 系统中是大小写敏感的。一个特例是 Mac OS X
- 马上就到春节了,今天看到有网友分享了网页版的虎年头像制作工具,感觉很不错,正好打算做个小程序练手没啥主题,那就用这个试试吧。先上最终效果图:
- 1. 简介Python 读写文件的二进制数据需要使用到struct模块,进行C/C++与Python数据格式的转换。2. struct模块介