- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我一直在尝试在我的网站上使用静态图像,但页眉和图像之间存在很大差距,我尝试在 Photoshop 和 HTML 中删除填充并更改图像高度。这是我的问题的 fiddle https://jsfiddle.net/o27w80ve/
section.module:last-child {
margin-bottom: 0;
}
section.module h2 {
font-family: "Roboto Slab", serif;
font-size: 30px;
}
section.module p {
margin-bottom: 40px;
font-size: 16px;
font-weight: 300;
}
section.module p:last-child {
margin-bottom: 0;
}
section.module.content {
padding: 40px 0;
color: #090C02;
}
section.module.content#section1 {
background-color: #b23783;
}
section.module.content#section2 {
background-color: #3783b2;
}
section.module.parallax {
height: 600px;
background-position: 50% 50%;
background-repeat: no-repeat;
background-attachment: fixed;
background-size: cover;
}
section.module.parallax h1 {
color: #8FD5A6;
font-size: 48px;
line-height: 600px;
font-weight: 700;
text-align: center;
text-transform: uppercase;
text-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
font-family: 'Julius Sans One', sans-serif;
}
section.module.parallax-1 {
background-image: url("https://i.imgur.com/YpRAOt3.jpg");
}
@media all and (min-width: 600px) {
section.module h2 {
font-size: 42px;
}
section.module p {
font-size: 20px;
}
section.module.parallax h1 {
font-size: 96px;
}
}
@media all and (min-width: 960px) {
section.module.parallax h1 {
font-size: 160px;
}
}
.header ul {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-color: #1e1e20;
}
.header li {
float: right;
text-align: middle;
}
.header li a {
display: block;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
font-family: 'Bitter', serif;
}
.header li:hover {
background-color: #fec10e;
color: black;
}
<header class="header">
<div>
<ul>
<li><a href="/">Testr Co.</a></li>
<li><a href="#">Home</a></li>
<li><a href="#">About Us</a></li>
<li><a href="#">Blog</a></li>
</ul>
</div>
</header>
<section class="module parallax parallax-1">
<div class="container">
<h1>Example</h1>
</div>
</section>
最佳答案
这就是所谓的“ margin 崩溃”。 h1
上的默认 margin-top
在父级之外折叠。
https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Box_Model/Mastering_margin_collapsing
Parent and first/last child - If there is no border, padding, inline content, block_formatting_context created or clearance to separate the margin-top of a block from the margin-top of its first child block, or no border, padding, inline content, height, min-height, or max-height to separate the margin-bottom of a block from the margin-bottom of its last child, then those margins collapse. The collapsed margin ends up outside the parent.
section.module:last-child {
margin-bottom: 0;
}
section.module h2 {
font-family: "Roboto Slab", serif;
font-size: 30px;
}
section.module p {
margin-bottom: 40px;
font-size: 16px;
font-weight: 300;
}
section.module p:last-child {
margin-bottom: 0;
}
section.module.content {
padding: 40px 0;
color: #090C02;
}
section.module.content#section1 {
background-color: #b23783;
}
section.module.content#section2 {
background-color: #3783b2;
}
section.module.parallax {
height: 600px;
background-position: 50% 50%;
background-repeat: no-repeat;
background-attachment: fixed;
background-size: cover;
}
section.module.parallax h1 {
color: #8FD5A6;
font-size: 48px;
line-height: 600px;
font-weight: 700;
text-align: center;
text-transform: uppercase;
text-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
font-family: 'Julius Sans One', sans-serif;
margin-top: 0;
}
section.module.parallax-1 {
background-image: url("https://i.imgur.com/YpRAOt3.jpg");
}
@media all and (min-width: 600px) {
section.module h2 {
font-size: 42px;
}
section.module p {
font-size: 20px;
}
section.module.parallax h1 {
font-size: 96px;
}
}
@media all and (min-width: 960px) {
section.module.parallax h1 {
font-size: 160px;
}
}
.header ul {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-color: #1e1e20;
}
.header li {
float: right;
text-align: middle;
}
.header li a {
display: block;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
font-family: 'Bitter', serif;
}
.header li:hover {
background-color: #fec10e;
color: black;
}
<header class="header">
<div>
<ul>
<li><a href="/">Testr Co.</a></li>
<li><a href="#">Home</a></li>
<li><a href="#">About Us</a></li>
<li><a href="#">Blog</a></li>
</ul>
</div>
</header>
<section class="module parallax parallax-1">
<div class="container">
<h1>Example</h1>
</div>
</section>
关于标题和静态图像之间的 HTML 间隙,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44490226/
不确定是间隙还是音频样本未对齐,但是当我将音频文件一分为二时,如下所示: ffmpeg -ss 0 -t 00:00:15.00 -i song.mp3 seg1.mp3 和 ffmpeg -ss 0
我正在使用 NSDrawNinePartImage 绘制自定义按钮/文本字段。我在代码中将图像分割成九个部分,并使用 NSDrawNinePartImage 将其绘制到一个矩形中。 不幸的是,我在绘图
Check this image for the progressbar 知道如何消除 ProgressBar 下的那个小间隙吗?我怎样才能做到没有差距?应该通过 MainActivity 中的 ja
刚开始制作网站时,整个左侧都有几个像素的边距,但我不明白为什么。 http://jsbin.com/elufob/1/ 任何建议将不胜感激 CSS html{ min-width: 1
我一直在尝试在我的网站上使用静态图像,但页眉和图像之间存在很大差距,我尝试在 Photoshop 和 HTML 中删除填充并更改图像高度。这是我的问题的 fiddle https://jsfiddle
我前一段时间遇到过这个问题,忘记了解决方案是什么。我的文档顶部有一个小间隙,大概 5/10 像素? 我想你会知道我在说什么,我该如何摆脱它? 谢谢 最佳答案 在您的 CSS 文件中添加: html,
刚开始制作网站时,整个左侧都有几个像素的边距,但我不明白为什么。 http://jsbin.com/elufob/1/ 任何建议将不胜感激 CSS html{ min-width: 1
我正在尝试使用 Accordion MUI 组件在展开模式下不会移动,也不会对某些元素应用顶部和底部边距。 示例如下,但它不起作用,我的组件仍然太“跳跃”(扩展时它会增加宽度,并且添加了一些不可见的边
我有一个自定义 UITableViewCell Card 样式的动态高度,它的空间在应用程序中是恒定的。我正在使用 Storyboard ,并且在 UINavigationBar 下方有 UITool
假设您有一组日期范围 var arr = [ { "from": 'unix 1st of august', "until": 'unix 5th of august' },
我是radial-gradient的新手,我不知道这些多维数据集之间的背线或空格是什么?如何删除它们? * {margin: 0; outline: 0; border: 0;} .round {
我对 VBA 中的 HTML 正文有疑问。我创建了一封电子邮件并使用 HTML 填写信息。 我的问题描述如下: Reduce Gap between HTML and elements 但是我不能
我正在阅读 Lea Verou 的《CSS secret 》一书。 有一个圆 Angular 径向多重渐变的例子: http://dabblet.com/gist/24484257bc6cf7076a
我一直在为一个客户做一个元素,一切都很顺利,直到我注意到我的 h1/h2/h3(任何标题标签)已经向右移动了 2/3 像素。他们可能一直都在这样做,但我只是刚刚注意到。当您在 devtools 中突出
这里是 CSS 新手。奇怪的事情发生了,链接之间有间隙,我不知道为什么。 我正在使用 html html5 样板 css 进行重置。 HTML代码: Link 1 Link
这个问题在这里已经有了答案: margin on h1 element inside a div (3 个答案) 关闭 6 年前。 我有一个问题,我的 h1 标签与我的页面顶部分开 - 像这样:en
我希望我的文本在事件时带有下划线,但当我这样做时它看起来像这样: 我只希望文本有下划线,如果我使用 text-decoration:underline 它会在单词下划线,但我不知道如何在文本和下划线之
我似乎无法将这两张图片放在一起。它们都在 HTML 表格中自己的行中(我正在制作一封 html 电子邮件),但我似乎无法删除它们之间的 5px。 这是我的代码 它也在 jsfi
我正在尝试在我的项目中使用新的 CardView UI 小部件,但在某些运行 android 2.3 的设备上,CardView 角之间存在间隙(见下文)。 这是在我的 xml 文件中:
我想了解并学习当我使用共享边框填充两个形状/路径时遇到的问题的解决方案,即在为所有形状调用填充后,仍然有一个微小的间隙存在于他们之间。 该代码片段展示了绘制所涉及的形状/路径的代码: ctx.begi
我是一名优秀的程序员,十分优秀!