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

推荐订阅源

量子位
GbyAI
GbyAI
V
Vulnerabilities – Threatpost
阮一峰的网络日志
阮一峰的网络日志
罗磊的独立博客
Recorded Future
Recorded Future
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
博客园 - 司徒正美
Y
Y Combinator Blog
Microsoft Security Blog
Microsoft Security Blog
美团技术团队
博客园 - Franky
Blog — PlanetScale
Blog — PlanetScale
B
Blog RSS Feed
V
Visual Studio Blog
Martin Fowler
Martin Fowler
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
博客园_首页
C
Cybersecurity and Infrastructure Security Agency CISA
博客园 - 叶小钗
AWS News Blog
AWS News Blog
Project Zero
Project Zero
T
Threat Research - Cisco Blogs
V
V2EX
F
Fortinet All Blogs
The GitHub Blog
The GitHub Blog
Latest news
Latest news
N
News and Events Feed by Topic
The Last Watchdog
The Last Watchdog
T
Threatpost
L
Lohrmann on Cybersecurity
小众软件
小众软件
IT之家
IT之家
MongoDB | Blog
MongoDB | Blog
博客园 - 聂微东
Engineering at Meta
Engineering at Meta
爱范儿
爱范儿
Google Online Security Blog
Google Online Security Blog
Forbes - Security
Forbes - Security
Attack and Defense Labs
Attack and Defense Labs
The Register - Security
The Register - Security
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
H
Help Net Security
Security Latest
Security Latest
Recent Announcements
Recent Announcements
C
Check Point Blog
B
Blog
Google DeepMind News
Google DeepMind News
K
Kaspersky official blog
I
InfoQ

博客园 - 牦牛

Linux常用命令 错误:80040154 没有注册类 的问题 [转]Java实现定时任务的三种方法 访问IIS网站需要输入用户名密码(非匿名登录)问题汇总 IE10、IE11 User-Agent 导致的 ASP.Net 网站无法写入Cookie 问题 端口占用问题 中国电信翼支付网关接口接入 修改Tomcat响应请求时返回的Server内容 模拟用户点击弹出新页面 Eclipse常用设置 Tomcat服务无法启动的问题 JavaScript继承的模拟实现 Windows Server 2008 小操作汇总 手机也能连VPN,再来个远程控制PC这种事你以为我会随便说么! - 牦牛 Windows下Git服务器搭建及使用过程中的一些问题 Oracle PL/SQL中的循环处理(sql for循环) 博客园添加访问人数统计 IIS故障问题(Connections_Refused)分析及处理 Windows Server 2008自定义桌面
CSS的display小记
牦牛 · 2013-02-24 · via 博客园 - 牦牛

     最近开始了解一些CSS的基本用法,巩固下自己的前端知识积累。
     我们经常在样式中做类似如下的定义:

display:inline
display:block
display:none

     这里的 display:inline 可以让块级元素,变为行内元素,且元素前后没有换行符;比如:

<div> DIV1 </div> 
<div> DIV2 </div> 

默认情况下,这2个div各占一行,也就是显示为上下两行,当加上样式后:

<div style= "display:inline "> DIV1 </div> 
<div style= "display:inline "> DIV2 </div>

这样2个div就能显示在同一行了。说实话,我以前都是用浮动来控制的,嘿嘿嘿。

      和 display:inline 对应的是 display:block。block 将元素显示为块级元素,且元素前后会带有换行符。比如,span就是行内元素,如果加了display:block 样式之后,这2个span就会分两行显示了:

<span style= "display:block "> SPAN1 </span> 
<span style= "display:block "> SPAN2 </span> 

     display:inline经常用在将多个div像span一样显示在一行,或者在 <ul> 中 多个<li>显示为一行,因为ul也是块级元素,一个li占一行。