• linkedu视频
  • 平面设计
  • 电脑入门
  • 操作系统
  • 办公应用
  • 电脑硬件
  • 动画设计
  • 3D设计
  • 网页设计
  • CAD设计
  • 影音处理
  • 数据库
  • 程序设计
  • 认证考试
  • 信息管理
  • 信息安全
菜单
linkedu.com专业计算机教程网站
  • 网页制作
  • 数据库
  • 程序设计
  • 操作系统
  • CMS教程
  • 游戏攻略
  • 脚本语言
  • 平面设计
  • 软件教程
  • 网络安全
  • 电脑知识
  • 服务器
  • 视频教程
  • html/xhtml
  • html5
  • CSS
  • XML/XSLT
  • Dreamweaver教程
  • Frontpage教程
  • 心得技巧
  • bootstrap
  • vue
  • AngularJS
  • HBuilder教程
  • css3
  • 浏览器兼容
  • div/css
  • 网页编辑器
  • axure
您的位置:首页 > 网页设计 >html5 > Html5的Reset和Base样式结合的示例代码

Html5的Reset和Base样式结合的示例代码

作者:匿名 字体:[增加 减小] 来源:互联网 时间:2018-12-03

本文主要包含Html5,Reset,Base等相关知识,匿名希望在学习及工作中可以帮助到您
结合Normalize CSS,Reset CSS, Base CSS, Html5 Reset Css整理了一份新的样式,我这里暂把他叫做HTML5 的Reset CSS 和Base CSS的结合。下面把相应的代码贴出来以供大家一起探讨。

/**
*Remove Spacing
*/body,dl,dd,ul,ol,figure ,h1,h2,h3,h4,h5,h6,p,pre,blockquote,
form ,fieldset,legend ,input,button,select,textarea {  margin: 0;  padding: 0;
}/*
 * Add block display for HTML5 elements
 * Corrects block display not defined in IE6/7/8/9 & FF3
 */article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
nav,
section {  display: block;
}/* =============================================================================
   Typography
   ========================================================================== *//*
 * Add bottom border
 * Corrects styling not present in IE7/8/9 S5 Chrome
 */abbr[title],
dfn[title] {  border-bottom: 1px dotted;  cursor:help;
}/*
 * Define font family as monospace
 * Corrects font family set oddly in IE6 S5 C10
 * en.wikipedia.org/wiki/User:Davidgothberg/Test59
 */pre,
code,
kbd,
samp { font-family: monospace, sans-serif;   _font-family: 'Courier New', monospace, sans-serif; font-size: 1em;
}/*
 * Add line wrapping
 * Improves readability of pre-formatted text in all browsers
 */pre {  white-space: pre;/*CSS2*/
  white-space: pre-wrap;/*CSS2.1*/
  white-space: pre-line;/*CSS3*/
  word-wrap: break-word;/*IE*/}/*
 * Remove quotes
 * 1. Addresses CSS quotes not supported in IE6/7
 * 2. Addresses quote attributes not supported in S4
 */blockquote,
q {  quotes: none;
}
 
blockquote:before,
blockquote:after,
q:before,
q:after {  content: '';  content: none;
}/*
 * Define font size
 * Improves appearance in all browsers
 */small {  font-size: 75%;
}/*
 * Define font size and alignment
 * Improves appearance without affecting line-height in all browsers
 * gist.github.com/413930
 */sub,
sup {  font-size: 75%;  line-height: 0;  position: relative;  vertical-align: baseline;
}
 
sup {  top: -0.5em;
}
 
sub {  bottom: -0.25em;
}/*Clear floats 
 *The Magnificent CLEARFIX:Updated fo prevent margin-collapsing on child elements 
 */.clearfix:before,
.clearfix:after {   content:"\0020";   display: block;   height: 0;   visibility: hidden;
}
 
.clearfix {  zoom: 1;/*IE<8*/}
 
.clearfix:after {  clear: both;
}
* html .clearfix { 
  zoom: 1; /* IE6 */} 
*:first-child+html .clearfix { 
  zoom: 1; /* IE7 */} 
 
/*
 * Add inline-block display for HTML5 elements
 * Corrects inline-block display not defined in IE6/7/8/9 & FF3
 */audio[controls],
canvas,
video { display: inline-block;
 *display: inline;
 *zoom: 1;
}
 
html { font-size: 100.01%;/*To Prevent bugs in IE and Opera*/
 height: 100%;/*Using height 100% on html and body allows to style containers with a 100% height*/
 overflow-y: scroll;/*The overflow declaration is to make sure there is a gutter for the scollbar in all browsers regardless of content*/
 cursor: default; /* Add normal cursor  Improves visual focus of page during mouse use in all browsers */
 overflow-y: scroll; /* Add vertical scrollbar  Keeps page centered in all browsers regardless of content height */
 -webkit-tap-highlight-color: transparent; /* Add vertical scrollbar  Keeps page centered in all browsers regardless of content height */
 -ms-text-size-adjust: 100%; /* Define maximum text display as 100% to document Corrects text displayed oddly after orientation change in handheld browsers */
 -webkit-text-size-adjust: 100%; /* Define maximum text display as 100% to document Corrects text displayed oddly after orientation change in handheld browsers */}
 
body { background-color: #fff;/*Not all browsers set white as the default background color*/
 color: #444;/*#444 looks better than black*/
 height: 100%;
}
 
body,
button
input,
select,
textarea { font: 12px/1.5 sans-serif;
}
 
img,fieldset {  border: 0 none; /*Remove border   Improves readability when inside <a> element in all browsers*/}
 
img {  vertical-align: top;  -ms-interpolation-mode: bicubic; /*Add high quality bicubic image resampling Improves visual appearance when scaled in IE7*/}/* =============================================================================
   Links
   ========================================================================== *//*
 * Remove outline
 * Improves appearance when active or hovered in all browsers
 * people.opera.com/patrickl/experiments/keyboard/test
 */a,
a:active,
a:hover {  outline: none;
}/*
 * Define outline as thin dotted
 * Improves appearance displayed oddly in C10
*/a:focus { outline: thin dotted;
}
 
a,
a:link { color: #0000EE; text-decoration: none;
}
 
a:hover { text-decoration: underline;
}
a:visited {  text-decoration: none;  color: #551A8B;
}/*Hide only visually,but have it available for screenreaders*/.hidden {   border: 0 !important;   clip: rect(1px 1px 1px 1px);/*IE<8*/
   clip: rect(1px,1px,1px,1px);   height: 1px !important;   margin: -1px;   overflow: hidden;   padding: 0 !important;   position: absolute !important;   width: 1px;
}/* =============================================================================
   Lists
   ========================================================================== */dd {  margin: 0 0 0 40px;
}
 
nav ul,
nav ol {  list-style: none;
}/* =============================================================================
   Forms
   ========================================================================== */form {  overflow: visible;
}
 
fieldset {  line-height: 1;/*line height helps to set the vertical alignment of radio buttons and check boxes*/}/*
 * Add negative left margin
 * Corrects alignment displayed oddly in IE6/7
 */legend {
  *margin-left: -7px;
}/*
 * Define consistent vertical alignment display in all browsers
 */button,
input,
select,
textarea {  vertical-align: baseline; 
  *vertical-align: middle; 
}/*
 * 1. Define line-height as normal
 *    Corrects FF3/4 setting it using !important in the UA stylesheet
 * 2. Make visible overflow
 *    Fixes spacing displayed oddly in IE6/7
 */button,
input {  line-height: normal; /* 1 */
  *overflow: visible;  /* 2 */}/*
 * 1. Display hand cursor for clickable form elements
 *    Improves usability and consistency of cursor style between image-type <input /> and others
 * 2. Define appearance for clickable form elements
 *    Corrects inability to style clickable <input /> types in iOS
 */button,
input[type="button"], 
input[type="reset"], 
input[type="submit"],
.form-btn,
.btn {  cursor: pointer; /* 1 */
  -webkit-appearance: button; /* 2 */}/*
 * Define box sizing
 * Addresses box sizing set to content-box in IE8/9
 */input[type="checkbox"],
input[type="radio"] {  box-sizing: border-box;
}
 
input[type="checkbox"] {  vertical-align: bottom;/*Vertical alignment of checkboxes*/
  *vertical-align: baseline;/*IE7*/}
 
input[type="radio"] {  vertical-align: text-bottom;/*Vertical alignment of radio buttons*/}
 
input {  _vertical-align: text-bottom;/*Vertical alignment of input fields for IE6*/}/*
 * Define box sizing and appearance
 * Addresses box sizing set to border-box in S5 Chrome (include -moz to future-proof)
 * Addresses appearance set to searchfield in S5 Chrome
 */input[type="search"] {  -webkit-appearance: textfield;  -moz-box-sizing: content-box;  -webkit-box-sizing: content-box;  box-sizing: content-box;
}/*
 * Remove inner padding and border
 * Fixes appearance displayed oddly in FF3/4
 * www.sitepen.com/blog/2008/05/14/the-devils-in-the-details-fixing-dojos-toolbar-buttons/
 */button::-moz-focus-inner,
input::-moz-focus-inner {  border: 0;  padding: 0;
}/*
 * 1. Disable default vertical scrollbar
 *    Corrects scrollbar displayed oddl
  


 

您可能想查找下面的文章:

  • HTML5知识点总结
  • HTML5的本地存储
  • HTML5本地存储之IndexedDB
  • Html5实现文件异步上传功能
  • Html5新标签datalist实现输入框与后台数据库数据的动态匹配
  • 详解HTML5 window.postMessage与跨域
  • HTML5拖放API实现拖放排序的实例代码
  • 解决html5中video标签无法播放mp4问题的办法
  • HTML5新特性 多线程(Worker SharedWorker)
  • Html5新增标签有哪些

相关文章

  • 2018-12-03关于HTML5你不得不知的事
  • 2017-10-01h5改良的input元素种类
  • 2017-08-06HTML5中div、article、section的区别及使用介绍
  • 2018-12-03如何使用html5与css3完成google涂鸦动画
  • 2018-12-03HTML5:web socket 和 web worker
  • 2018-12-03HTML5游戏框架cnGameJS开发实录-外部输入模块篇
  • 2018-12-03关于HTML5中video标签浏览器兼容性增强的方案分享
  • 2018-12-03iOS webView怎样加载HTMLString
  • 2018-12-03[HTML5代码艺术]17行代码的贪吃蛇小游戏
  • 2018-12-03移动端HTML5性能优化

文章分类

  • html/xhtml
  • html5
  • CSS
  • XML/XSLT
  • Dreamweaver教程
  • Frontpage教程
  • 心得技巧
  • bootstrap
  • vue
  • AngularJS
  • HBuilder教程
  • css3
  • 浏览器兼容
  • div/css
  • 网页编辑器
  • axure

最近更新的内容

    • 为什么HTML5成了Web开发者最关心的技术
    • 安全攻防入门教程:10个安全攻防零基础入门教程推荐
    • HTML5画布Canvas文本填充、线段属性、裁剪、透明度与像素合并方式
    • 关于H5新标签的浏览器兼容问题的详解
    • 基于 WebSocket 构建跨浏览器的实时应用
    • html5桌面通知(Web Notifications)实例解析
    • html5页面如何实现点击复制的功能 (完整代码)
    • 使用HTML5 Canvas API中的clip()方法裁剪区域图像
    • h5怎样实现获取用户地理定位
    • 用HTML5 Canvas来绘制三角形和矩形等多边形的方法

关于我们 - 联系我们 - 免责声明 - 网站地图

©2020-2025 All Rights Reserved. linkedu.com 版权所有