- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我的基本要求是制作一个包含 50% 红色(左)和 50% 白色(右)的 2 列,左列有文本,右列有图像。它与我的解决方案在大屏幕到普通屏幕上配合得很好。使用 bootstrap 4,2 列自然会从一侧到另一侧顶部和底部。由于我使用“线性渐变”制作背景颜色,因此我进行了快速媒体查询并将颜色设置为 top 和 bottom 。
问题是,我不得不总是弄乱/编写不同的媒体查询,并且一个屏幕尺寸总是像这样中断
我写了多个媒体查询和图像列的颜色百分比和最大高度的调整。看来我从根本上做错了什么。有没有更好的 Bootstrap 解决方案?还是适用于所有屏幕的更好的 css 方式?
.app-headline {
background: linear-gradient(to left, #fff 50%, #d4272e 50%);
}
@media screen and (max-width: 992px) {
.app-headline {
background: linear-gradient(to bottom, #d4272e 52.2%, #fff 50%);
}
.app-headline .text-content-left {
background: #d4272e;
}
.app-headline .img-content-right {
background: #fff;
max-height: 24rem;
}
}
@media screen and (max-width: 768px) {
.app-headline {
background: linear-gradient(to bottom, #d4272e 59.9%, #fff 50%);
}
.app-headline .img-content-right {
background: #fff;
max-height: 17rem;
}
}
@media (min-width: 768px) and (max-width: 768px) {}
<html>
<head>
<title>Products slider</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO"
crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="css/style.css">
<link href="http://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css" rel="stylesheet">
<script src="https://code.jquery.com/jquery-3.3.1.js" integrity="sha256-2Kok7MbOyxpgUVvAk/HJ2jigOSYS2auK4Pfzbm7uH60="
crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy"
crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49"
crossorigin="anonymous"></script>
</head>
<body>
<div class="pt-4 pb-4">
<h1>test</h1>
</div>
<section class="app-headline border">
<div class="container">
<div class="row py-5 text-white">
<div></div>
<div class="col-lg-6 pb-4 text-content-left">
<div class="text-content-left-texts">
<div class="inner-push-left">
<h1 class="pb-4">H2 Apps Headline Here</h1>
<P class="pb-2 col-sm-10 pl-0">Modi tempora incidunt ut labore et dolore magnam aliquam
quaerat voluptatem. Ut enim ad minima veniam, laboriosam,
nisi ut aliquid ex ea commodi conaliquid sequatur incidunt ut
labore et dolore magnam. </P>
<h5 class="pb-1">Features / Benefits</h5>
<ul class="pl-3 border border-top-0 border-left-0 border-right-0 pb-5">
<li>Modi tempora incidunt ut labore et dolore</li>
<li>Amagnam aliquam quaerat voluptatem</li>
<li>Ut enim ad minima veniam, laboriosa</li>
</ul>
<div class="d-flex justify-content-between mt-4">
<div class="pt-1">
<h3>Get The App</h3>
</div>
<div class="">
<div class="pt-0 ">
<a href="#">
<img src="https://www.dropbox.com/s/6m9hg1krramk5fa/Apple-store.png?dl=1" alt="" class="img-fluid pr-3">
</a>
<a href="#">
<img src="https://www.dropbox.com/s/6m9hg1krramk5fa/Apple-store.png?dl=1" alt="" class="img-fluid pr-3">
</a> </div>
</div>
</div>
</div>
</div>
</div>
<div class="col-lg-6 img-content-right align-self-center">
<img class="content-right-image img-fluid" src="https://www.dropbox.com/s/i2cbe0ymwywya5f/app.png?dl=1" alt="there was an image">
</div>
</div>
</div>
</section>
<script type="text/javascript">
</script>
</body>
</html>
<!--
<section class="product-promotion-display border">
<div class="">
<div class="row no-gutters d-flex justify-content-center text-white">
<div class="col-lg-6 text-content-left d-flex justify-content-center align-items-center pb-4">
<div class="text-content-left-texts p-5 ">
<div class="inner-push-left offset-lg-3">
<h1 class="pb-4">H2 Apps Headline Here</h1>
<P class="pb-2">Modi tempora incidunt ut labore et dolore magnam aliquam
quaerat voluptatem. Ut enim ad minima veniam, laboriosam,
nisi ut aliquid ex ea commodi conaliquid sequatur incidunt ut
labore et dolore magnam. </P>
<h5 class="pb-1">Features / Benefits</h5>
<ul class="pl-3 border border-top-0 border-left-0 border-right-0 pb-5">
<li>Modi tempora incidunt ut labore et dolore</li>
<li>Amagnam aliquam quaerat voluptatem</li>
<li>Ut enim ad minima veniam, laboriosa</li>
</ul>
<div class="d-flex justify-content-between mt-4">
<div class="pt-1">
<h3>Get The App</h3>
</div>
<div class="">
<div class="pt-0 ">
<a href="#">
<img src="https://www.dropbox.com/s/6m9hg1krramk5fa/Apple-store.png?dl=1" alt="" class="img-fluid pr-3">
</a>
<a href="#">
<img src="https://www.dropbox.com/s/6m9hg1krramk5fa/Apple-store.png?dl=1" alt="" class="img-fluid pr-3">
</a> </div>
</div>
</div>
</div>
</div>
</div>
<div class="col-lg-6 d-flex justify-content-center align-items-center img-content-right">
<img class="content-right-image img-fluid" src="./images/toolbox.png" alt="there was an image">
</div>
</div>
</div>
</section> -->
最佳答案
您需要从媒体查询中删除以下内容,您可以尝试使用伪元素进行着色以创建溢出并隐藏白色部分:
.app-headline .text-content-left {
background: #d4272e;
}
完整代码:
.app-headline {
background: linear-gradient(to left, #fff 50%, #d4272e 50%);
overflow:hidden;
}
@media screen and (max-width: 992px) {
.app-headline {
background: linear-gradient(to bottom, #d4272e 52.2%, #fff 50%);
}
.app-headline .text-content-left {
position:relative;
z-index:0;
}
.app-headline .text-content-left::before {
content:"";
position:absolute;
top:0;
left:-50vw;
right:-50vw;
bottom:0;
z-index:-1;
background: #d4272e;
}
.app-headline .img-content-right {
background: #fff;
max-height: 24rem;
}
}
@media screen and (max-width: 768px) {
.app-headline {
background: linear-gradient(to bottom, #d4272e 59.9%, #fff 50%);
}
.app-headline .img-content-right {
background: #fff;
max-height: 17rem;
}
}
@media (min-width: 768px) and (max-width: 768px) {}
<html>
<head>
<title>Products slider</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO"
crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="css/style.css">
<link href="http://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css" rel="stylesheet">
<script src="https://code.jquery.com/jquery-3.3.1.js" integrity="sha256-2Kok7MbOyxpgUVvAk/HJ2jigOSYS2auK4Pfzbm7uH60="
crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy"
crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49"
crossorigin="anonymous"></script>
</head>
<body>
<div class="pt-4 pb-4">
<h1>test</h1>
</div>
<section class="app-headline border">
<div class="container">
<div class="row py-5 text-white">
<div></div>
<div class="col-lg-6 pb-4 text-content-left">
<div class="text-content-left-texts">
<div class="inner-push-left">
<h1 class="pb-4">H2 Apps Headline Here</h1>
<P class="pb-2 col-sm-10 pl-0">Modi tempora incidunt ut labore et dolore magnam aliquam
quaerat voluptatem. Ut enim ad minima veniam, laboriosam,
nisi ut aliquid ex ea commodi conaliquid sequatur incidunt ut
labore et dolore magnam. </P>
<h5 class="pb-1">Features / Benefits</h5>
<ul class="pl-3 border border-top-0 border-left-0 border-right-0 pb-5">
<li>Modi tempora incidunt ut labore et dolore</li>
<li>Amagnam aliquam quaerat voluptatem</li>
<li>Ut enim ad minima veniam, laboriosa</li>
</ul>
<div class="d-flex justify-content-between mt-4">
<div class="pt-1">
<h3>Get The App</h3>
</div>
<div class="">
<div class="pt-0 ">
<a href="#">
<img src="https://www.dropbox.com/s/6m9hg1krramk5fa/Apple-store.png?dl=1" alt="" class="img-fluid pr-3">
</a>
<a href="#">
<img src="https://www.dropbox.com/s/6m9hg1krramk5fa/Apple-store.png?dl=1" alt="" class="img-fluid pr-3">
</a> </div>
</div>
</div>
</div>
</div>
</div>
<div class="col-lg-6 img-content-right align-self-center">
<img class="content-right-image img-fluid" src="https://www.dropbox.com/s/i2cbe0ymwywya5f/app.png?dl=1" alt="there was an image">
</div>
</div>
</div>
</section>
<script type="text/javascript">
</script>
</body>
</html>
<!--
<section class="product-promotion-display border">
<div class="">
<div class="row no-gutters d-flex justify-content-center text-white">
<div class="col-lg-6 text-content-left d-flex justify-content-center align-items-center pb-4">
<div class="text-content-left-texts p-5 ">
<div class="inner-push-left offset-lg-3">
<h1 class="pb-4">H2 Apps Headline Here</h1>
<P class="pb-2">Modi tempora incidunt ut labore et dolore magnam aliquam
quaerat voluptatem. Ut enim ad minima veniam, laboriosam,
nisi ut aliquid ex ea commodi conaliquid sequatur incidunt ut
labore et dolore magnam. </P>
<h5 class="pb-1">Features / Benefits</h5>
<ul class="pl-3 border border-top-0 border-left-0 border-right-0 pb-5">
<li>Modi tempora incidunt ut labore et dolore</li>
<li>Amagnam aliquam quaerat voluptatem</li>
<li>Ut enim ad minima veniam, laboriosa</li>
</ul>
<div class="d-flex justify-content-between mt-4">
<div class="pt-1">
<h3>Get The App</h3>
</div>
<div class="">
<div class="pt-0 ">
<a href="#">
<img src="https://www.dropbox.com/s/6m9hg1krramk5fa/Apple-store.png?dl=1" alt="" class="img-fluid pr-3">
</a>
<a href="#">
<img src="https://www.dropbox.com/s/6m9hg1krramk5fa/Apple-store.png?dl=1" alt="" class="img-fluid pr-3">
</a> </div>
</div>
</div>
</div>
</div>
</div>
<div class="col-lg-6 d-flex justify-content-center align-items-center img-content-right">
<img class="content-right-image img-fluid" src="./images/toolbox.png" alt="there was an image">
</div>
</div>
</div>
</section> -->
关于twitter-bootstrap - Css linear-gradient 50% left and right To top and bottom on mobile 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53842268/
我想替换以下特定于 Mozilla 的 CSS 规则: background: -moz-linear-gradient(center top , #F5F5F5, #E4E4E4); 使用标准 li
我正在将 MatLab 程序转换为 Python,我无法理解为什么 scipy.interpolate.interp2d(linear) 给出的结果与 MatLab interp2(linear) 不
我目前在自然语言处理方面开发的应用程序存在严重的性能问题。基本上,对于给定的文本,它会收集各种数据并进行一些数字运算。 对于每一个句子,它的作用完全相同。用于收集统计数据的算法不会随着先前读取的数据而
我正在为一个基本的 Android 计算器开发水平 View ,我有一个名为 linearLayout2 的 LinearLayout > 我试图将它放在 linearLayout3 之上,其中包含数
我为按钮的背景使用了一些 CSS,但它在 Firefox、Chrome 和 IE 中看起来不同。 我正在使用 -webkit-linear-gradient 和 -moz-linear-gradien
TL;DR -webkit-linear-gradient 正在打破 -moz-linear-gradient 听说是个难题,我使用的是带有两个 handle 的 Jquery Slider 插件,我
我突然想到,例如,假设我们有二维 N 点的训练数据。我们知道我们总是可以天真地构建一个决策树,以便我们可以对每个数据点进行分类。 (可能我们过拟合了,深度可以到2N) 但是,我们知道如果数据集是线性可
我对插值函数的一般求根问题感兴趣。 假设我有以下 (x, y)数据: set.seed(0) x = x[i]) & (rroots <= x[i + 1])] ## next piece
我有一个线性优化目标来最大化 EE+FF,其中 EE 和 FF 每个都包含一些 C 和 D。 使用我编写的代码,我可以让求解器找到: EE_quantity: 0, FF_quantity: 7 ..
我一直在寻找这个问题,但我无法理解这个问题的含义。 问题: Write a program in any language to determine how your computer handles
我在 Python 中有一个简单的线性多元回归,如下所示: X_train,X_test,y_train,y_test=train_test_split(x_cols,df['Volume'],tes
关闭。这个问题是off-topic .它目前不接受答案。 想改善这个问题吗? Update the question所以它是 on-topic对于堆栈溢出。 10年前关闭。 Improve this
对于大型稀疏迭代(共轭梯度、MINRES、GMRES 等)线性代数系统求解,有哪些更好的库?我经常编写自己的程序,但我很想知道人们更喜欢哪种“现成的”软件包。我听说过 PETSc、TAUCS、IML+
这是我的全部问题: 信息: *最大限度。总投资:125美元 *支付是购买的单位x支付/单位的总和 *每笔投资成本:买入成本+成本/单位x单位数量(如果您购买至少一个单位) *费用为每笔投资费用之和 限
我有两个变量:x>= 0 和 y 二进制(0 或 1),我有一个常数 z >= 0。如何使用线性约束来描述以下条件: If x = z then y = 1 else y = 0. 我试图通过定义另一
我正在尝试做一些逻辑上应该可以做的事情。但是,我不确定如何在线性规划领域内做到这一点。我正在使用 ZMPL/SCIP,但这对大多数人来说应该是可读的。 set I := {1,2,3,4,5}; pa
我正在为我的期中考试做准备,我正在解决算法书中的一些问题,但似乎无法弄清楚以下问题: 在实数 a 和 b 上找出线性规划的充分必要条件 max: x+y ax + by 0 (a) 是不可行的。 (b
我正在做一个 Java 项目,我必须计算一个多元线性回归,但我希望得到的参数是非负的。是否有现有的商业友好许可图书馆来做这样的事情?我一直在寻找非负最小二乘库,但没有成功。 最佳答案 好吧,我找不到任
密集线性代数在现实世界中的常见应用是什么? 使用线性代数作为人机之间的通用语言,可以轻松描述和高效计算许多问题。尽管这些系统通常需要稀疏矩阵的解,而不是稠密矩阵。违反此规则的常见应用有哪些? 我很好奇
我如何找到 广义特征值、向量 使用 Eigen3 图书馆? 在 Octave ,matlab,特征值函数的形式是:[V, lambda] = eig (A, B) . 我只能找到 this 类(cla
我是一名优秀的程序员,十分优秀!