惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 【当耐特】
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Y
Y Combinator Blog
D
DataBreaches.Net
Google DeepMind News
Google DeepMind News
H
Hackread – Cybersecurity News, Data Breaches, AI and More
云风的 BLOG
云风的 BLOG
Recorded Future
Recorded Future
I
InfoQ
L
LangChain Blog
Stack Overflow Blog
Stack Overflow Blog
Recent Announcements
Recent Announcements
宝玉的分享
宝玉的分享
Martin Fowler
Martin Fowler
J
Java Code Geeks
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
A
About on SuperTechFans
人人都是产品经理
人人都是产品经理
G
Google Developers Blog
大猫的无限游戏
大猫的无限游戏
C
Cybersecurity and Infrastructure Security Agency CISA
Know Your Adversary
Know Your Adversary
MongoDB | Blog
MongoDB | Blog
T
Tor Project blog
The Register - Security
The Register - Security
H
Help Net Security
Cisco Talos Blog
Cisco Talos Blog
P
Privacy & Cybersecurity Law Blog
NISL@THU
NISL@THU
P
Palo Alto Networks Blog
B
Blog RSS Feed
Latest news
Latest news
T
Threat Research - Cisco Blogs
The Hacker News
The Hacker News
C
Cisco Blogs
P
Privacy International News Feed
T
The Exploit Database - CXSecurity.com
V
Vulnerabilities – Threatpost
S
Schneier on Security
P
Proofpoint News Feed
Schneier on Security
Schneier on Security
www.infosecurity-magazine.com
www.infosecurity-magazine.com
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
AI
AI
Google Online Security Blog
Google Online Security Blog
H
Hacker News: Front Page
N
News and Events Feed by Topic
W
WeLiveSecurity

博客园 - puexine

解除一些网站利用【user-select: none;】禁止复制的限制! [nginx环境]Typecho安装在根目录与子目录的伪静态规则 使用 inline-block 水平垂直居中任意内容 Download VMware Workstation Pro css3 box-sizing属性 Google Chrome离线安装包下载 谷歌浏览器下载 Windows Defender Manually download the latest updates 常用公共DNS服务器地址 用户中心 - 博客园 VMWare CentOS 6.5 安装vmware-tools 彻底删除卸载Windows XP自带的Windows Message Windows Media Player Firefox Plugin支持Windows Server 2003的方法 微软软件运行库整理下载 – .NET Framework、VC++库、DirectX等 PIN码PJ教程,reaver 使用方法和技巧 Reaver基本命令参数详解及应用 另辟蹊径,CSS设置垂直居中 css实现固定高度及未知高度文字垂直居中的完美解决方案 显示器驱动程序已停止响应 并且已成功恢复 来自星星的你
纯CSS实现:垂直居中,未知宽高,已知宽高,IE5除外所有浏览器均兼容
puexine · 2014-09-18 · via 博客园 - puexine

纯CSS实现:盒子内元素垂直居中,宽高固定与否均可,IE5除外所有浏览器均兼容:

 1 <!DOCTYPE html>
 2 <html>
 3 <head>
 4 <meta charset="utf-8" />
 5 <title>纯CSS实现:盒子内元素垂直居中,宽高固定与否均可,IE5除外所有浏览器均兼容</title>
 6 <style>
 7 *{ margin:0; padding:0; }
 8 div  { text-align:center; background:#f00; width:800px; height:300px; }
 9 div *{ height:100%; display:inline-block; vertical-align:middle; }
10 span { height:auto; background:#fff; }
11 </style>
12 </head>
13 <body>
14 <div>
15     <b></b>
16     <span>
17         text-align:center;<br/>
18         vertical-align:middle;
19     </span>
20 </div>
21 </body>
22 </html>

纯CSS实现:窗口元素水平垂直居中,宽高固定与否均可,IE5除外所有浏览器均兼容:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>纯CSS实现:窗口元素水平垂直居中,宽高固定与否均可,IE5除外所有浏览器均兼容</title>
<style>
*{ margin:0; padding:0; }
html,body { height:100%; }
body { text-align:center; }
body *{ height:100%; display:inline-block; vertical-align:middle; }
span { height:auto; *display:inline; background:#ccc; }
</style>
</head>
<body>
    <b></b>
    <span>
        text-align:center;<br/>
        vertical-align:middle;
    </span>
</body>
</html>