- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我的 Accordion 有问题 - 只打开第一个元素。原因不是 data-target
。
当我在没有 CSS 的情况下运行我的代码时,它可以正常工作...我尝试从 css 中删除行以查看问题出在哪里,我发现问题出在 Z-INDEX 上。
因为我将每个可折叠元素放在最后一个元素之后,所以它们不可点击。我希望每个元素都在另一个元素后面的原因是因为每张卡片的底部边框 pd 是圆形的,所以我需要每个元素隐藏它后面的元素的顶部:
https://jsfiddle.net/81co7502/
<section class="mobileSection">
<section id="aboutMobile">
<header class="hamNav">
<div class="container-fluid accordionRow">
<div class="row ">
<div class="col-12 col-sm-12 col-md-12 col-lg-12 col-xl-12 colsAccordion">
<div class="accordion" id="accordionExample">
<div class="card" id="historyCard">
<div class="card-header" id="headingOne">
<h5 class="mb-0">
<button class="btn btn-link" type="button" data-toggle="collapse" data-target="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
היסטוריה
</button>
</h5>
</div>
<div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordionExample">
<div class="card-body">
Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird
on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table,
raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
</div>
</div>
</div>
<div class="card" id="whoWeAreCard">
<div class="card-header" id="headingTwo">
<h5 class="mb-0">
<button class="btn btn-link collapsed" type="button" data-toggle="collapse" data-target="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo">
מי אנחנו?
</button>
</h5>
</div>
<div id="collapseTwo" class="collapse" aria-labelledby="headingTwo" data-parent="#accordionExample">
<div class="card-body">
Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird
on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table,
raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
</div>
</div>
</div>
<div class="card" id="numbersCard">
<div class="card-header" id="headingThree">
<h5 class="mb-0">
<button class="btn btn-link collapsed" type="button" data-toggle="collapse" data-target="#collapseThree" aria-expanded="false" aria-controls="collapseThree">
"בשבילי" במספרים"
</button>
</h5>
</div>
<div id="collapseThree" class="collapse" aria-labelledby="headingThree" data-parent="#accordionExample">
<div class="card-body">
Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird
on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table,
raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
</div>
</div>
</div>
<div class="card" id="sayingCard">
<div class="card-header" id="headingThree">
<h5 class="mb-0">
<button class="btn btn-link collapsed" type="button" data-toggle="collapse" data-target="#collapseFour" aria-expanded="false" aria-controls="collapseThree">
צעירים אומרים...
</button>
</h5>
</div>
<div id="collapseFour" class="collapse" aria-labelledby="headingThree" data-parent="#accordionExample">
<div class="card-body">
Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird
on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table,
raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
</div>
</div>
</div>
<div class="card" id="contactCard">
<div class="card-header" id="headingThree">
<h5 class="mb-0">
<button class="btn btn-link collapsed" type="button" data-toggle="collapse" data-target="#collapseFive" aria-expanded="false" aria-controls="collapseThree">
צור קשר
</button>
</h5>
</div>
<div id="collapseFive" class="collapse" aria-labelledby="headingThree" data-parent="#accordionExample">
<div class="card-body">
Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird
on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table,
raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</header>
</section>
(在 fiddle 中,卡片看起来是矩形的,但在我的代码中它们底部有圆形边框)。
.hamNav {
margin-top: 50px;
}
#headingOne {
}
.card{
border-bottom-left-radius:50%;
border-bottom-right-radius:50%;
border:none;
}
#historyCard {
background-color: #ffb59b;
margin-top:-50px;
padding-top:60px;
}
#whoWeAreCard {
background-color: #ffe285;
margin-top: -80px;
padding-top: 70px;
z-index: -1;
}
#numbersCard {
background-color: #9abada;
margin-top: -90px;
padding-top: 80px;
z-index: -2;
}
#sayingCard {
background-color: #8adffa;
margin-top: -100px;
padding-top: 90px;
z-index: -3;
}
#contactCard {
background-color: #ffcd9b;
margin-top: -110px;
padding-top: 100px;
z-index: -4;
}
.card-header {
border: none;
background-color: rgba(0, 0, 0, 0);
height: 110px;
}
h5 {
text-align: center;
padding-top:25px;
}
有没有一种方法可以在不使用 z-index 的情况下实现我所需要的(一个元素隐藏后面元素的顶部)?
最佳答案
我认为您正在使用 padding
减去 margin
值来解决将 div 一个放在另一个后面的问题...检查下面的代码div 使用 :nth-child(99)
这样我们就不需要使用 ID(您也可以将它用于颜色)。
.card{ text-align: center; border-bottom-left-radius:25% !important;
border-bottom-right-radius:25% !important;
border:none !important; }
.card-header{padding: 30px; }
.accordion{ padding: 25px 0;}
#historyCard { background-color: #ffb59b; }
#whoWeAreCard { background-color: #ffe285; }
#numbersCard { background-color: #9abada; }
#sayingCard { background-color: #8adffa; }
#contactCard { background-color: #ffcd9b; }
.card:nth-child(1){top: -25px;}
.card:nth-child(2){top: -25px;}
.card:nth-child(3){top: -25px;}
.card:nth-child(4){top: -25px;}
.card:nth-child(5){top: -25px;}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.1.0/css/all.css" integrity="sha384-lKuwvrZot6UHsBSfcMvOkWwlCMgc0TaWr+30HWe3a4ltaBwTZhyTEggF5tJv8tbt" crossorigin="anonymous">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.0/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
<section class="mobileSection">
<section id="aboutMobile">
<header class="hamNav">
<div class="container-fluid accordionRow">
<div class="row ">
<div class="col-12 col-sm-12 col-md-12 col-lg-12 col-xl-12 colsAccordion">
<div class="accordion" id="accordionExample">
<div class="card" id="historyCard">
<div class="card-header" id="headingOne">
<h5 class="mb-0">
<button class="btn btn-link" type="button" data-toggle="collapse" data-target="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
היסטוריה
</button>
</h5>
</div>
<div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordionExample">
<div class="card-body">
Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird
on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table,
raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
</div>
</div>
</div>
<div class="card" id="whoWeAreCard">
<div class="card-header" id="headingTwo">
<h5 class="mb-0">
<button class="btn btn-link collapsed" type="button" data-toggle="collapse" data-target="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo">
מי אנחנו?
</button>
</h5>
</div>
<div id="collapseTwo" class="collapse" aria-labelledby="headingTwo" data-parent="#accordionExample">
<div class="card-body">
Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird
on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table,
raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
</div>
</div>
</div>
<div class="card" id="numbersCard">
<div class="card-header" id="headingThree">
<h5 class="mb-0">
<button class="btn btn-link collapsed" type="button" data-toggle="collapse" data-target="#collapseThree" aria-expanded="false" aria-controls="collapseThree">
"בשבילי" במספרים"
</button>
</h5>
</div>
<div id="collapseThree" class="collapse" aria-labelledby="headingThree" data-parent="#accordionExample">
<div class="card-body">
Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird
on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table,
raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
</div>
</div>
</div>
<div class="card" id="sayingCard">
<div class="card-header" id="headingThree">
<h5 class="mb-0">
<button class="btn btn-link collapsed" type="button" data-toggle="collapse" data-target="#collapseFour" aria-expanded="false" aria-controls="collapseThree">
צעירים אומרים...
</button>
</h5>
</div>
<div id="collapseFour" class="collapse" aria-labelledby="headingThree" data-parent="#accordionExample">
<div class="card-body">
Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird
on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table,
raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
</div>
</div>
</div>
<div class="card" id="contactCard">
<div class="card-header" id="headingThree">
<h5 class="mb-0">
<button class="btn btn-link collapsed" type="button" data-toggle="collapse" data-target="#collapseFive" aria-expanded="false" aria-controls="collapseThree">
צור קשר
</button>
</h5>
</div>
<div id="collapseFive" class="collapse" aria-labelledby="headingThree" data-parent="#accordionExample">
<div class="card-body">
Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird
on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table,
raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</header>
</section>
关于css - Bootstrap : Z-index makes element not clickable. 寻找一种将每个元素放在另一个元素后面的方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56702050/
我有这个应用程序,在注册屏幕上的复选框旁边应该是一个句子:我同意公司服务条款。 服务条款部分应该是可点击的,以便用户能够进入 ToS 屏幕(尽管用户永远不会这样做)。 问题是,这个应用程序将是多语言的
我创建了一个这样的 if 语句: if (lehrling == null) { ClientScript.RegisterStartupScript(this.GetType(), "ale
我正在创建一个站点,您可以在其中单击一个按钮,然后会显示一个小面板。 (就像 facebook 上的通知/消息面板) 该功能运行良好,但当面板隐藏时,您仍然可以将链接悬停在它们应该位于的位置,当它们可
我想让“搜索”按钮在点击回车后可点击。 这是我的 html: 这是我正在使用的 JavaScript: function searchKeyPress(e) { if (typeof e ==
我有一个WP7应用,我想在其中有一个“可单击的” TextBlock区域,当用户单击TextBlock时,它将置于编辑模式(另一个控件)。 这将在编辑文本之前为用户添加另一个明确的步骤。 TextBl
我创建了一个名为 ClickableRow 的类,它突出显示该行并更改其中所有 TextViews 的文本颜色,然后将该行返回到其初始设置当用户停止点击或滚动太远之后,但我觉得 android 可能已
在开发 Android 应用程序时,我有一个带有一些按钮的 Activity 。我希望 onClickListener 操作在用户立即将手指放在屏幕上时启动,这样他就不能同时单击两个按钮。 我在 iO
http://speedsociety.com/ 如果您查看我的网站,左侧边栏下方的 instagram 小部件都不可点击(在第一个之后)...是不是 content_wrapper div 阻止了它
如果你有一个正常的形式: 然后您可以填写输入字段,然后按回车键。但是,我正在使用链接来完成我的工作: Submit 这就像一个魅力,但是,我希望它继承普通提交字段具有的“可单击输入”。这
我正在创建一个可点击 div 列表,以显示一个弹出窗口,其中包含与所点击项目相关的信息。 每个列表项都假设列表最后一项的“单击”功能。当我删除最后一项时,它们都假定新的最后一项的“单击”功能。 (例如
我正在使用来自 Google 基于 HTML5 的网络应用程序 here 的翻页演示(教程 here 和演示 20 Things I Learned about Browsers and the We
这无疑是一个愚蠢的错误,但我正在疯狂地寻找它。在下面的日历代码中,如果有事件则链接和今天的链接不可点击。 请注意,我已将超链接替换为 www.google.com。在实际应用中它指向日历的每日 Vie
我想改变这个: Moo 要符合标准(你不应该在内联元素中有 block 元素)。将 javascript 连接到 div 仅用于导航似乎是一种 hack 并且会降低可访问性。在这种情况
Fiddle . 如果您将鼠标悬停在“CLOSE”和三 Angular 形的 :after 元素之间,则您无法单击该链接。 有没有一种方法可以使该区域可点击并且看起来仍然一样? HTML: Cl
我有一个不透明度为 0 的菜单 div,可见性最初是隐藏的。我基本上希望这个 div 在单击另一个 div 时可用(它是一个粘贴在我页面顶部的菜单,可通过单击发现/隐藏)。 效果很好....一次性..
我正在开发一个图片 uploader 。我有一个使用 https://codecanyon.net/item/slim-image-upload-and-ratio-cropping-plugin/1
有没有可能制作一个可点击并相应地触发一个 Action ? 这就是我的代码的样子,我也希望能够点击子菜单。
我们什么时候应该在 XML 中使用 android:clickable?我们应该永远吗? 这样的 XML 声明和代码内声明 myButton.setOnClickListener 之间有什么区别吗?我
我只是想这可能有用,但我找不到办法。 在 Notepad++ 中,有没有办法让函数名称“可点击”——即让它们成为链接,这样如果你点击它们,它会自动将你带到它的定义(最好是跨越整个代码库)? 最佳答案
我正在尝试在网站上选择付款方式。我有三个选择:SEPA、信用卡/借记卡、PayPal。我想点击贷方/借方。 It looks like this 这些选择在一个主 div 中,每个选择都在另一个包含输
我是一名优秀的程序员,十分优秀!