zoukankan      html  css  js  c++  java
  • 重置样式

    首先写一个项目的时候需要有一个重置全局的样式,为了弥补各种浏览器的展现不同

    (1) 首先使用元素标签将每个元素的margin和padding的值改为0,让页面不会因浏览器默认设置不同而改变页边距和字边距;

    (2) 设置<body>元素的字体颜色,字号大小等,可以规范整个项目网站的样式风格;

    (3) 设置其他元素的特定样式;

     1 body,h1,h2,h3,h4,h5,h6,hr,p,blockquote,dl,dt,dd,ul,ol,li,pre,form,fieldset,legend,button,input,textarea,th,td{
     2     margin: 0;padding: 0;
     3 }
     4 body,button,input,select,textarea{
     5     font:12px/1.5 tahoma,arial,5b8b4f53;
     6 }
     7 h1,h2,h3,h4,h5,h6{
     8     font-size: 100%;
     9 }
    10 address,cite,dfn,em,var{
    11     font-style: normal;
    12 }
    13 code,kbd,pre,samp{
    14     font-family: courier new,courier,monospace;
    15 }
    16 small{
    17     font-size: 12px;
    18 }
    19 ul,ol{
    20     list-style: none;
    21 }
    22 a{
    23     text-decoration: none;
    24 }
    25 a:hover{
    26     text-decoration: underline;
    27 }
    28 sup{
    29     vertical-align: text-top;
    30 }
    31 sub{
    32     vertical-align: text-bottom;
    33 }
    34 legend{
    35     color:#000;
    36 }
    37 fieldset,img{
    38     border: 0;
    39 }
    40 button,input,select,textarea{
    41     font-size: 100%;
    42 }
    43 table{
    44     border-collapse: collapse;//如果可能边框会合并为一个单一的边框。会忽略border-spacing和empty-cell属性
    45 }
    46 .clear{
    47     clear: both;
    48     float: none;
    49     height: 0;
    50     overflow: hidden;
    51 }
    52 html .hide{
    53     display: none;
    54 }

    注释:

    第五行

    这是css中font的简写写法

    字体: 字体大小/字体行高 字体格式

    相当于

    body,html,input
    {
    font: 12px;
    line-height: 1.5;
    font-family: tahoma,arial,5b8b4f53,sans-serif;  

    //tahoma 大河马字体,window英文默认字形;

    //arial 是一套随同多套微软应用软件所分发的无衬线体TrueType字

    //sans-serif    表示是无衬线字体,是一种通用字体族。

    //"5b8b4f53″ 就是 “宋体”。用 unicode 表示,不用 SimSun, 是因为 Firefox 的某些版本和 Opera 不支持 SimSun 的写法。注释乱码:强烈建议不要用中文注释。font-family:’宋体’
    }

    一些中文名字的unicode

    新细明体 65B07EC6660E4F53
    细明体 7EC6660E4F53
    标楷体 680769774F53
    黑体 9ED14F53
    宋体 5B8B4F53
    新宋体 65B05B8B4F53
    仿宋 4EFF5B8B
    楷体 69774F53
    仿宋_GB2312 4EFF5B8B_GB2312
    楷体_GB2312 69774F53_GB2312
    微软正黑体 5FAEx8F6F6B639ED14F53
    微软雅黑 5FAE8F6F96C59ED1

  • 相关阅读:
    Windows server 2008 R2远程桌面授权破解方法
    微软 windows server 2019 中文版 原版iso镜像下载地址及密钥
    Everything——支持快速搜索文件夹
    相对路径(根目录、当前目录、上级目录)
    LinkShellExtension (软连接、硬连接、符号连接)工具教程
    oracle 获取表信息
    python3.6 安装 pycrypto
    项目问题记录
    Django得缓存
    Django得信号
  • 原文地址:https://www.cnblogs.com/fnncat/p/4906342.html
Copyright © 2011-2022 走看看