Home Web Front-end CSS Tutorial css framework—base.css

css framework—base.css

Feb 10, 2017 pm 03:46 PM
Base

今天发下我自己的 css 框架——base.css,作用是重设浏览器默认样式和提供通用原子类。

@charset "utf-8";
/*!
 * @名称:base.css
 * @功能:1、重设浏览器默认样式
 *       2、设置通用原子类
 */
/* 防止用户自定义背景颜色对网页的影响,添加让用户可以自定义字体 */
html {
    background:white;
    color:black;
}
/* 内外边距通常让各个浏览器样式的表现位置不同 */
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td,hr,button,article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section {
    margin:0;
    padding:0;
}
/* 要注意表单元素并不继承父级 font 的问题 */
body,button,input,select,textarea {
    font:12px \5b8b\4f53,arial,sans-serif;
}
input,select,textarea {
    font-size:100%;
}
/* 去掉 table cell 的边距并让其边重合 */
table {
    border-collapse:collapse;
    border-spacing:0;
}
/* ie bug:th 不继承 text-align */
th {
    text-align:inherit;
}
/* 去除默认边框 */
fieldset,img {
    border:none;
}
/* ie6 7 8(q) bug 显示为行内表现 */
iframe {
    display:block;
}
/* 去掉 firefox 下此元素的边框 */
abbr,acronym {
    border:none;
    font-variant:normal;
}
/* 一致的 del 样式 */
del {
    text-decoration:line-through;
}
address,caption,cite,code,dfn,em,th,var {
    font-style:normal;
    font-weight:500;
}
/* 去掉列表前的标识,li 会继承 */
ol,ul {
    list-style:none;
}
/* 对齐是排版最重要的因素,别让什么都居中 */
caption,th {
    text-align:left;
}
/* 来自yahoo,让标题都自定义,适应多个系统应用 */
h1,h2,h3,h4,h5,h6 {
    font-size:100%;
    font-weight:500;
}
q:before,q:after {
    content:'';
}
/* 统一上标和下标 */
sub,sup {
    font-size:75%;
    line-height:0;
    position:relative;
    vertical-align:baseline;
}
sup {
    top:-0.5em;
}
sub {
    bottom:-0.25em;
}
/* 让链接在 hover 状态下显示下划线 */
a:hover {
    text-decoration:underline;
}
/* 默认不显示下划线,保持页面简洁 */
ins,a {
    text-decoration:none;
}
/* 去除 ie6 & ie7 焦点点状线 */
a:focus,*:focus {
    outline:none;
}
/* 清除浮动 */
.clearfix:before,.clearfix:after {
    content:"";
    display:table;
}
.clearfix:after {
    clear:both;
    overflow:hidden;
}
.clearfix {
    zoom:1; /* for ie6 & ie7 */
}
.clear {
    clear:both;
    display:block;
    font-size:0;
    height:0;
    line-height:0;
    overflow:hidden;
}
/* 设置显示和隐藏,通常用来与 js 配合 */
.hide {
    display:none;
}
.block {
    display:block;
}
/* 设置浮动,减少浮动带来的 bug */
.fl,.fr {
    display:inline;
}
.fl {
    float:left;
}
.fr {
    float:right;
}
Copy after login

更多css 框架——base.css相关文章请关注PHP中文网!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Base Layer 2 Network Surpasses 4.2 Million Daily Transactions, Dominating the L2 Space Base Layer 2 Network Surpasses 4.2 Million Daily Transactions, Dominating the L2 Space Sep 11, 2024 am 06:48 AM

Coinbase's native layer 2 network Base has surpassed 4.2 million daily transactions, according to data from Coin98Analytics. Arbitrum came closest with 1.3 million transactions followed by Ethereum with 1.1 million transactions.

Base Dominates Layer 2 (L2) Transactions, Accounting for 67.6% of Total Activity Base Dominates Layer 2 (L2) Transactions, Accounting for 67.6% of Total Activity Oct 17, 2024 pm 10:08 PM

As of October 14, 2024, Base now dominates Layer 2 (L2) transactions, accounting for 67.6% of total activity. Arbitrum follows with 22.6%, and Optimism holds 9.7%

Base, Coinbase's Layer-2 Blockchain, Positions Itself to Flip Arbitrum as the Leading Ethereum L2 Network by TVL Base, Coinbase's Layer-2 Blockchain, Positions Itself to Flip Arbitrum as the Leading Ethereum L2 Network by TVL Oct 14, 2024 am 01:02 AM

Coinbase’s Layer-2 blockchain, Base, has recorded a major milestone in its bid to surpass Arbitrum. Both operate on the same Ethereum blockchain

AtariX Brings Classic Games to the Blockchain, Starting with Asteroids AtariX Brings Classic Games to the Blockchain, Starting with Asteroids Jul 26, 2024 pm 06:11 PM

In a groundbreaking move, AtariX, the Web3 initiative from iconic video game developer Atari, has announced that it will be bringing its classic games to the blockchain.

Unintentional Token Created by Blockchain Investigator ZachXBT Reaches $15M Market Cap Unintentional Token Created by Blockchain Investigator ZachXBT Reaches $15M Market Cap Nov 06, 2024 pm 12:14 PM

A token unintentionally created by blockchain investigator ZachXBT on the Base network, has reached a $15 million market cap after being automatically converted into a tradable asset.

Metacade Announces the Launch of Its First Independent Game, Gangs of Metacadia, on Base Metacade Announces the Launch of Its First Independent Game, Gangs of Metacadia, on Base Nov 15, 2024 am 03:24 AM

Gangs of Metacadia draws on the expertise of the Metacade development team, which includes Jamie King, co-founder of Rockstar Games and advisor at Metacade.

Aviator Technologies Launches SkyBridge™, a Revolutionary Bridging Solution Connecting Ethereum and Coinbase's Layer-2 Network, Base Aviator Technologies Launches SkyBridge™, a Revolutionary Bridging Solution Connecting Ethereum and Coinbase's Layer-2 Network, Base Oct 28, 2024 am 06:34 AM

On October 27th, 2024, Aviator Technologies, LLC launched SkyBridge™ – a groundbreaking solution designed to bridge the gap between Ethereum and Coinbase's Layer-2 network, Base.

Degen Express Brings Community-Driven and Fairly Launched Memes to Fantom and Base through its Unique Launchpad Degen Express Brings Community-Driven and Fairly Launched Memes to Fantom and Base through its Unique Launchpad Oct 20, 2024 pm 03:50 PM

Degen Express launched in 2023 and effectively changed the meme coin space with its robust, community-driven launchpad for meme projects on both Fantom and Base.

See all articles