- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在制作一个容器,用户可以在其中同时查看注册和登录 <div>
与 MDBoostrap .问题是,当用户单击一个选项卡时,该选项卡处于事件类中,然后我想为文本添加下划线。所以我在我的 html 中使用了下面的 css。一切都按我的需要工作正常,但下划线应用于 DIV 中的所有元素。谁能帮我解决这个问题。如何从其他元素中删除此下划线。谢谢
<html>
<head>
<!-- Font Awesome -->
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.2/css/all.css">
<!-- Bootstrap core CSS -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet">
<!-- Material Design Bootstrap -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/mdbootstrap/4.8.9/css/mdb.min.css" rel="stylesheet">
<!-- JQuery -->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<!-- Bootstrap tooltips -->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.4/umd/popper.min.js"></script>
<!-- Bootstrap core JavaScript -->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.3.1/js/bootstrap.min.js"></script>
<!-- MDB core JavaScript -->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mdbootstrap/4.8.9/js/mdb.min.js"></script>
<style>
@import url('https://fonts.googleapis.com/css?family=Hind');
@import url('https://fonts.googleapis.com/css?family=Open+Sans');
/* for searchbar with logo starts*/
.input-group.md-form.form-sm.form-2 input {
border: 1px solid #bdbdbd;
border-top-left-radius: 0.25rem;
border-bottom-left-radius: 0.25rem;
}
.input-group.md-form.form-sm.form-2 input.red-border {
border: 1px solid #ef9a9a;
}
.input-group.md-form.form-sm.form-2 input.lime-border {
border: 1px solid #cddc39;
}
.input-group.md-form.form-sm.form-2 input.amber-border {
border: 1px solid ash;
}
/* for searchbar with logo ends*/
/*for Shapes from https://bennettfeely.com/clippy starts*/
#firstCard {
clip-path: polygon(75% 0%, 100% 50%, 75% 100%, 0% 100%, 25% 50%, 0% 0%);
}
#firstCardStart {
clip-path: polygon(0% 0%, 75% 0%, 100% 50%, 75% 100%, 0% 100%);
}
#lastCardEnds {
clip-path: polygon(100% 0, 100% 50%, 100% 100%, 0% 100%, 25% 50%, 0% 0%);
background-color: red;
}
/*for Shapes from https://bennettfeely.com/clippy ends*/
/*defining custom colors strats*/
.customred {
color: #f11523;
}
.customBackgroundColorRed {
background-color: #f11523;
}
.custobodycolor {
background-color: #f5f5f5;
font-family: 'Open Sans';
}
.customenjoy {
background-color: #ffffff;
}
.customBorder1px {
border: 1px solid #dcdcdc;
}
/*defining custom colors ends*/
/* Defining custom heights starts*/
.customHeight100 {
min-height: 100px;
}
.customMinHeight90 {
min-height: 50px;
}
/* Defining custom heights starts*/
/*custom alignments start*/
.cuctommarginleft30 {
margin-left: 30%;
}
.cuctommarginleft40 {
margin-left: 40%;
}
.customMarginTop38px {
margin-top: 38px;
}
.customMarginBottom38px {
margin-bottom: 38px;
}
/*custom alignments ends*/
/*Custom font sizes starts*/
.textSize12px {
font-size: 12px;
}
.textSize10px {
font-size: 10px;
}
.textSize14px {
font-size: 14px;
}
.textSize16px {
font-size: 16px;
}
.textSize22px {
font-size: 22px;
}
.textSize40px {
font-size: 40px;
}
/*Custom font weights starts*/
.customFontWeight450 {
font-weight: 450;
}
/*Custom font weights ends */
/*Custom font sizes ends */
.customWidth50px {
width: 50px;
}
@media (min-width: 768px) {
.carousel-multi-item-2 .col-md-3 {
float: left;
width: 25%;
max-width: 100%;
}
}
.carousel-multi-item-2 .card img {
border-radius: 2px;
}
.arialroundedmtbold {
font-family: 'Hind';
font-size: 16px;
font-weight: bold;
}
#arialroundedmtboldEnjoy {
font-family: 'Hind';
font-size: 50px;
}
.textMyriadPro {
font-size: 14px;
color: #757575;
}
.enjoresult {
font-size: 20px;
margin-left: 5px;
}
#fontsize40 {
font-size: 140px;
}
#borderHover:hover {
box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.10), 0 2px 3px 0 rgba(0, 0, 0, 0.10);
}
.listgroup {
font-family: Roboto, sans-serif;
font-size: 14px;
color: #757575;
list-style: none;
text-decoration: none;
height: 25px;
padding-left: 10px;
}
.listgroup:hover {
color: #f2230c;
background-color: #eceff2;
}
.customMarginTop15px {
margin-top: 15px;
}
.customMarginBottom15px {
margin-bottom: 15px;
}
.color000 {
color: #000;
}
.color757575 {
color: #757575;
}
.fontsans {
font-family: 'Open Sans', sans-serif;
}
#hoverHeart:hover {
color: red;
}
.topicFontFamily {
font-family: Roboto, sans-serif;
}
#noBoxShadow {
box-shadow: none;
}
.instacolor {
color: transparent;
background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%);
background: -webkit-radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%);
background-clip: text;
-webkit-background-clip: text;
}
.noBoxShadow {
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
}
.verticalCenter {
vertical-align: middle;
}
</style>
</head>
<body>
<div class="container">
<div class="row mt-4">
<div class="col-12 card">
<!-- Nav tabs -->
<ul class="nav mb-4 mt-4" id="myTabAttr" role="tablist">
<li class="nav-item">
<a class="nav-link active" id="signin-tab-attr" data-toggle="tab" href="#signin-attr" role="tab" aria-controls="signin-attr" aria-selected="true">SIGN IN</a>
</li>
<li class="nav-item">
<a class="nav-link" id="register-tab-attr" data-toggle="tab" href="#register-attr" role="tab" aria-controls="register-attr" aria-selected="false">REGISTER</a>
</li>
</ul>
<style>
#signin-tab-attr:hover {
text-decoration: underline;
}
.active,
#signin-tab-attr:hover {
color: red;
text-decoration: underline;
}
#register-tab-attr:hover {
text-decoration: underline;
}
.active,
#register-tab-attr:hover {
color: red;
text-decoration: underline;
}
</style>
<!-- Tab panes -->
<div class="tab-content">
<!--Sigin starts -->
<div class="tab-pane active" id="signin-attr" role="tabpanel" aria-labelledby="signin-tab-attr">
<form>
<div class="form-group">
<input type="text" name="username" class="form-control" placeholder="Username">
</div>
<div class="form-group">
<input type="password" name="password" class="form-control" placeholder="Password">
</div>
<div class="form-group ">
<input type="checkbox" tabindex="3" class="" name="remember" id="remember">
<label for="remember" style="color: black"> Remember Me</label>
</div>
<button type="submit" style="" type="button" class="ml-0 mb-3 p-2 btn customBackgroundColorRed text-white btn-lg btn-block noBoxShadow ">
<p class=" text-capitalize textSize16px font-weight-bold m-0">Sign in</p>
</button>
<div class="form-group">
<div class="row">
<div class="col-lg-12">
<div class="">
<a href="#" tabindex="5" class="forgot-password float-">Forgot Password?</a>
</div>
</div>
</div>
</div>
</form>
</div>
<!--Sigin ends -->
<!-- Register starts -->
<div class="tab-pane" id="register-attr" role="tabpanel" aria-labelledby="register-tab-attr">
<div class="tab-pane active" id="signin-attr" role="tabpanel" aria-labelledby="signin-tab-attr">
<form>
<div class="form-group">
<input type="text" name="email" class="form-control" placeholder="Email">
</div>
<div class="form-group">
<input type="password" name="createPassWord" class="form-control" placeholder="Create password">
</div>
<div class="form-group">
<input type="password" name="reTypePassword" class="form-control" placeholder="Re-type Password">
</div>
<div class="form-group pt-1 pb-1 ">
<input type="checkbox" class="" name="iAgree" id="iAgree">
<label for="iAgree " class="textSize12px verticalCenter mt-1" style="color: black">I agree to Surf2Ship <a href="#">Terms and conditions</a> and <a href="#">Privacy Policies</a></label>
</div>
<button type="submit" style="" type="button" class="ml-0 mb-3 p-2 btn customBackgroundColorRed text-white btn-lg btn-block noBoxShadow ">
<p class=" text-capitalize textSize16px font-weight-bold m-0">Register</p>
</button>
<div class="form-group">
<div class="row">
<div class="col-lg-12">
<div class="text-center textSize14px">
<p style="color: black">or connect via</p>
</div>
</div>
</div>
</div>
<div class="form-group">
<div class="row">
<div class="col-lg-12 mb-3">
<div class="text-center verticalCenter">
<a href="" class="pr-4"><i class="fab fa-facebook textSize40px"></i></a>
<a> <img class="ml-4" style="width:35px;height:35px;vertical-align: middle;margin-top: -18;" src="googleicon.png" role="button"></a>
</div>
</div>
</div>
</div>
</form>
</div>
</div>
<!--Reister ends-->
</div>
</div>
</div>
</div>
</body></html>
这是快照
最佳答案
您只需将 CSS 应用于需要它的元素。在下面找到修改后的代码。
.nav-link.active,
.nav-link:hover {
color: red;
text-decoration: underline;
}
/* for searchbar with logo starts*/
.input-group.md-form.form-sm.form-2 input {
border: 1px solid #bdbdbd;
border-top-left-radius: 0.25rem;
border-bottom-left-radius: 0.25rem;
}
.input-group.md-form.form-sm.form-2 input.red-border {
border: 1px solid #ef9a9a;
}
.input-group.md-form.form-sm.form-2 input.lime-border {
border: 1px solid #cddc39;
}
.input-group.md-form.form-sm.form-2 input.amber-border {
border: 1px solid ash;
}
/* for searchbar with logo ends*/
/*for Shapes from https://bennettfeely.com/clippy starts*/
#firstCard {
clip-path: polygon(75% 0%, 100% 50%, 75% 100%, 0% 100%, 25% 50%, 0% 0%);
}
#firstCardStart {
clip-path: polygon(0% 0%, 75% 0%, 100% 50%, 75% 100%, 0% 100%);
}
#lastCardEnds {
clip-path: polygon(100% 0, 100% 50%, 100% 100%, 0% 100%, 25% 50%, 0% 0%);
background-color: red;
}
/*for Shapes from https://bennettfeely.com/clippy ends*/
/*defining custom colors strats*/
.customred {
color: #f11523;
}
.customBackgroundColorRed {
background-color: #f11523;
}
.custobodycolor {
background-color: #f5f5f5;
font-family: 'Open Sans';
}
.customenjoy {
background-color: #ffffff;
}
.customBorder1px {
border: 1px solid #dcdcdc;
}
/*defining custom colors ends*/
/* Defining custom heights starts*/
.customHeight100 {
min-height: 100px;
}
.customMinHeight90 {
min-height: 50px;
}
/* Defining custom heights starts*/
/*custom alignments start*/
.cuctommarginleft30 {
margin-left: 30%;
}
.cuctommarginleft40 {
margin-left: 40%;
}
.customMarginTop38px {
margin-top: 38px;
}
.customMarginBottom38px {
margin-bottom: 38px;
}
/*custom alignments ends*/
/*Custom font sizes starts*/
.textSize12px {
font-size: 12px;
}
.textSize10px {
font-size: 10px;
}
.textSize14px {
font-size: 14px;
}
.textSize16px {
font-size: 16px;
}
.textSize22px {
font-size: 22px;
}
.textSize40px {
font-size: 40px;
}
/*Custom font weights starts*/
.customFontWeight450 {
font-weight: 450;
}
/*Custom font weights ends */
/*Custom font sizes ends */
.customWidth50px {
width: 50px;
}
@media (min-width: 768px) {
.carousel-multi-item-2 .col-md-3 {
float: left;
width: 25%;
max-width: 100%;
}
}
.carousel-multi-item-2 .card img {
border-radius: 2px;
}
.arialroundedmtbold {
font-family: 'Hind';
font-size: 16px;
font-weight: bold;
}
#arialroundedmtboldEnjoy {
font-family: 'Hind';
font-size: 50px;
}
.textMyriadPro {
font-size: 14px;
color: #757575;
}
.enjoresult {
font-size: 20px;
margin-left: 5px;
}
#fontsize40 {
font-size: 140px;
}
#borderHover:hover {
box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.10), 0 2px 3px 0 rgba(0, 0, 0, 0.10);
}
.listgroup {
font-family: Roboto, sans-serif;
font-size: 14px;
color: #757575;
list-style: none;
text-decoration: none;
height: 25px;
padding-left: 10px;
}
.listgroup:hover {
color: #f2230c;
background-color: #eceff2;
}
.customMarginTop15px {
margin-top: 15px;
}
.customMarginBottom15px {
margin-bottom: 15px;
}
.color000 {
color: #000;
}
.color757575 {
color: #757575;
}
.fontsans {
font-family: 'Open Sans', sans-serif;
}
#hoverHeart:hover {
color: red;
}
.topicFontFamily {
font-family: Roboto, sans-serif;
}
#noBoxShadow {
box-shadow: none;
}
.instacolor {
color: transparent;
background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%);
background: -webkit-radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%);
background-clip: text;
-webkit-background-clip: text;
}
.noBoxShadow {
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
}
.verticalCenter {
vertical-align: middle;
}
<html>
<head>
<!-- Font Awesome -->
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.2/css/all.css">
<!-- Bootstrap core CSS -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet">
<!-- Material Design Bootstrap -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/mdbootstrap/4.8.9/css/mdb.min.css" rel="stylesheet">
<!-- JQuery -->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<!-- Bootstrap tooltips -->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.4/umd/popper.min.js"></script>
<!-- Bootstrap core JavaScript -->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.3.1/js/bootstrap.min.js"></script>
<!-- MDB core JavaScript -->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mdbootstrap/4.8.9/js/mdb.min.js"></script>
<style>
@import url('https://fonts.googleapis.com/css?family=Hind');
@import url('https://fonts.googleapis.com/css?family=Open+Sans');
</style>
</head>
<body>
<div class="container">
<div class="row mt-4">
<div class="col-12 card">
<!-- Nav tabs -->
<ul class="nav mb-4 mt-4" id="myTabAttr" role="tablist">
<li class="nav-item">
<a class="nav-link active" id="signin-tab-attr" data-toggle="tab" href="#signin-attr" role="tab" aria-controls="signin-attr" aria-selected="true">SIGN IN</a>
</li>
<li class="nav-item">
<a class="nav-link" id="register-tab-attr" data-toggle="tab" href="#register-attr" role="tab" aria-controls="register-attr" aria-selected="false">REGISTER</a>
</li>
</ul>
<style>
.nav-link.active,
.nav-link:hover {
color: red;
text-decoration: underline;
}
</style>
<!-- Tab panes -->
<div class="tab-content">
<!--Sigin starts -->
<div class="tab-pane active" id="signin-attr" role="tabpanel" aria-labelledby="signin-tab-attr">
<form>
<div class="form-group">
<input type="text" name="username" class="form-control" placeholder="Username">
</div>
<div class="form-group">
<input type="password" name="password" class="form-control" placeholder="Password">
</div>
<div class="form-group ">
<input type="checkbox" tabindex="3" class="" name="remember" id="remember">
<label for="remember" style="color: black"> Remember Me</label>
</div>
<button type="submit" style="" type="button" class="ml-0 mb-3 p-2 btn customBackgroundColorRed text-white btn-lg btn-block noBoxShadow ">
<p class=" text-capitalize textSize16px font-weight-bold m-0">Sign in</p>
</button>
<div class="form-group">
<div class="row">
<div class="col-lg-12">
<div class="">
<a href="#" tabindex="5" class="forgot-password float-">Forgot Password?</a>
</div>
</div>
</div>
</div>
</form>
</div>
<!--Sigin ends -->
<!-- Register starts -->
<div class="tab-pane" id="register-attr" role="tabpanel" aria-labelledby="register-tab-attr">
<div class="tab-pane active" id="signin-attr" role="tabpanel" aria-labelledby="signin-tab-attr">
<form>
<div class="form-group">
<input type="text" name="email" class="form-control" placeholder="Email">
</div>
<div class="form-group">
<input type="password" name="createPassWord" class="form-control" placeholder="Create password">
</div>
<div class="form-group">
<input type="password" name="reTypePassword" class="form-control" placeholder="Re-type Password">
</div>
<div class="form-group pt-1 pb-1 ">
<input type="checkbox" class="" name="iAgree" id="iAgree">
<label for="iAgree " class="textSize12px verticalCenter mt-1" style="color: black">I agree to Surf2Ship <a href="#">Terms and conditions</a> and <a href="#">Privacy Policies</a></label>
</div>
<button type="submit" style="" type="button" class="ml-0 mb-3 p-2 btn customBackgroundColorRed text-white btn-lg btn-block noBoxShadow ">
<p class=" text-capitalize textSize16px font-weight-bold m-0">Register</p>
</button>
<div class="form-group">
<div class="row">
<div class="col-lg-12">
<div class="text-center textSize14px">
<p style="color: black">or connect via</p>
</div>
</div>
</div>
</div>
<div class="form-group">
<div class="row">
<div class="col-lg-12 mb-3">
<div class="text-center verticalCenter">
<a href="" class="pr-4"><i class="fab fa-facebook textSize40px"></i></a>
<a> <img class="ml-4" style="width:35px;height:35px;vertical-align: middle;margin-top: -18;" src="googleicon.png" role="button"></a>
</div>
</div>
</div>
</div>
</form>
</div>
</div>
<!--Reister ends-->
</div>
</div>
</div>
</div>
</body>
</html>
关于javascript - CSS 文本装饰 :underline auto appying to all the elements in the container,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58055541/
下面两个CSS选择器有什么区别? 来自解释here ,它们听起来一样吗? div p{} 选择div元素内的所有p元素 div > p{} 选择父级为 div 元素的所有 p 元素。 最佳答案 区别在
我需要怎么做: 目前,事实证明: 我更喜欢它看起来像: 最佳答案 有了这些空行,看起来您的 select 语句是(正确地)选择您
用替换元素是否有效至 .在这种情况下,我想要, 这样我就可以在...中附加验证数据。这也可以从 中实现吗?或 等等? 最佳答案 标签没有 而且不需要一个。同样适用于 和 .您可以将验证数据作为
我刚刚发现了 Angular 1.2.1 的一个奇怪问题,在 this fiddle 中进行了演示。 (在 IE、FF 和 Chrome 中测试):如果我创建一个非常简单的模板化指令,它无法像 那样
我正在尝试使用 Jsoup 迭代 java 中的两个元素,但是,我收到运行时异常错误。看来我无法将nodes.Element 的类型转换为element.Element。 非常感谢您的帮助,谢谢。 代
假设我的文档中有一组元素,它们是单个对象的子元素。这些元素中的每一个都使用不同的参数注册一个新的事件监听器。如果我丢弃父对象,是否需要手动取消注册所有 eventListener?或者浏览器是否跟踪所
我不应该在我的应用程序中使用 jQuery,但我有一个场景,我需要元素的偏移量,而不是使用 $(element).offset() 我已经使用了 angular.element(element).of
我是TS的新手,我想知道为什么我在以下代码中遇到类型错误(简化):。错误在`{iconMap[名称]}中:。“元素隐式具有‘any’类型,因为‘字符串’类型的表达式不能用于索引类型‘{Categori
我是TS的新手,我想知道为什么我在以下代码中遇到类型错误(简化):。错误在`{iconMap[名称]}中:。“元素隐式具有”any“类型,因为”string“类型的表达式不能用于索引类型”{ Cate
什么意思: Separator.Iterator.Element == Self.Iterator.Element.Iterator.Element 在this (Swift 标准库)swift 实例
是否可以在 img 元素上使用前后伪选择器?认为它是但没有任何运气,将 css 切换到 div 并且它工作正常。 .page-overhang 类是 img 元素。 // page overhang
我在 UI 中的按钮 Click 事件上有以下代码,它返回一个 MS-Excel 文件。它在第一次点击事件中完美运行,但之后返回以下错误。 任何建议,我怎样才能摆脱它? ERROR: Uncaught
如何在 CSS 中编写这个想法: 选择 ElementA 内但不在 ElementB 内且 ElementB 在 ElementA 内的每个元素。 这是一个例子:
关闭。这个问题需要debugging details .它目前不接受答案。 编辑问题以包含 desired behavior, a specific problem or error, and th
如果我在 C# 中的 XElement myXML 变量中有以下 XML, myvalue 要获得“myvalue”,我需要执行以下操作: myXML.Element(
我找不到用户名和密码字段。我检查元素,并尝试通过 id、xpath 或 css 选择器查找它,但它给出错误 NoSuchElementException: Message: no such eleme
我的任务是在用户点击它时从输入框中删除占位符并使标签可见。如果用户未在其中再次填写任何内容,请放回占位符并使标签不可见。 我可以隐藏它但不能重新分配它。我试过 element.setAttribute
我正在编写一个 c# 类来编写一个 XML 文件,该文件需要与我们使用的现有 XML 的结构完全匹配,这样一些遗留系统就不会混淆。 当一个元素的InnerText值为null时,我需要xml元素的元素
自定义元素的一个常见做法,至少在 Polymer(最流行的 Web 组件框架)中,是定义一个新的自定义元素。恕我直言,这对 来说不是一个好习惯呈现 元素,因为该元素无法逐步呈现,必须等到它被加载(注册
我正在尝试跟踪元素的可见性及其显示的控制台错误:“元素“a[data-vars-ei]”必须是 AMP 元素”。 但是在点击跟踪的情况下,类似的事情工作正常。 我无法理解为什么会发生这种情况以及我应该
我是一名优秀的程序员,十分优秀!