Bootstrap 4 horizontal scroller div - css

I got this working for Bootstrap 3 but the same code won't work in Bootstrap 4.
Basically, I'm trying to create a horizontal scroll for DIV and here's a working JSFIDDLE for Bootstrap 3 (which I don't want): DEMO
The same code for Bootstrap 4 isn't working though! Here's the JSFiddle for Bootstrap 4: https://jsfiddle.net/6kvw2q5h/
HTML
<div class="live__scroll">
<div class="row text-center">
<div class="col-8 live__scroll--box">1</div>
<div class="col-8 live__scroll--box">1</div>
<div class="col-8 live__scroll--box">1</div>
<div class="col-8 live__scroll--box">1</div>
<div class="col-8 live__scroll--box">1</div>
<div class="col-8 live__scroll--box">1</div>
<div class="col-8 live__scroll--box">1</div>
</div>
</div>
CSS
.live__scroll {
overflow-x: auto;
overflow-y: hidden;
white-space: nowrap;
}
.live__scroll .live__scroll--box {
display: inline-block;
float: none;
padding: 15px;
border: 1px solid red;
}
What am I doing wrong? I'm at wits end.

HTML
<div class="container testimonial-group">
<div class="row text-center flex-nowrap">
<div class="col-sm-4">1</div>
<div class="col-sm-4">2</div>
<div class="col-sm-4">3</div>
<div class="col-sm-4">4</div>
<div class="col-sm-4">5</div>
<div class="col-sm-4">6</div>
<div class="col-sm-4">7</div>
<div class="col-sm-4">8</div>
<div class="col-sm-4">9</div>
</div>
</div>
CSS
/* The heart of the matter */
.testimonial-group > .row {
overflow-x: auto;
white-space: nowrap;
}
.testimonial-group > .row > .col-sm-4 {
display: inline-block;
float: none;
}
/* Decorations */
.col-sm-4 { color: #fff; font-size: 48px; padding-bottom: 20px; padding-top: 18px; }
.col-sm-4:nth-child(3n+1) { background: #c69; }
.col-sm-4:nth-child(3n+2) { background: #9c6; }
.col-sm-4:nth-child(3n+3) { background: #69c; }
NOTE : codepen

I think you need to remove the flexbox functionality of the .row so add:
.live__scroll .row{
display:block;
}
So it should look like the following:
.live__scroll {
overflow-x: auto;
overflow-y: hidden;
white-space: nowrap;
}
.live__scroll .row{
display:block;
}
.live__scroll .live__scroll--box {
display: inline-block;
float: none;
padding: 15px;
border: 1px solid red;
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css" integrity="sha384-PsH8R72JQ3SOdhVi3uxftmaW6Vc51MKb0q5P2rRUpPvrszuE4W1povHYgTpBfshb" crossorigin="anonymous">
<div class="live__scroll">
<div class="row text-center">
<div class="col-8 live__scroll--box">1</div>
<div class="col-8 live__scroll--box">1</div>
<div class="col-8 live__scroll--box">1</div>
<div class="col-8 live__scroll--box">1</div>
<div class="col-8 live__scroll--box">1</div>
<div class="col-8 live__scroll--box">1</div>
<div class="col-8 live__scroll--box">1</div>
</div>
</div>

horizontal scoll bar using bootstrap 4
In table
<div class="table-responsive">
<table class="table table-bordered">
<thead>
<tr>
<th>#</th>
<th>Firstname</th>
<th>Lastname</th>
<th>Age</th>
<th>City</th>
<th>Country</th>
<th>Sex</th>
<th>Example</th>
<th>Example</th>
<th>Example</th>
<th>Example</th>
<th>Example</th>
<th>Example</th>
<th>Example</th>
<th>Example</th>
<th>Example</th>
<th>Example</th>
<th>Example</th>
<th>Example</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>bharti</td>
<td>parmar</td>
<td>422</td>
<td>New York</td>
<td>USA</td>
<td>Female</td>
<td>Yes</td>
<td>Yes</td>
<td>Yes</td>
<td>Yes</td>
<td>Yes</td>
<td>Yes</td>
<td>Yes</td>
<td>Yes</td>
<td>Yes</td>
<td>Yes</td>
<td>Yes</td>
<td>Yes</td>
</tr>
</tbody>
</table>
In navigation bar
<div class="scrollmenu">
Home
News
Contact
About
Support
Home
News
Contact
About
Support
Home
News
Contact
About
Support
</div>
css code
div.scrollmenu {
background-color: #333;
overflow: auto;
white-space: nowrap;
}
div.scrollmenu a {
display: inline-block;
color: white;
text-align: center;
padding: 14px;
text-decoration: none;
}
div.scrollmenu a:hover {
background-color: #777;
}

Related

convert table to div as per bootstrap v4 beta

I am using bootstrap v4 beta. I have created a table. How can i create the same table using div.
<div class="container">
<table class="table">
<thead>
<tr>
<th>#</th>
<th class="text-center"><b>Id</b></th>
<th class="text-center"><b>Name</b></th>
<th class="text-center"><b>Munit</b></th>
</tr>
</thead>
<tbody>
<tr>
<td> 1</td>
<td class="text-center"> 294</td>
<td class="text-center"> nimai</td>
<td class="text-center"> kg</td>
</tr>
<tr>
<td> 2</td>
<td class="text-center"> 200</td>
<td class="text-center"> nitai</td>
<td class="text-center"> kg</td>
</tr>
</tbody>
</table>
</div>
I also want the same format it looks like in the below picture:
You can make that easily using flexbox
.table {
width: 100vw;
height: 100vh;
display: flex;
flex-direction: column;
}
.table-row {
width: 100%;
height: 10vw;
display: flex;
border-bottom: 1px solid #ccc;
}
.table-header {
font-weight: bold;
}
.table-row div:first-child {
width: 10% !important;
}
.table-row-column {
width: 30%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}
<div class="container">
<div class="table">
<div class="table-row table-header">
<div class="table-row-column table-row-index">#</div>
<div class="table-row-column table-center">Id</div>
<div class="table-row-column table-center">Name</div>
<div class="table-row-column table-center">Munit</div>
</div>
<div class="table-row">
<div class="table-row-column table-row-index">1</div>
<div class="table-row-column table-center">294</div>
<div class="table-row-column table-center">nimai</div>
<div class="table-row-column table-center">kg</div>
</div>
<div class="table-row">
<div class="table-row-column table-row-index">2</div>
<div class="table-row-column table-center">200</div>
<div class="table-row-column table-center">nitai</div>
<div class="table-row-column table-center">kg</div>
</div>
</div>
</div>
Try this
.col {
display: inline-block;
}
row {
display: block;
}
<div class="row">
<div class="col">
<div>First column</div>
<div> 1</div>
<div> 2</div>
<div>3</div>
</div>
<div class="col">
<div>Second column</div>
<div>1</div>
<div>2</div>
<div>3</div>
</div>
<div class="col">
<div>Third column</div>
<div>1</div>
<div>2</div>
<div>3</div>
</div>

CSS flex get the same behaivor as table

I'm trying to use flexbox to get the same behavior as a table. For example:
<div>
<div class="flex row">
<p>Short text</p>
<p>Text </p>
</div>
<div class="flex row">
<p>Very long text</p>
<p>Text </p>
</div>
</div>
How can I get the rows to be on the same vertical line as a table?
So basically I'm trying to achieve the following result with flexbox
<table>
<tr>
<td>Short text</td>
<td>Text</td>
</tr>
<tr>
<td>Very long text</td>
<td>Text</td>
</tr>
</table>
Not using flexbox given your HTML structure.
If you want table behaviour, using divs, use CSS Tables.
A comparison for you.
table {
border-collapse: collapse;
margin-bottom: 1em;
}
td {
border: 1px solid grey;
padding: 1em;
background: lightgreen;
}
.table {
display: inline-table;
}
.row {
display: table-row;
}
p {
display: table-cell;
padding: 1em;
border: 1px solid grey;
background: lightblue;
}
<table>
<tr>
<td>Short text</td>
<td>Text</td>
</tr>
<tr>
<td>Very long text</td>
<td>Text</td>
</tr>
</table>
<div class="table">
<div class="row">
<p>Short text</p>
<p>Text </p>
</div>
<div class="row">
<p>Very long text</p>
<p>Text </p>
</div>
<div>
.row {
display: flex;
justify-content: space-around;
align-items: center;
}
.row p { width: 100% }
<div class="table">
<div class="flex row">
<p>Short text</p>
<p>Text </p>
</div>
<div class="flex row">
<p>Very long text</p>
<p>Text </p>
</div>
</div>

how to divide row into <td> in responsive table

I have a table like this:
+----+----+----+----+----+----+
| A | A | B | B | C | C |
+----+----+----+----+----+----+
And I need to get this result in small screen
+----+----+
| A | A |
+----+----+
| B | B |
+----+----+
| C | C |
+----+----+
Is it possible?
I want to use only css, no jquery.
use display: property, td::after
how should I do ?
How can I solve this?
#media( max-width:640px) {
#test, #test thead, #test tbody {} #test tr {
/* ? */
}
#test th {
/* ? */
}
#test td {
/* ? */
}
#test td::after {
/* ? */
}
#test tr {
border-bottom: 1px solid #ddd;
}
#test th,
#test td {
border-top: none;
border-bottom: none;
}
}
<table id="test" class="table">
<tr>
<th>A</th>
<td>A</td>
<th>B</th>
<td>B</td>
<th>C</th>
<td>C</td>
</tr>
<tr>
<th>D</th>
<td>D</td>
<th>E</th>
<td>E</td>
<th>F</th>
<td>F</td>
</tr>
</table>
<table> and #media are not the best friends.
<div> instead can be both display: block; and display: table; if we want to, so let's rock
jsBin demo
*{box-sizing:border-box;-webkit-box-sizing:border-box;}html,body{height:100%;margin:0;}
.table{
display: table;
width: 100%;
table-layout: fixed;
border-left: 1px solid #444;
border-top: 1px solid #444;
}
.tr{
display: table-row;
}
.td,
.th{
display: table-cell;
background: #eee;
border-bottom: 1px solid #444;
border-right: 1px solid #444;
}
.th{
font-weight: bold;
}
#media(max-width:640px) {
.table,
.tr{
display: block;
}
.th,
.td{
width: 50%;
float: left;
}
}
<div class="table">
<div class="tr">
<div class="th">A</div>
<div class="td">A</div>
<div class="th">B</div>
<div class="td">B</div>
<div class="th">C</div>
<div class="td">C</div>
</div>
<div class="tr">
<div class="th">D</div>
<div class="td">D</div>
<div class="th">E</div>
<div class="td">E</div>
<div class="th">F</div>
<div class="td">F</div>
</div>
</div>
This is using bootstrap:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css" integrity="sha384-fLW2N01lMqjakBkx3l/M9EahuwpSfeNvV63J5ezn3uZzapT0u7EYsXMjQV+0En5r" crossorigin="anonymous">
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>
<div class="row">
<div class="col-md-4 col-xs-12 text-center">
<div class="col-md-2 col-xs-6">A</div>
<div class="col-md-2 col-xs-6">A</div>
</div>
<div class="col-md-4 col-xs-12 text-center">
<div class="col-md-2 col-xs-6">B</div>
<div class="col-md-2 col-xs-6">B</div>
</div>
<div class="col-md-4 col-xs-12 text-center">
<div class="col-md-2 col-xs-6">C</div>
<div class="col-md-2 col-xs-6">C</div>
</div>
</div>
Its better to use <div> rather than using the old <table>. Use a framework like bootstrap, styling would be much easier.

bootstrap 4 nav-tabs stop border-bottom from jumping down on hover

I've tried to incorporate my own style to the nav-tabs in bootstrap 4 because the out-of-the-box does fit my theme very well.
I've got it looking how I want it to, but when I hover over a tab, the border-bottom on the nav-tabs section moves down about 1px. I've tried manipulating the margin, padding, etc but can't seem to figure out how to get it to stop doing it.
Can someone help here?
<div class="container-fluid body-content">
<div class="row">
<div class="col-xs-12 col-sm-3 col-lg-2">
<div class="row m-b-2">
<div class="col-xs-12">
<div class="row m-b-2 left-nav-container">
<div class="col-xs-12">
<div class="row left-nav"><a class="col-xs-6 col-sm-12 left-nav-menu-item" href="#">Update Starters</a>
<a class="col-xs-6 col-sm-12 left-nav-menu-item hidden-xs" href="/rankings/all">Wrestler Rankings</a>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-xs-12 col-sm-9 col-lg-10">
<div class="row">
<div class="col-xs-12">
<!-- Nav tabs -->
<ul class="nav nav-tabs" role="tablist">
<li class="nav-item">
<a class="nav-link active" data-toggle="tab" href="#roster" role="tab">Roster</a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#schedule" role="tab">Schedule</a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#elig" role="tab">Eligibility Breakdown</a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#depth" role="tab">Depth Chart</a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#info" role="tab">Team Info</a>
</li>
</ul>
<!-- Tab panes -->
<div class="tab-content">
<div class="tab-pane fade in active" id="roster" role="tabpanel">
<div class="card">
<div class="card-heading">
<h2>Roster</h2>
</div>
<div class="table-responsive">
<table class="table table-sm table-hover">
<thead>
<tr>
<th>Weight</th>
<th>Name</th>
<th>Class</th>
<th>Record</th>
<th>Starter</th>
</tr>
</thead>
<tbody>
<tr style="background-color: lightgray;">
<td>125</td>
<td>#4 Dance, Joey</td>
<td>JR</td>
<td>29 - 3</td>
<td>
<input checked="checked" data-val="true" data-val-required="The Starter field is required." disabled="disabled" id="Wrestlers_0__Starter" name="Wrestlers[0].Starter" style="font-size: large; margin-left: 10px; margin-top: 5px;"
type="checkbox" value="true" />
<input name="Wrestlers[0].Starter" type="hidden" value="false" />
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="tab-pane fade" id="schedule" role="tabpanel">
<div class="card">
<div class="card-heading">
<h2>Schedule</h2>
</div>
<div class="table-responsive">
<table class="table table-sm table-hover">
<thead>
<tr>
<th>Date</th>
<th>Name</th>
<th>Type</th>
<th>Opponent</th>
<th>Comparison</th>
<th>Win</th>
<th>Score</th>
</tr>
</thead>
<tbody>
<tr>
<td>11/07/15</td>
<td>Iowa State - Virginia Tech Dual</td>
<td>Dual</td>
<td>
#19 Iowa State
</td>
<td>
Dual Comparison
</td>
<td>W</td>
<td>
32 - 3
</td>
</tr>
<tr>
<td>11/08/15</td>
<td>
Hokie Open
</td>
<td>Tournament</td>
<td>Hokie Open</td>
<td>(NA)</td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="tab-pane fade" id="elig" role="tabpanel">
<div class="card">
<div class="card-heading">
<h2>Eligibility Breakdown</h2>
</div>
<div class="table-responsive">
<table class="table table-sm table-hover table-striped table-bordered">
<thead>
<tr>
<th class="text-xs-center elig-header-border">Weight</th>
<th class="text-xs-center elig-header-border">Recruit</th>
<th class="text-xs-center elig-header-border">True Freshman</th>
<th class="text-xs-center elig-header-border">Redshirt Freshman</th>
<th class="text-xs-center elig-header-border">Sophomore</th>
<th class="text-xs-center elig-header-border">Junior</th>
<th class="text-xs-center elig-header-border">Senior</th>
</tr>
</thead>
<tbody>
<tr>
<td class="text-xs-center elig-header-border">125</td>
<td class="text-xs-center elig-cell">
<p>Joey Prata</p>
</td>
<td class="text-xs-center elig-cell">
<p>#70 Ryan Haskett</p>
</td>
<td class="text-xs-center elig-cell">
<p></p>
</td>
<td class="text-xs-center elig-cell">
<p></p>
</td>
<td class="text-xs-center elig-cell">
<p>#4 Joey Dance</p>
</td>
<td class="text-xs-center elig-cell">
<p></p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="tab-pane fade" id="depth" role="tabpanel">
<div class="row">
<div class="col-xs-12">
<div class="card">
<div class="card-heading">
<h2>Depth Chart</h2>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-sm-6 col-md-4 col-xl-3">
<div class="card">
<div class="card-heading">
<h3 class="text-xs-center">125</h3>
</div>
<div class="table-responsive">
<table class="table table-sm table-hover">
<thead>
<tr>
<th>Name</th>
<th>Class</th>
<th>Record</th>
</tr>
</thead>
<tbody>
<tr>
<td>#4 Dance Joey</td>
<td>JR</td>
<td class="text-xs-right">29 - 3</td>
</tr>
<tr>
<td>#70 Haskett Ryan</td>
<td>FR</td>
<td class="text-xs-right">4 - 5</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<div class="tab-pane fade" id="info" role="tabpanel">
<div class="card">
<div class="card-heading">
<h2>Team Information</h2>
</div>
<div class="card-block">
<form class="form-horizontal" role="form" method="POST" action="Edit">
<input data-val="true" data-val-required="The SchoolId field is required." id="SchoolInfo_SchoolId" name="SchoolInfo.SchoolId" type="hidden" value="74" />
<div class="row form-group">
<div class="col-xs-6 col-sm-4 col-md-3 col-lg-2">
<label class="form-control-label" for="SchoolInfo_SchoolName">SchoolName</label>
</div>
<div class="col-xs-6 col-sm-8 col-md-4">
<input class="form-control" id="SchoolInfo_SchoolName" name="SchoolInfo.SchoolName" readonly="readonly" type="text" value="Virginia Tech" />
</div>
</div>
<div class="row form-group">
<div class="col-xs-6 col-sm-4 col-md-3 col-lg-2">
<label class="form-control-label" for="SchoolInfo_Aka">Aka</label>
</div>
<div class="col-xs-6 col-sm-8 col-md-4">
<input class="form-control" id="SchoolInfo_Aka" name="SchoolInfo.Aka" placeholder="(ie North Dakota State University is NDSU)" type="text" value="" />
</div>
</div>
<div class="row form-group">
<div class="col-xs-6 col-sm-4 col-md-3 col-lg-2">
<label class="form-control-label" for="SchoolInfo_Nickname">Nickname</label>
</div>
<div class="col-xs-6 col-sm-8 col-md-4">
<input class="form-control" id="SchoolInfo_Nickname" name="SchoolInfo.Nickname" type="text" value="Hokies" />
</div>
</div>
<div class="row form-group">
<div class="col-xs-6 col-sm-4 col-md-3 col-lg-2">
<label class="form-control-label" for="SchoolInfo_Division">Division</label>
</div>
<div class="col-xs-6 col-sm-8 col-md-4">
<input class="form-control" id="SchoolInfo_Division" name="SchoolInfo.Division" readonly="readonly" type="text" value="Division I" />
</div>
</div>
<div class="row form-group">
<div class="col-xs-6 col-sm-4 col-md-3 col-lg-2">
<label class="form-control-label" for="SchoolInfo_Conference">Conference</label>
</div>
<div class="col-xs-6 col-sm-8 col-md-4">
<input class="form-control" id="SchoolInfo_Conference" name="SchoolInfo.Conference" readonly="readonly" type="text" value="ACC" />
</div>
</div>
<div class="row form-group">
<div class="col-xs-6 col-sm-4 col-md-3 col-lg-2">
<label class="form-control-label" for="SchoolInfo_TwitterHandle">TwitterHandle</label>
</div>
<div class="col-xs-6 col-sm-8 col-md-4">
<input class="form-control" id="SchoolInfo_TwitterHandle" name="SchoolInfo.TwitterHandle" readonly="readonly" type="text" value="#VT_Wrestling" />
</div>
</div>
<div class="row">
<div class="col-xs-12">
<div class="validation-summary-valid" data-valmsg-summary="true">
<ul>
<li style="display:none"></li>
</ul>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<footer class="hidden-xs-down">
<nav class="navbar navbar-fixed-bottom navbar-dark bg-inverse p-t-1 text-xs-center">
<h6>© 2016 - WrestleStat - ACS, LLC</h6>
</nav>
</footer>
</div>
CSS
body {
padding-top: 70px;
padding-bottom: 20px;
margin-bottom: 60px;
}
/* Wrapping element */
/* Set some basic padding to keep content from hitting the edges */
.body-content {
padding-left: 15px;
padding-right: 15px;
}
/* Set widths on the form inputs since otherwise they're 100% wide */
input,
select,
textarea {
max-width: 280px;
}
a {
color: black;
text-decoration: underline;
}
a:hover {
color: red;
}
/* Carousel */
.carousel-caption {
z-index: 10 !important;
}
.carousel-caption p {
font-size: 20px;
line-height: 1.4;
}
#media (min-width: 768px) {
.carousel-caption {
z-index: 10 !important;
}
}
.footer {
position: absolute;
/*bottom: 0;*/
width: 99%;
height: 60px;
line-height: 60px;
background-color: black;
/* #f5f5f5; */
}
.widget {
font-size: .85rem;
padding: .75rem .75rem;
}
.widget-header {
padding: 1rem .75rem .5rem .75rem;
}
.borderless td,
.borderless th {
border: none;
}
.no-underline {
text-decoration: none;
}
/*.card-block-border-bottom {
border-bottom: 1px solid #e5e5e5;
}*/
/* Left Nav stuff */
.left-nav-menu-item {
color: #eceeef;
text-decoration: none;
border-top: .1rem solid white;
background-color: #373a3c;
}
.left-nav {
line-height: 3rem;
}
.left-nav > div:first-of-type {
margin-top: .2rem;
}
a.left-nav-menu-item:hover {
cursor: pointer;
}
a.left-nav-menu-item:hover {
color: red;
text-decoration: none;
}
/* End of left nav */
/* Top nav overrides since Bootstrap 4 isn't complete */
.navbar-brand {
float: none;
margin-top: 1px;
}
.navbar-nav .nav-item {
float: none;
}
.navbar-divider,
.navbar-nav .nav-item + .nav-item,
.navbar-nav .nav-link + .nav-link {
margin-left: 0;
}
#media (min-width: 34em) {
.navbar-brand {
float: left;
}
.navbar-nav .nav-item {
float: left;
}
.navbar-divider,
.navbar-nav .nav-item + .nav-item,
.navbar-nav .nav-link + .nav-link {
margin-left: 1rem;
}
}
.nav.navbar-nav {
padding-top: .3rem;
}
.navbar .navbar-nav .nav-item .nav-link {
text-decoration: none;
}
.navbar .navbar-nav .nav-item .nav-link:hover {
cursor: pointer;
}
.navbar .navbar-nav .nav-item .nav-link.donate {
font-weight: bolder;
color: green;
}
.navbar .navbar-nav .nav-item .nav-link.donate:hover {
color: white;
}
.navbar .navbar-nav .nav-item .dropdown-item {
background-color: #373a3c;
text-decoration: none;
color: #eceeef;
}
.navbar .navbar-nav .nav-item .dropdown-item:hover {
color: #eceeef;
}
/* End of top nav overrides */
/* tab overrides */
.nav.nav-tabs .nav-item a {
text-decoration: none;
}
.nav.nav-tabs a.active {
border: 1px solid black;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
background-color: #373a3c;
border-bottom: none;
color: white;
font-weight: bold;
}
.nav.nav-tabs li.nav-item:hover {
border: 1px solid #373a3c;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
border-bottom: none;
margin-bottom: 0;
padding-bottom: none;
}
.nav.nav-tabs li.nav-item:hover a {
color: black;
}
ul.nav.nav-tabs {
border-bottom: 2px solid #373a3c;
margin-bottom: 1rem;
}
ul.nav.nav-tabs div.tab-content div.card {
border: none;
}
/* end of tab overrides*/
/* eligibility breakdown page */
.elig-header-border {
background-color: lightgray;
}
.elig-border {
border: .1rem solid black;
}
td.elig-cell:hover {
background-color: red;
}
td.elig-cell:hover a:hover {
color: white;
}
/* end of eligibility breakdown */
jsfiddle
How to debug hover states
In order to see what happens when hovering an element, I recommend you to use the "force element state" functionality :hover of Chrome Dev Tools:
Doing that, I can play editing and checking/uncheking stuff to find a solution, then elaborate a CSS correction.
Solution
There's no doubt you have a problem with nested borders. You can use the previous technique to find a cleaner solution, but here is a fast fix:
.nav.nav-tabs li.nav-item {
border: 1px solid transparent;
margin-bottom: -2px !important;
}
.nav.nav-tabs li.nav-item:hover {
border: 1px solid #373a3c !important;
border-bottom: 1px solid transparent !important;
}
.nav.nav-tabs li.nav-item a.nav-link:hover {
border: 1px solid transparent;
border-bottom: none;
}
JSFiddle
Edit
Considering the :focus event, which is triggered when the element gets clicked, you may want to override the default Bootstrap styles for it too.
Add the focus selector .nav.nav-tabs a.active:focus to these styles, so they apply when focusing the element too:
.nav.nav-tabs a.active, .nav.nav-tabs a.active:focus {
border: 1px solid black;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
background-color: #373a3c;
border-bottom: none;
color: white;
font-weight: bold;
}
Next to it, you'll want to override the background to keep it white when hovering, even when the element is also focused, so add this:
.nav.nav-tabs a.active:hover {
background-color: #fff;
}
JSFiddle
Here is another solution if you don’t want to add a transparent border but just using padding
Change your the entry .nav.nav-tabs li.nav-item:hover to:
.nav.nav-tabs li.nav-item:hover {
border: 1px solid #373a3c;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
border-bottom: none;
padding: 0px 0px 0px 0px;
}
and add:
.nav.nav-tabs li.nav-item{
padding: 1px 1px 0px 1px;
}
It should work as expected. JsFiddle

how do I Center images with text under and above using html and css?

Hello I'm new to html & css and I have a question. I'm trying to display 4 images in the center of a box next to eacht other. I'm currently using tables but that gives a lot of code in my html & css:
css:
/*box*/
#content2{
margin: 30px 0;
background: white;
padding: 20px;
clear: both;
box-shadow: 0px 1px 1px #999;
text-align: center;
overflow:hidden;
}
/*table*/
table{
margin-right: auto;
margin-left: auto;
display: inline-block;
}
td,th{
padding: 20px;
}
and then way to much html:
<div id="content2">
<h4>Onze producten</h4>
<table>
<tr>
<td> Pika deken</td>
</tr>
<tr>
<td><img src="../images/baby1.jpg"></td>
</tr>
<tr>
<td>€20</td>
</tr>
</table>
<table>
<tr>
<td>School outfit</td>
</tr>
<tr>
<td><img src="../images/boy1.jpg"></td>
</tr>
<tr>
<td>€140</td>
</tr>
</table>
<table>
<tr>
<td>Bussines girl</td>
</tr>
<tr>
<td><img src="../images/girl2.jpg"></td>
</tr>
<tr>
<td>€250</td>
</tr>
</table>
<table>
<tr>
<td>Summer</td>
</tr>
<tr>
<td><img src="../images/girl1.jpg"></td>
</tr>
<tr>
<td>€99.99</td>
</tr>
</table>
</div>
Is there any way to do this more effciently ?
The design has to stay liquid.
Thanks in advance
max. simplified (ok, we could use img captions, too)
http://jsfiddle.net/EpyUb/
HTML
<div id="content2">
<h4>Onze producten</h4>
<div class="container">
<div class="product">
School outfit
<img src="../images/boy1.jpg">
</div>
<div class="product">
School outfit
<img src="../images/boy1.jpg">
</div>
<div class="product">
School outfit
<img src="../images/boy1.jpg">
</div>
<div class="product">
School outfit
<img src="../images/boy1.jpg">
</div>
</div>
</div>
CSS
.product {display: inline-block;}
.product img {display: block;}
You can try something like this:
<div id="content2">
<h4>Onze producten</h4>
<div class="section">
Pika deken
<img src="../images/baby1.jpg" />
€20
</div>
<div class="section">
School outfit
<img src="../images/boy1.jpg" />
€140
</div>
<div class="section">
Bussines girl
<img src="../images/girl2.jpg" />
€250
</div>
<div class="section">
Summer
<img src="../images/girl1.jpg" />
€99.99
</div>
</div>
and css:
#content2{
margin: 30px auto;
background: white;
padding: 20px;
clear: both;
box-shadow: 0px 1px 1px #999;
text-align: center;
overflow:hidden;
}
.section {
display: inline-block;
margin: 0 10px;
}
.section a {
display: block;
padding-bottom: 10px;
}
example here:
http://jsfiddle.net/thespacebean/xGqDE/

Resources