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

推荐订阅源

D
Darknet – Hacking Tools, Hacker News & Cyber Security
V
Vulnerabilities – Threatpost
Cloudbric
Cloudbric
G
GRAHAM CLULEY
S
Securelist
Schneier on Security
Schneier on Security
Help Net Security
Help Net Security
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Project Zero
Project Zero
Spread Privacy
Spread Privacy
P
Privacy International News Feed
C
Cyber Attacks, Cyber Crime and Cyber Security
Cisco Talos Blog
Cisco Talos Blog
T
Tailwind CSS Blog
博客园_首页
有赞技术团队
有赞技术团队
Simon Willison's Weblog
Simon Willison's Weblog
Stack Overflow Blog
Stack Overflow Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Latest news
Latest news
T
Tor Project blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Attack and Defense Labs
Attack and Defense Labs
www.infosecurity-magazine.com
www.infosecurity-magazine.com
O
OpenAI News
J
Java Code Geeks
T
Tenable Blog
K
Kaspersky official blog
AWS News Blog
AWS News Blog
S
Security @ Cisco Blogs
The GitHub Blog
The GitHub Blog
T
Threatpost
月光博客
月光博客
H
Heimdal Security Blog
Security Latest
Security Latest
The Hacker News
The Hacker News
Y
Y Combinator Blog
A
Arctic Wolf
Apple Machine Learning Research
Apple Machine Learning Research
C
Cisco Blogs
美团技术团队
Microsoft Security Blog
Microsoft Security Blog
Hugging Face - Blog
Hugging Face - Blog
T
The Blog of Author Tim Ferriss
C
CERT Recently Published Vulnerability Notes
D
Docker
Google Online Security Blog
Google Online Security Blog
D
DataBreaches.Net
V
Visual Studio Blog
H
Help Net Security

博客园 - phcis

c# 全角(SBC)和半角(DBC)相互转换函数 用HttpWebRequest做POST请求时返回Http 417 错误解决方法 使用webbroswer的一点技巧记录 计算字符串相似度及寻找最相似字符串的代码 asp.net中js返回false时阻止form提交的方法 sql 语句实现分页 【转】C#产生随机字符的两段代码 【转】datagridview的checkbox列,当修改checkbox状态时实时获得其准确状态值 c# 读取excel的一系列问题 - phcis - 博客园 由于使用“优易U盘加密软件”导致电脑无法关机/蓝屏等解决方法 批量删除数据库中所有表的记录(清空数据库) C# HttpRequest基础连接已经关闭: 接收时发生意外错误 GridView 动态绑定数据,包括2个或者多个值 - phcis - 博客园 近期动向 使用ajax导致滚动条复位的解决方法 AT编程常见问题与错误代码的意义 c# 发送email,正文支持html格式,包含附件 使用AutocompleteExtender无效或者没反应的原因记录 使用 DateTimePicker 控件显示和选择时间
【转】DIV+CSS 让文字居中于背景图
phcis · 2011-04-20 · via 博客园 - phcis

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>www.divcss5.com的CSS div的完整居中实例</title>
<style type="text/css">
<!--
body{ text-align:center; margin:0 auto; background: url(http://www.divcss5.com/img/css-logo.gif) no-repeat center;}
.waicheng {color: #0066CC; margin:5px auto; width:700px; height:120px; line-height:120px; border:1px solid #000000; }
.waicheng img {vertical-align:middle;}
-->
</style>
</head>
<body>
<div class="waicheng">我是css中的居中的完整居中实例;我的布局外层有一个边为1px <img src="http://www.divcss5.com/img/css-logo.gif" alt="图片内容居中" /></div>
</body>
</html>

代码说明:

waicheng 中增加样式 line-height:120px;vertical-align:middle; 就可以了。注意line-height:的数值跟height保持一致