CSS樣式重置

做者聲明:本博客中所寫的文章,都是博主自學過程的筆記,參考了不少的學習資料,學習資料和筆記會註明出處,全部的內容都以交流學習爲主。有不正確的地方,歡迎批評指正html

CSS樣式重置

經常使用的樣式重置代碼

  

@charset "UTF-8";
html,
body {
  background: #f0f0f0;
  color: #505050;
  /* 不容許選中 */
  -webkit-user-select: none;
  user-select: none;
  /* 去掉默認點擊高亮顯示 */
  -webkit-tap-highlight-color: transparent;
  /*禁止長按連接與圖片彈出菜單*/
  -webkit-touch-callout: none;
  /*滾動平滑,另外有反彈的效果。*/
  -webkit-overflow-scrolling: touch; }

body,
button,
input,
select,
textarea {
  font: 14px/1.5 "\5b8b\4f53", "Helvetica Neue", Arial, "Liberation Sans", FreeSans, "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 20px; }

html,
body,
div,
p,
h1,
h2,
h3,
h4,
h5,
h6,
ul,
ol,
li,
dl,
dt,
dd,
pre,
code,
form,
fieldset,
legend,
input,
textarea,
blockquote,
th,
td,
hr,
button,
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
menu,
nav,
section {
  padding: 0;
  margin: 0; }

ul,
ol {
  list-style: none; }

html,
body,
form,
fieldset,
p,
div,
h1,
h2,
h3,
h4,
h5,
h6 {
  /*阻止旋轉屏幕時自動調整字體大小*/
  -webkit-text-size-adjust: none; }

table {
  border-collapse: collapse;
  border-spacing: 0; }

image,
fieldset {
  border: none; }

a:focus,
*:focus {
  outline: none; }

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: normal; }

/*取消按鈕在inphone上的默認樣式*/
input[type=button] {
  -webkit-appearance: none;
  outline: none; }

input::-webkit-input-placeholder {
  /*修改webkit中input的planceholder樣式*/
  color: #969; }

textarea::-webkit-input-placeholder {
  /*修改webkit中input的planceholder樣式*/
  color: #969; }

input:focus::-webkit-input-placeholder {
  color: #969; }

input::-webkit-input-speech-button {
  display: none; }

a, button, input, optgroup, select, textarea {
  /*去掉a、input和button點擊時的藍色外邊框和灰色半透明背景*/
  -webkit-tap-highlight-color: transparent;
  color: inherit; }

a {
  text-decoration: none; }

.overflow-txt {
  white-space: nowrap;
  text-overflow: ellipsis; }

.fl {
  float: left; }

.fr {
  float: right; }

.clearfix:before, .clearfix:after {
  display: table;
  content: " ";
  height: 0;
  font-size: 0;
  line-height: 0; }

.clearfix:after {
  clear: both; }

.block {
  padding: 0;
  margin: 0;
  display: block; }

.layer-sep {
  height: 10px;
  background-color: #eee; }

 

其餘常見的樣式重置方式web

http://www.javashuo.com/article/p-mxfxcxiw-eo.htmlapp

相關文章
相關標籤/搜索