span margin is not working
来源:互联网 发布:同济大学软件研究生 编辑:程序博客网 时间:2024/04/30 19:18
Unlike div, p 1 which are Block Level elements which can take up margin on all sides,span cannot as it’s an Inline element which takes up margins horizontally only.
From the specification :
Margin properties specify the width of the margin area of a box. The ‘margin’ shorthand property sets the margin for all four sides while the other margin properties only set their respective side. These properties apply to all elements, but vertical margins will not have any effect on non-replaced inline elements.
Demo 1 (Vertical margin not applied as span is an inline element)
Solution? Make your span element, display: inline-block; or display: block;.
Demo 2
Would suggest you to use display: inline-block; as it will be inline as well as block. Making it block only will result your element to render on another line, as block level elements take 100% of horizontal space on the page, unless they are made inline-block or they are floated to left or right.
- span margin is not working
- FrameLayout margin not working
- Why RequestContext is not working?
- devicePolicyManager.lockNow() is not working
- Zend_Db_Table::getDefaultAdapter is not working
- IE e.target.id is not working
- svn: 'codeswork' is not a working copy
- is not a working copy direct
- svn is not a working copy directory
- svn: warning: '.' is not a working copy
- Why is .innerText not working in Firefox?
- Spring AOP Interceptor transaction is not working
- ORDER BY clause is not working properly
- SVN Path is not a working copy
- [Kibana > Timelion] Timelion.json is not working
- SVN Path is not a working copy directory
- Myeclipse--SVN Path is not a working copy directory
- SVN Path is not a working copy directory解决
- Kafka设计解析:Kafka High Availability (上)
- ORA-01427:single-row subquery returns more than one row
- eclipse搭建NDK开发环境
- hbase_2_good
- 常见的Android 内存泄漏问题
- span margin is not working
- Cmake 编译opengl开源库glfw工程及使用
- 先做个小计划吧
- iOS 服务器文件有修改才进行下载
- iOS录音,调用麦克风话筒
- C#入门9.13——类的多态
- PHP学习:函数
- struts.xml(一)的<action-mappings>标签详解
- Fragment异常:Binary XML file line XXX: Error inflating class fragment