- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我有以下部分,我需要大约 85px
的顶部填充和底部填充。
所以我的部分如下所示:
我的 body 元素的 font-size
为 16px
,因此我将以下样式应用于填充部分:
.careers-highlight-contact-section {
padding-top: 5.31rem;
padding-bottom: 5.31rem;
}
我得到 5.31 的方式是 85/16,但现在当我检查计算值时,我看到 padding top 和 padding bottom 实际上是 53px
。它是如何得出这个值的?
您可以在此链接上看到此错误 here .
如果您将填充值从 rem 更改为 em,那么您将获得正确的高度。为什么会这样?
最佳答案
如果您引用 W3C 规范,rem
单位定义为:
Equal to the computed value of ‘font-size’ on the root element.
When specified on the ‘font-size’ property of the root element, the ‘rem’ units refer to the property's initial value.
因此,根据我的评论,rem
它的计算基于在根元素上声明的字体大小,即 <html>
元素而不是 <body>
元素。只要申报font-size: 16px
在前者上,您会看到将计算出正确的填充。
关于css - rem 不输出相对于 body 字体的值,em 工作正常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45613844/
我遇到了这个错误: java.lang.IllegalArgumentException: Removing a detached instance model.student 然后我在stackov
em在中是什么意思 ... 这是从 firefox 插件 install.rdf 文件中提取的。我很好奇 em 部分添加了什么。我在 Google 上也找不到解决方案。 最佳答案 em 是包含 des
在如下所示的脚本中 create queue one create queue two create topic three 如何评论一行? 最佳答案 我可以在工具本身或文档中找到注释。 您可以做的最
谁能解释一下为什么 Redis (redis-rb) 同步驱动程序直接在 EM.synchrony block 下工作,但不在 EM:Connection 内工作? 考虑下面的例子 EM.sy
在下面,我需要得到: String regex = "Item#: .*"; String content = "xxx Item#: something yyy"; Pattern pattern
em 和 % 在文本大小调整和固定宽度站点方面有什么区别?如果我使用 em 或 % 仅用于固定宽度站点中的文本大小调整,并且正文设置为 {body:font-size:100%} 在可访问性和移动设备
这两个 CSS 语句有什么区别: h1 em { color:#ddd; } 和 h1 > em { color:#ddd; } 据我所知他们做的是完全一样的事情(虽然根据我在 W3C 上读到的第一种
在CSS3 CSS Fonts Module Level 3 (candidate Oct 13) , 在第 2.3 节中有一个对“EM 盒”的引用和一个对“EM 单元”的引用。引用如下: [The
em.find(Enity.classs, Id) em.createQuery("SELECT e From Entity e WHERE e.Id=:id") 它们是等价的吗?如果不是,它们有何不
在 CSS 中,em 是一个基于文档字体大小的相对单位。那么,如果文档本身 的字体大小以em 为单位,那么em 到底是什么?假设我们说: body { font-size: 1em; }
有实体 /** * @ORM\Entity(repositoryClass="Some\Namspace\CustomRepository") * @ORM\Table(name="image_t
您好,我有一个关于 Doctrine 的快速问题以及 merge() 和 persist() 之间的区别 我有一个 NewsBuilder 类: 这需要一个新闻实体并检查它是否存在于数据库,如果存在,
我有下面的代码,想知道 JPA 如何知道保留此更新。我预计需要 em.merge() 才能执行更新。这真的安全吗? @Stateless class User { ... public
在 JPA 中,是否保证以下片段的事务语义(=从数据库的角度来看的效果)是相同的? 片段A EntityManager em = ... List workList = ... for(Work wo
我现在正在使用 EventMachine 玩了几天,恕我直言,它的学习曲线很陡;-) 我尝试通过触发回调中需要的 HttpHeaderCrawler.query() 来返回哈希。但是在这种情况下我得到
我有以下 HTML 代码: Hello World 我正在设计它的样式: h1 {font-size:100pt} 如何将此 100pt 转换为 EM 和 REM? 最佳答案 在 CSS 中, - p
我是 OpenCV 和 C++ 的新手,我正在尝试使用 OpenCV 中的高斯混合模型构建分类器。我弄清楚了它是如何工作的,并让它工作了……也许吧。我现在得到了这样的东西: 如果我在模型训练和保存后立
我们有一个 TIBCO EMS 解决方案,它在 2-4 服务器环境中使用内置服务器故障转移。如果 TIBCO 管理员将服务从一台 EMS 服务器故障转移到另一台,则连接应该会在 EMS 服务级别自动转
YUI 中的这一行 Reset CSS给我带来了麻烦: address,caption,cite,code,dfn,em,strong,th,var { font-style: normal;
我想并发下载网页,所以我找到了这些库, 但是我分不清em-synchrony和em-http-request的关系? 我查看了每个存储库的 github,但似乎所有示例都是关于自己的, 但是从一些文章
我是一名优秀的程序员,十分优秀!