Content panel not switching for clicked tab - jquery-tabs

Can someone please provide help with my script & teach me why my content panels don't switch with the added script to add the 'selectedTab' class? They switch fine when I remove the script altogether. I tried removing the 'active' class from Home which obviously didn't work. Sorry I'm so clueless. thanks in advance for your help.
<style>
/*Selected Tab*/
.selectedTab {
background-color:#CBD8E1;;
border-left: 1px solid rgb(69, 145, 193);
border-top: 1px solid rgb(69, 145, 193);
border-right: 1px solid rgb(69, 145, 193);
border-bottom: nonet;
color: rgb(69, 145, 193);
line-height: 0.5em;
padding: 8px 10px;
}
/*Non-Selected Tab*/
.notSelectedTab {
border: 1px solid rgb(69, 145, 193);
border-bottom: none;
background-color: rgb(69, 145, 193);
color: rgb(255, 255, 255);
line-height: 0.5em;
margin-top: -1px;
padding: 8px 10px;
}
</style>
<script>
$( document ).ready( function() {
$('ul.nav li a').click(
function(e) {
e.preventDefault(); // prevent the default action
e.stopPropagation(); // stop the click from bubbling
$('.selectedTab').removeClass('selectedTab').addClass('notSelectedTab');
$(this).addClass('selectedTab').removeClass('notSelectedTab');
});
});</script>
<!-- Nav tabs -->
<ul class="nav nav-tabs" role="tablist">
<li><a class="selectedTab" href="#home" role="tab" data-toggle="tab">Home</a></li>
<li><a class="notSelectedTab" href="#profile" role="tab" data-toggle="tab">Profile</a></li>
<li><a class="notSelectedTab" href="#messages" role="tab" data-toggle="tab">Messages</a></li>
<li><a class="notSelectedTab" href="#settings" role="tab" data-toggle="tab">Settings</a></li>
</ul>
<!-- Tab panes -->
<div class="tab-content">
<div class="tab-pane active" id="home">Home</div>
<div class="tab-pane" id="profile">Profile</div>
<div class="tab-pane" id="messages">Messages</div>
<div class="tab-pane" id="settings">Settings</div>
</div>

Related

CSS underline with same with as above element

I am trying to create the following look:
As you can see on this picture even if there is some padding on the "sub" menu item the border still works.
So here is what I've attempted:
.menu-ul {
list-style-type: none;
}
.menu-li {
padding: 10px 0;
border-bottom: 1px solid rgba(50, 50, 50, 0.3);
width: 100%;
}
a {
font-family: Titillium Web;
font-style: normal;
font-weight: 600;
font-size: 16px;
line-height: 24px;
letter-spacing: 0.02em;
color: #323232;
text-decoration: none;
}
a:hover {
color: #DB091C;
}
.sub-menu-ul {
padding: 0px;
list-style-type: none;
border-top: 1px solid rgba(50, 50, 50, 0.3);
}
.sub-menu-li {
padding: 10px;
width: calc(100% - 20px);
border-top: 1px solid rgba(50, 50, 50, 0.3);
}
hr.solid {
border-top: 3px solid #bbb;
}
<link href="https://pro.fontawesome.com/releases/v5.14.0/css/all.css" rel="stylesheet"/>
<nav style="width: 300px">
<ul class="menu-ul">
<li class="menu-li">
<a href="" >Title </a>
<span style="float: right"><i class="fa fa-angle-down"></i></span>
<div style="display: block">
<ul class="sub-menu-ul">
<li class="sub-menu-li"> <a href="#">
Sub menu item2
</a>
<span style="float: right"><i class="fa fa-angle-right"></i></span>
</li>
</li>
<li class="sub-menu-li"> <a href="#">
Sub menu item2
</a>
</li>
</ul>
</div>
</li>
<li class="menu-li"><a href="" >Title 2</a>
</li>
<li class="menu-li"><a href="" >Title 2</a> </li>
</ul>
</nav>
But I can't seem to get the border right.
Try this, I have changed the padding for menu-li and width of sub-menu-li
.menu-li {
padding: 10px 0;
border-bottom: 1px solid rgba(50, 50, 50, 0.3);
width: 100%;
}
.sub-menu-li {
padding: 10px;
padding-right: 0;
width: calc(100% - 10px);
border-top: 1px solid rgba(50, 50, 50, 0.3);
}

how to clear black dash in html button?

I don't know how to describe my problem but look at my output you'll get an idea. I
googled about my problem but i couldn't found the solution.
.btn1 {
font-family: 'Times New Roman', Times, serif;
margin-right: 0px;
width: 100px;
height: 30px;
font-size: 17px;
font-weight: 200;
background-color: #f7e7e7;
color: rgb(49, 126, 126);
border-radius: 5px;
border: 1px solid rgb(186, 230, 173);
box-shadow: 3px 3px rgb(98, 151, 98);
}
<div>
<a href="#">
<button class="btn1">Home</button>
</a>
<a href="product.html">
<button class="btn2">Products</button>
</a>
<a href="#">
<button class="btn3">Buy Now</button>
</a>
<a href="findus.html">
<button class="btn4">Find us</button>
</a>
</div>
Every button have same code in CSS.
Can you please tell, what am i doing wrong?
Thank you.
You have unnecessarily wrapped each of your <button>s in an <a> tag and this is the browser's default underline style of the <a> tag that you can see.
Note: Some of the other answers suggest simply hiding the underline, but wrapping a <button> in an <a> is considered to be an anti-pattern that should be avoided.
Links
.btn1 {
font-family: 'Times New Roman', Times, serif;
margin-right: 0px;
width: 100px;
height: 30px;
font-size: 17px;
font-weight: 200;
background-color: #f7e7e7;
color: rgb(49, 126, 126);
border-radius: 5px;
border: 1px solid rgb(186, 230, 173);
box-shadow: 3px 3px rgb(98, 151, 98);
text-decoration: none;
}
<div>
<a class="btn1" href="#">Home</a>
<a class="btn1" href="product.html">Products</a>
<a class="btn1" href="#">Buy Now</a>
<a class="btn1" href="findus.html">Find us</a>
</div>
Buttons
.btn1 {
font-family: 'Times New Roman', Times, serif;
margin-right: 0px;
width: 100px;
height: 30px;
font-size: 17px;
font-weight: 200;
background-color: #f7e7e7;
color: rgb(49, 126, 126);
border-radius: 5px;
border: 1px solid rgb(186, 230, 173);
box-shadow: 3px 3px rgb(98, 151, 98);
}
<div>
<button class="btn1">Home</button>
<button class="btn2">Products</button>
<button class="btn3">Buy Now</button>
<button class="btn4">Find us</button>
</div>
You can read about links vs buttons, and why you might choose one over the other here.
The dashes you are seeing are actually the default underline that accompanies anchor elements. All you need to add is:
a {
text-decoration: none;
}
That being said, nesting button elements inside of anchor elements is invalid HTML and should be avoided.
Replace a with button or use css rule text-decoration: none
.btn {
font-family: "Times New Roman", Times, serif;
margin: 10px;
padding:10px;
width: 100px;
height: 30px;
font-size: 17px;
font-weight: 200;
background-color: #f7e7e7;
color: rgb(49, 126, 126);
border-radius: 5px;
border: 1px solid rgb(186, 230, 173);
box-shadow: 3px 3px rgb(98, 151, 98);
}
a
{
text-decoration:none;
color: black;
}
<div>
<a href="#" class="btn">
Home
</a>
<a href="product.html" class="btn">
Product
</a>
<a href="#" class="btn">
buy now
</a>
<a href="findus.html" class="btn">
find us
</a>
</div>

Dropdown Menu Automatically Open in IE

I'm making a landing page for a client with a dropdown menu. I'm using bootstrap. I've been having an issue where the dropdown options are already expanded on page load, but only for IE. They also do not have any of the normal formattings for an 'expanded' dropdown (background color should be white, it's not, etc.) Instead, all the li are translucent gray. The options are hoverable and selectable, but the dropdown menu will not close (the caret is essentially unresponsive).
This problem has happened before, on other sites, for this same client. The weirdest thing is, in the past, I have been able to get it to work by merely uploading the folder again to the client's servers. Same code, not working once, then uploaded again and then working. For the life of me, I can't figure out why this is happening
.hero .hero-selection select {
width: 250px;
border: none;
font-size: 14px;
font-family: Proxima Nova Thin;
-moz-box-shadow: 0 0 0 35px rgba(255, 255, 255, .2);
-webkit-box-shadow: 0 0 0 35px rgba(255, 255, 255, .2);
box-shadow: 0 0 0 35px rgba(255, 255, 255, .2);
background-color: #FFF;
color: #999;
border-radius: 0!important;
-webkit-appearance: none;
-moz-appearance: none;
-ms-appearance: none;
appearance: none;
padding: 15px 10px 10px;
}
.hero .hero-form-container .dropdown-menu {
position: absolute;
top: 100%;
left: 0;
z-index: 1000;
display: none;
float: left;
min-width: 160px;
font-size: 14px;
text-align: left;
list-style: none;
background-color: #fff;
background-clip: padding-box;
border: 1px solid rgba(0, 0, 0, .15);
border-radius: 4px;
box-shadow: 0 6px 12px rgba(0, 0, 0, .175);
margin: 2px 0 0;
padding: 5px 0;
}
.hero .hero-form-container .dropdown-menu>li>a {
display: block;
clear: both;
font-weight: 400;
line-height: 1.42857143;
color: #333;
white-space: nowrap;
padding: 3px 20px;
}
.hero .hero-form-container ul {
width: 250px;
top: 91px;
border-radius: 0;
border: none;
background-color: #FFF;
color: #999;
padding: 0;
}
.hero .hero-form-container ul li a:hover {
background-color: #99d425;
font-family: Proxima Nova Thin;
font-size: 14px;
color: #999;
padding: 5px 5px 5px 15px;
}
.hero .hero-form-container ul li a {
font-family: 'Proxima Nova Thin';
font-size: 14px;
color: #999;
text-decoration: none;
padding: 5px 5px 5px 15px;
}
<div class="row">
<div class="col-sm-6 pull-left"><img id="nats-logo" style="" src="img/nats-logo-red.png" alt=""></div>
<div class="col-sm-6">
<div class="hero">
<div class="hero-form">
<div class="dropdown hero-selection">
<h5>Select your utility below:</h5>
<h2 style="margin-top: 20px">My Electricity Utility is:</h2>
<div class="btn-group">
<button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu2" data-toggle="dropdown" aria-expanded="true"> Select One<span class="caret"></span> </button>
<ul class="dropdown-menu" role="menu">
<li role="presentation"><a role="menuitem" tabindex="-1" href="#" value="notlisted" class="is-active">[not listed]</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="#" value="EBG">BGE</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="#" value="CNM">Delmarva Power (MD)</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="#" value="PED">Pepco (DC)</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="#" value="PEM">Pepco (MD)</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="#" value="APM">Potomac Edison</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="#" value="SME">SMECO</a></li>
</ul>
</div>
<form action="https://one.wglenergy.com/portal/rc_engine_by_ldc.php" id="form1">
<input type="hidden" name="super_rc" value="NATS">
<input type="hidden" name="cust_type" value="RES">
<input type="hidden" name="ldc_g" id="ldc_g">
<input type="hidden" name="ldc_e" id="ldc_e">
<input type="submit" id="go-button" value="See Your Pricing">
</form>
</div>
</div>
</div>
</div>
</div>

How can I set the nav to be non-transparent

I am new with CSS and Bootstrap.
I try to create nav fixed-top with bootstrap but somehow it's transparent.
I tried to add to CSS !important but it didnt help.
How can I set the nav to be non-transparent?
Here my CSS & HTML code:
.myNavbar{
margin-top: 0em;
margin-bottom: 1em;
margin-left: 0em;
margin-right: 0em;
background: rgba(255, 166, 0, 0.623) !important;
padding-right: 0em;
text-align: center;
width: 100%;
}
<nav class="row myNavbar fixed-top ">
<a class="nav-link" routerLink="/main">home </a>
<a class="nav-link col" routerLink="/salads">salads</a>
<a class="nav-link col" routerLink="/galery">galery</a>
<a class="nav-link col span2" routerLink="/CuntactUs">contact</a>
<a class="nav-link col" routerLink="/AboutUs">about</a>
</nav>
Is there anyone who can help me please...
Thanks!
Change this
background: rgba(255, 166, 0, 0.623) !important;
to this
background: rgb(255, 166, 0);
or
background: rgba(255, 166, 0, 1);
to remove the alpha/opacity section of the background-color or set the alpha value to be fully opaque.
background: rgba(255, 166, 0, 0.623) !important;
Remove 0.632 from the rgb color and you're done!

Bootstrap popovers not aligning with arrow

I'm using bootstrap popovers in a project of mine, and I've encountered a problem with them. My popover is being pushed up because it hits the bottom of my visible screen, but when I scroll down, it doesn't move down aswell to align with the arrow.
Here's a picture of it happening live, see I've scrolled down but it doesn't move down with me.
EDIT: Code
$(document).ready(function(){
$("[data-toggle=popover]").popover({
trigger: 'hover',
html: true
})
});
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" integrity="sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M" crossorigin="anonymous">
<style>
.popover {
border-radius: 0;
border: none;
background: none;
}
.popover.bs-popover-right .arrow::after {
border-right-color: rgba(0, 80, 173, 0.8);
}
.popover.bs-popover-left .arrow::after {
border-left-color: rgba(0, 80, 173, 0.8);
}
.popover.bs-popover-top .arrow::after {
border-top-color: rgba(0, 80, 173, 0.8);
}
.popover.bs-popover-bottom .arrow::after {
border-bottom-color: rgba(0, 80, 173, 0.8);
}
.popover.bs-popover-auto[x-placement^=bottom] .popover-header::before,
.popover.bs-popover-bottom .popover-header::before {
border-bottom: 1px solid rgba(0, 80, 173, 0.8);
}
.popover-header {
padding: 18px 23px;
border-radius: 0;
color: #fff;
background: rgba(0, 80, 173, 0.5);
border-bottom: 1px solid rgba(0, 80, 173, 0.8);
}
.popover-body {
padding: 19px 24px;
border-radius: 0;
color: #eaeaea;
background: rgba(0, 80, 173, 0.5);
}
</style>
<body>
<div class="container-fluid">
<div class="row">
<div class="col-sm-12 col-md-4" style="height: 120vh;">
<img style="width: 45%;" src="https://cdn2.littlethings.com/app/uploads/2017/05/cute-dog-yorkie-600x600.jpg" tabindex="0" role="button" data-toggle="popover" data-placement="left" title="idk" data-content="idk">
<img style="width: 45%;" src="https://cdn2.littlethings.com/app/uploads/2017/05/cute-dog-yorkie-600x600.jpg" tabindex="0" role="button" data-toggle="popover" data-placement="left" title="idk" data-content="idk">
<img style="width: 45%;" src="https://cdn2.littlethings.com/app/uploads/2017/05/cute-dog-yorkie-600x600.jpg" tabindex="0" role="button" data-toggle="popover" data-placement="left" title="idk" data-content="idk">
</div>
</div>
</div>
</body>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/js/bootstrap.min.js"></script>
You might have an external css file which is overwriting the Bootstrap default css. (top:50%;) should work in the arrow div and need to ensure the parent div is (position: relative;) as well. The relative parent div will help the arrow div vertically middle alignment (top:50%;) as per content.