您现在的位置是:网站首页> 编程资料编程资料
HTML5几个设计和修改的页面范例分享简单的HTML5初步入门教程基于HTML5实现的带左右箭头可拖动幻灯片特效源码基于html5 canvas逼真下雪场景动画特效源码 6种特效
2021-08-31
884人已围观
简介 这篇文章主要介绍了HTML5几个设计和修改的页面范例分享,主要针对普通页面使用HTML5进行润色的工作,需要的朋友可以参考下
要了解和熟悉 HTML5 中的新的语义元素,最好的方式就是拿一经典的 HTML 文档作例子,然后把 HTML5 的一些新鲜营养充实进入。如下就是我们要改造的页面,该页面很简单,只包含一篇文章。
ApocalypsePage_Original.html,这是一个格式非常规范的页面,所有的样式均来自于外部样式表。
XML/HTML Code复制内容到剪贴板
- >
- <html lang="zh-CN">
- <head>
- <meta charset="utf-8">
- <title>Apocalypse Nowtitle>
- <link rel="stylesheet" href="ApocalypsePage_Original.css">
- head>
- <body>
- <div class="Header">
- <h1>How the World Could Endh1>
- <p class="Teaser">Scenarios that spell the end of life as we knowp>
- <p class="Byline">by Ray N. Carnationp>
- div>
- <div class="Content">
- <p><span class="LeadIn">Right nowspan>, you're probably feeling pretty good. After all, life in the developed world is comfortable<span class="style1">—span>probably more comfortable than it's been for the average human being throughout all of recorded history.p>
- <p>But don't get too smug. There's still plenty of horrific ways it could all fall apart. In this article, you'll learn about a few of our favorites.p>
- <h2>Mayan Doomsdayh2>
- <p>Skeptics suggest that the Mayan calendar simply rolls to a new 5,126-year era after 2012, and doesn't actually predict a life-ending apocalypse. But given that the long-dead Mayans were wrong about virtually everything else, why should we trust them on this?p>
- <h2>Robot Takeoverh2>
- <p>Not quite as frightening as a Vampire Takeover or Living-Dead Takeover, a robot rebellion is still a disquieting thought. We are already outnumbered by our technological gadgets, and even Bill Gates fears the day his Japanese robot slave turns him over by the ankles and asks (in a suitably robotic voice) "Who's your daddy now?"p>
- <h2>Unexplained Singularityh2>
- <p>We don't know how the universe started, so we can't be sure it won't just end, maybe today, and maybe with nothing more exciting than a puff of anti-matter and a slight fizzing noise.p>
- <h2>Runaway Climate Changeh2>
- <p>Dismissed by some, Al Gore's prophecy of doom may still come true. If it does, we may have to contend with vicious storms, widespread food shortages, and surly air conditioning repairmen.p>
- <h2>Global Epidemich2>
- <p>Some time in the future, a lethal virus could strike. Predictions differ about the source of the disease, but candidates include monkeys in the African jungle, bioterrorists, birds and pigs with the flu, warriors from the future, an alien race, hospitals that use too many antibiotics, vampires, the CIA, and unwashed brussel sprouts. Whatever the source, it's clearly bad news.p>
- div>
- <div class="Footer">
- <p class="Disclaimer">These apocalyptic predictions do not reflect the views of the author.p>
- <p>
- <a href="AboutUs.html">About Usa>
- <a href="Disclaimer.html">Disclaimera>
- <a href="ContactUs.html">Contact Usa>
- p>
- <p>Copyright © 2014p>
- div>
- body>
- html>
在不增加任何 CSS 样式表之前,效果如下:
上面通过三个
将页面分成了三个部分,顶部的页眉,中部的内容和底部的页脚。
这个例子中的样式表很简单,整个页面最大宽度设置为 800 像素,避免文本在宽屏显示器上显示过长。页眉位于一个带有蓝色边框的盒子中,内容区的两侧都增加了内边距,而页脚在整个页面的底部居中。
ApocalypsePage_Original.css样式文件内容如下:
XML/HTML Code复制内容到剪贴板
- @charset "utf-8";
- /* CSS Document */
- body{
- /*font-family 要使用安全字体,按照先特殊后一般的原则,
- 先给出你想要的字体,然后是保险一些的字体,
- 最后以 sans-serif 字体结尾*/
- font-family: "Lucida sans Unicode", "Lucida Grande", Geneva, sans-serif;
- max-width: 800px; /*最大宽度不超过 800 像素*/
- }
- /*页面顶部的标题区样式*/
- .Header {
- background-color: #7695FE; /*可接受任何颜色值*/
- border: thin #336699 solid; /*多合一的 border 属性*/
- padding: 10px; /* 10像素的内边距,边框与内容之间的距离*/
- margin:
相关内容
- 简单的HTML5初步入门教程基于HTML5实现的带左右箭头可拖动幻灯片特效源码基于html5 canvas逼真下雪场景动画特效源码 6种特效HTML5对安全的改进 HTML5安全攻防详析终结篇
- 基于html5 DeviceOrientation 实现微信摇一摇功能HTML5仿手机微信摇一摇游戏特效源码基于HTML5实现类似微信手机摇一摇功能(计算摇动次数)
- 利用HTML5实现使用按钮控制背景音乐开关有关HTML5中背景音乐的自动播放功能HTML5简单实现添加背景音乐的几种方法
- 深入解析HTML5的IndexedDB索引数据库html5中localStorage本地存储的简单使用HTML5 LocalStorage 本地存储刷新值还在详解HTML5 LocalStorage 本地存储 html5本地存储 localStorage操作使用详解Html5 web本地存储实例详解HTML5本地存储之Web Storage详解HTML5中indexedDB 数据库的使用实例html5 初试 indexedDB(推荐)HTML5本地存储之IndexedDB
- 使用HTML5的表单验证的简单示例html5自带表单验证体验优化及提示气泡修改功能HTML5 表单验证失败的提示语问题使用HTML5和CSS3表单验证功能HTML5实现表单自动验证功能实例代码详解HTML5中表单验证的8种方法介绍HTML5 form标签之解放表单验证、增加文件上传、集成拖放的使用方法HTML5表单验证特性(知识点小结)
- 使用HTML5的Canvas绘制曲线的简单方法
- HTML5未来发展趋势 HTML5到底会有什么发展?HTML5的前景展望
- HTML5中的音频和视频媒体播放元素小结使用HTML和JavaScript播放本地的媒体(视频音频)文件的方法
- 整理HTML5的一些新特性与Canvas的常用属性HTML5新特性之type=file文件上传功能HTML5新特性之语义化标签HTML5新特性之用SVG绘制微信logo 基于HTML5新特性Mutation Observer实现编辑器的撤销和回退操作HTML5 history新特性pushState、replaceState及两者的区别 HTML5有哪些新特征Html5新特性用canvas标签画多条直线附效果截图html5声频audio和视频video等新特性详细说明html5新特性与用法大全
- 关于HTML5 Placeholder新标签低版本浏览器下不兼容的问题分析及解决办法 处理HTML5新标签的浏览器兼容版问题HTML5新标签兼容——> <!--<if lt IE 9><!endif-->
点击排行
本栏推荐
