how can i wrap grid making it responsive? - css

I've been trying to do the last project of the FCC certificate, my problem is the mid section with the grid part, i managed to do something by trial and error, something at the end did come out, the problem is now i've been following other posts about using minmax, auto-fill and auto-fit after the repeat tag but it doesnt seem to work for me, it ruins the images blocks and they go wild if i touch something.
this is the whole code
https://jsfiddle.net/8k7ne9so/9/
.works {
height: 100vh;
width: 100%;
display: grid;
grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
grid-template-rows: repeat(auto-fit, minmax(320px, 1fr));
grid-column-gap: 18px;
grid-row-gap: 24px;
grid-area: auto;
}
.projects1 {
grid-area: 2 / 2 / 3 / 3;
}
.projects2 {
grid-area: 2 / 3 / 3 / 4;
}
.projects3 {
grid-area: 2 / 4 / 3 / 5;
}
.projects4 {
grid-area: 3 / 2 / 4 / 3;
}
.projects5 {
grid-area: 3 / 3 / 4 / 4;
}
.projects6 {
grid-area: 3 / 4 / 4 / 5;
}
<section>
<div class="presentation" id="presentation">
<h1>Hi, I'm Marwan</h1>
<p>Junior Web Developer</p>
</div>
</section>
<!-- lavori -->
<section>
<div id="works">
<h2 class="text">These are all my works so far</h2>
<div class="works">
<a id="projects" class="projects1" href="#">
<img class="images" src="http://placekitten.com/200/300" alt="">
<p class="pj-title"><span class="code"><</span> prova <span class="code">/></span></p>
</a>
<a id="projects" class="projects2" href="#">
<img class="images" src="http://placekitten.com/200/300" alt="">
<p class="pj-title"><span class="code"><</span> prova <span class="code">/></span></p>
</a>
<a id="projects" class="projects3" href="#">
<img class="images" src="http://placekitten.com/200/300" alt="">
<p class="pj-title"><span class="code"><</span> prova <span class="code">/></span></p>
</a>
<a id="projects" class="projects4" href="#">
<img class="images" src="http://placekitten.com/200/300" alt="">
<p class="pj-title"><span class="code"><</span> prova <span class="code">/></span></p>
</a>
<a id="projects" class="projects5" href="#">
<img class="images" src="http://placekitten.com/200/300" alt="">
<p class="pj-title"><span class="code"><</span> prova <span class="code">/></span></p>
</a>
<a id="projects" class="projects6" href="#">
<img class="images" src="http://placekitten.com/200/300" alt="">
<p class="pj-title"><span class="code"><</span> prova <span class="code">/></span></p>
</a>
</div>
</div>
</section>
as I said I'm trying everything but I can't manage to make them wrap and center do the center page

Related

How can I Fit Image inside Grid Layout

I am creating this layout
My code :
<div class="tour-grid">
<div class="tgItem tg-left">
<a href="" class="tgCard">
<div class="tgCard__image ro-4">
<img class="ro-4 js-lazy loaded" src="img/tours/3.png" alt="image" data-ll-status="loaded">
</div>
</a>
</div>
<div class="tgItem tgChild">
<a href="" class="tgCard">
<div class="tgCard__image ro-4">
<img class="ro-4 js-lazy loaded" src="img/blog/2/2.png" alt="image" data-ll-status="loaded">
</div>
</a>
</div>
<div class="tgItem tgChild">
<a href="" class="tgCard">
<div class="tgCard__image ro-4">
<img class="ro-4 js-lazy loaded" src="img/blog/2/3.png" alt="image" data-ll-status="loaded">
</div>
</a>
</div>
<div class="tgItem tgChild">
<a href="" class="tgCard">
<div class="tgCard__image ro-4">
<img class="ro-4 js-lazy loaded" src="img/tours/2.png" alt="image" data-ll-status="loaded">
</div>
</a>
</div>
</div>
Check my fiddle
But grid are not equal and image doesn't fit inside div.
Right div height should adjust to left col
what is rules with grid system ? should i wrap 3 div into one. ?
You can simplify your code like below
.grid {
display: grid;
grid-auto-flow: column;
grid-gap: 10px;
max-width: 600px;
margin: 20px auto;
}
.grid img:first-child {
grid-area: span 3/span 2;
}
img {
width: 100%;
height: 100%;
object-fit: cover;
}
<div class="grid">
<img src="https://picsum.photos/id/1074/600/400">
<img src="https://picsum.photos/id/1074/300/200">
<img src="https://picsum.photos/id/1074/300/200">
<img src="https://picsum.photos/id/1074/300/200">
</div>
I have an article explaining this code and more: https://css-tricks.com/exploring-css-grids-implicit-grid-and-auto-placement-powers/#image-grid

Bootstrap 4 Carousel with image indicators placement on left or right side

I have a Bootstrap 4 carousel with image indicators. These are placed under the actual image:
Default behavior
The desired solution would be that the indicators are placed on the left or right side of the image (Just need an idea for the CSS, the rest with the CMS I can do by myself):
Desired right
Desired left
HTML:
<div class="product-gallery__desktop">
<div id="carousel" class="product-gallery__desktop__carousel carousel slide gallery" data-ride="carousel" data-interval="false">
<div class="carousel-inner">
<div class="product-gallery__desktop__carousel-item carousel-item active" data-slide-number="0" data-toggle="lightbox"
data-gallery="gallery"
data-remote="https://via.placeholder.com/600">
<img src="https://via.placeholder.com/600" class="d-block w-100"
alt="...">
</div>
<div class="product-gallery__desktop__carousel-item carousel-item" data-slide-number="1" data-toggle="lightbox"
data-gallery="gallery"
data-remote="https://via.placeholder.com/600">
<img src="https://via.placeholder.com/600" class="d-block w-100"
alt="...">
</div>
<div class="product-gallery__desktop__carousel-item carousel-item" data-slide-number="2" data-toggle="lightbox"
data-gallery="gallery"
data-remote="https://via.placeholder.com/600">
<img src="https://via.placeholder.com/600" class="d-block w-100"
alt="...">
</div>
<div class="product-gallery__desktop__carousel-item carousel-item" data-slide-number="3" data-toggle="lightbox"
data-gallery="gallery"
data-remote="https://via.placeholder.com/600">
<img src="https://via.placeholder.com/600" class="d-block w-100"
alt="...">
</div>
<div class="product-gallery__desktop__carousel-item carousel-item" data-slide-number="4" data-toggle="lightbox"
data-gallery="gallery"
data-remote="https://via.placeholder.com/600">
<img src="https://via.placeholder.com/600" class="d-block w-100"
alt="...">
</div>
<div class="product-gallery__desktop__carousel-item carousel-item" data-slide-number="5" data-toggle="lightbox"
data-gallery="gallery"
data-remote="https://via.placeholder.com/600">
<img src="https://via.placeholder.com/600" class="d-block w-100"
alt="...">
</div>
</div>
</div>
<!-- Carousel Navigatiom -->
<div id="product-gallery__carousel-thumbs" class="product-gallery__desktop__carousel-thumbs carousel slide" data-interval="false" data-ride="carousel">
<div class="carousel-inner">
<div class="carousel-item active" data-slide-number="0">
<div class="row mx-0">
<div id="carousel-selector-0" class="thumb col-3 px-1 py-2 selected"
data-target="#carousel" data-slide-to="0">
<img src="https://via.placeholder.com/600"
class="img-fluid" alt="...">
</div>
<div id="carousel-selector-1" class="thumb col-3 px-1 py-2" data-target="#carousel"
data-slide-to="1">
<img src="https://via.placeholder.com/600"
class="img-fluid" alt="...">
</div>
<div id="carousel-selector-2" class="thumb col-3 px-1 py-2" data-target="#carousel"
data-slide-to="2">
<img src="https://via.placeholder.com/600"
class="img-fluid" alt="...">
</div>
<div id="carousel-selector-3" class="thumb col-3 px-1 py-2" data-target="#carousel"
data-slide-to="3">
<img src="https://via.placeholder.com/600"
class="img-fluid" alt="...">
</div>
</div>
</div>
<div class="carousel-item " data-slide-number="1">
<div class="row mx-0">
<div id="carousel-selector-4" class="thumb col-3 px-1 py-2" data-target="#carousel"
data-slide-to="4">
<img src="https://via.placeholder.com/600"
class="img-fluid" alt="...">
</div>
<div id="carousel-selector-5" class="thumb col-3 px-1 py-2" data-target="#carousel"
data-slide-to="5">
<img src="https://via.placeholder.com/600"
class="img-fluid" alt="...">
</div>
</div>
</div>
</div>
<a class="product-gallery__desktop__carousel-control-prev carousel-control-prev" href="#product-gallery__carousel-thumbs" role="button" data-slide="prev">
<span class="carousel-control-prev-icon carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="product-gallery__desktop__carousel-control-next carousel-control-next" href="#product-gallery__carousel-thumbs" role="button" data-slide="next">
<span class="carousel-control-next-icon carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
</div>
SCSS:
.product-gallery{
&__desktop{
padding-left: 100px;
#include media-breakpoint-up(md) {
display: block;
}
#include media-breakpoint-down(sm) {
display: none;
}
&__carousel{
position: relative;
}
&__carousel-item{
img{
object-fit: cover;
}
}
&__carousel-thumbs{
background: #f0f0f0;
padding: 0 50px;
img:hover{
opacity: 100%;
}
img{
opacity: 80%;
border: 3px solid transparent;
cursor: pointer;
}
.selected img{
opacity: 100%;
}
.carousel-control-prev-icon{
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='rgba(0,0,0,.60)' viewBox='0 0 8 8'%3E%3Cpath d='M5.25 0l-4 4 4 4 1.5-1.5-2.5-2.5 2.5-2.5-1.5-1.5z'/%3E%3C/svg%3E") !important;
}
.carousel-control-next-icon{
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%60000' viewBox='0 0 8 8'%3E%3Cpath d='M2.75 0l-1.5 1.5 2.5 2.5-2.5 2.5 1.5 1.5 4-4-4-4z'/%3E%3C/svg%3E") !important;
}
}
&__carousel-control-prev{
width: 50px;
}
&__carousel-control-next{
width: 50px;
}
}
&__mobile{
#include media-breakpoint-up(md) {
display: none;
}
#include media-breakpoint-down(sm) {
display: block;
}
margin-top: 0;
&__indicators{
margin-bottom: -1.75rem;
align-items: center;
li {
width: 5px;
height: 5px;
border-radius: 100%;
background-color: #808080;
margin-left: 4px;
margin-right: 4px;
&.active {
width: 8px;
height: 8px;
border-radius: 100%;
background-color: #f58220;
}
}
}
}
}

Making the last grid cell(s) inactive

I have a 4 column grid made with ReactJS. The grid contains a certain number of elements with pictures and text on them. If there's five elements filled, the last three need to be inactive, so there's always four columns on every row, no empty space lying around.
The last cell(s) (max 3.) should always be inactive. No hover, no focus, just an empty element.
The grid elements are fetched from a hardcoded JSON. At the moment my last cell is just {[name: '', img: ''}]
Im fairly new to ReactJS and can't come up with a solution or find one in stackoverflow. Pointing in the right direction would be appreciated.
const GridItem = ({ name, path, altText }) => {
return (
<li className={'grid-item'} key={name}>
<a className={'link'}>
<div className={'image'}>
<img src={path} alt={altText} />
</div>
<div className={'image-text'}>{name}</div>
</a>
</li>
);
};
Expected output:
[img] [img] [img] [img]
[img] [null] [null] [null]
This is more like a css question, and there're a lot of ways to achieve this.
I recommend to use display: grid and grid-template-columns to make grid-based layouts:
.grid {
width: 100%;
display: grid;
grid-template-columns: repeat(4, 1fr);
grid-gap: 2px;
}
.grid img {
width: 100%;
}
<div class="grid">
<img src="https://picsum.photos/200/200" />
<img src="https://picsum.photos/200/200" />
<img src="https://picsum.photos/200/200" />
<img src="https://picsum.photos/200/200" />
<img src="https://picsum.photos/200/200" />
</div>
You don't have to create fake cells, but if you really want, you can just add some simple css to hide them:
.grid {
width: 100%;
display: grid;
grid-template-columns: repeat(4, 1fr);
grid-gap: 2px;
}
.grid img {
width: 100%;
}
.grid img[src=""] {
display: none;
}
<div class="grid">
<img src="https://picsum.photos/200/200" />
<img src="https://picsum.photos/200/200" />
<img src="https://picsum.photos/200/200" />
<img src="https://picsum.photos/200/200" />
<img src="https://picsum.photos/200/200" />
<img src="" />
<img src="" />
<img src="" />
</div>
Update
You can change your code like this, if the name is empty, give this cell some hint, so you can style it easily:
const GridItem = ({ name, path, altText }) => {
return (
<li className={'grid-item'} key={name}>
<a className={`${name ? 'link' : 'link link__empty'}`}>
<div className={'image'}>
<img src={path} alt={altText} />
</div>
<div className={'image-text'}>{name}</div>
</a>
</li>
);
Or just don't populate its contents at all:
const GridItem = ({ name, path, altText }) => {
return (
<li className={'grid-item'} key={name}>
<a className={'link'}>
(name &&
<React.Fragment>
<div className={'image'}>
<img src={path} alt={altText} />
</div>
<div className={'image-text'}>{name}</div>
</React.Fragment>)
</a>
</li>
);
The result should be like this:
* {
box-sizing: border-box;
}
.grid {
display: flex;
flex-wrap: wrap;
list-style: none;
}
.grid-item {
/* exclude the border, make it 4 columned grid */
flex: 0 1 calc(25% - 2px);
/* the border is 1px, so the equation above is minus 2px*/
border: solid #000 1px;
}
.link {
text-decoration: none;
}
.image {
width: 100%;
}
.image-text {
text-align: center;
}
.link__empty *{
/* if it's empty, do not display any of it's children */
display: none;
}
<ul class="grid">
<li class="grid-item">
<a class="link" href="javascript: void(0)">
<img class="image" src="https://picsum.photos/200/200" alt="image" />
<div class="image-text">image</div>
</a>
</li>
<li class="grid-item">
<a class="link" href="javascript: void(0)">
<img class="image" src="https://picsum.photos/200/200" alt="image" />
<div class="image-text">image</div>
</a>
</li>
<li class="grid-item">
<a class="link" href="javascript: void(0)">
<img class="image" src="https://picsum.photos/200/200" alt="image" />
<div class="image-text">image</div>
</a>
</li>
<li class="grid-item">
<a class="link" href="javascript: void(0)">
<img class="image" src="https://picsum.photos/200/200" alt="image" />
<div class="image-text">image</div>
</a>
</li>
<li class="grid-item">
<a class="link" href="javascript: void(0)">
<img class="image" src="https://picsum.photos/200/200" alt="image" />
<div class="image-text">image</div>
</a>
</li>
<li class="grid-item">
<a class="link link__empty" href="javascript: void(0)">
<img class="image" src="" alt="" />
<div class="image-text"></div>
</a>
</li>
<li class="grid-item">
<a class="link link__empty" href="javascript: void(0)">
<img class="image" src="" alt="" />
<div class="image-text"></div>
</a>
</li>
<li class="grid-item">
<a class="link link__empty" href="javascript: void(0)">
<img class="image" src="" alt="" />
<div class="image-text"></div>
</a>
</li>
</ul>

multiple widths css grid

So I'm attempting to create a grid like this
Where I have the top and bottom posts the same size and have one post in the middle slim down and auto-fill the remaining space.
Here is my code
<section class="posts-grid">
<article class="post">
<img src="https://blog.flyingsaucer.nyc/hs-fs/hubfs/blog/pitchadri.png?width=1464&name=pitchadri.png" alt="">
<div class="blog-listing-info">
<a href="#">
<h2 class="blog-listing-title">13 things to make your US and UI design much better</h2>
</a>
<p class="blog-listing-tag">Design - 11 min read</p>
</div>
</article>
<article class="post">
<img src="https://blog.flyingsaucer.nyc/hs-fs/hubfs/blog/pitchadri.png?width=1464&name=pitchadri.png" alt="">
<div class="blog-listing-info">
<a href="#">
<h2 class="blog-listing-title">13 things to make your US and UI design much better</h2>
</a>
<p class="blog-listing-tag">Design - 11 min read</p>
</div>
</article>
<article class="post long-post">
<div class="blog-listing-info">
<a href="#">
<h2 class="blog-listing-title">13 things to make your US and UI design much better</h2>
</a>
<p class="blog-listing-tag">Design - 11 min read</p>
</div>
</article>
<article class="post">
<img src="https://blog.flyingsaucer.nyc/hs-fs/hubfs/blog/pitchadri.png?width=1464&name=pitchadri.png" alt="">
<div class="blog-listing-info">
<a href="#">
<h2 class="blog-listing-title">13 things to make your US and UI design much better</h2>
</a>
<p class="blog-listing-tag">Design - 11 min read</p>
</div>
</article>
<article class="post">
<img src="https://blog.flyingsaucer.nyc/hs-fs/hubfs/blog/pitchadri.png?width=1464&name=pitchadri.png" alt="">
<div class="blog-listing-info">
<a href="#">
<h2 class="blog-listing-title">13 things to make your US and UI design much better</h2>
</a>
<p class="blog-listing-tag">Design - 11 min read</p>
</div>
</article>
<article class="post">
<img src="https://blog.flyingsaucer.nyc/hs-fs/hubfs/blog/pitchadri.png?width=1464&name=pitchadri.png" alt="">
<div class="blog-listing-info">
<a href="#">
<h2 class="blog-listing-title">13 things to make your US and UI design much better</h2>
</a>
<p class="blog-listing-tag">Design - 11 min read</p>
</div>
</article>
</section>
css
.posts-grid {
grid-template-areas:
"post post"
"long-post post"
"post post";
grid-template-columns: 15% 1fr;
grid-template-rows: 80px 1fr;
grid-auto-rows: 385px;
grid-column-gap: 23px;
grid-row-gap: 20px;
height: 100vh;
display: grid;
}
.post { grid-area: post; }
.post.long-post { grid-area: long-post !important; }
I have created a codepen https://codepen.io/ben_bagley/pen/30272c1f61b4f20c080040f5359bd5f1 but as you can see it it's ignoring a good like so
Any help in getting the desired effect is appreciated.
this is the best I could do, I hope it helps.
HTML:
<section class="posts-grid">
<article class="post">
<img src="https://blog.flyingsaucer.nyc/hs-fs/hubfs/blog/pitchadri.png?
width=1464&name=pitchadri.png" alt="">
<div class="blog-listing-info">
<a href="#">
<h2 class="blog-listing-title">13 things to make your US and UI design
much better</h2>
</a>
<p class="blog-listing-tag">Design - 11 min read</p>
</div>
</article>
<article class="post">
<img src="https://blog.flyingsaucer.nyc/hs-fs/hubfs/blog/pitchadri.png?
width=1464&name=pitchadri.png" alt="">
<div class="blog-listing-info">
<a href="#">
<h2 class="blog-listing-title">13 things to make your US and UI design much better</h2>
</a>
<p class="blog-listing-tag">Design - 11 min read</p>
</div>
</article>
<article class="post">
<img src="https://blog.flyingsaucer.nyc/hs-fs/hubfs/blog/pitchadri.png?width=1464&name=pitchadri.png" alt="">
<div class="blog-listing-info">
<a href="#">
<h2 class="blog-listing-title">13 things to make your US and UI design much better</h2>
</a>
<p class="blog-listing-tag">Design - 11 min read</p>
</div>
</article>
<article class="long-post">
<div class="blog-listing-info">
<a href="#">
<h2 class="blog-listing-title">13 things to make your US and UI design much better</h2>
</a>
<p class="blog-listing-tag">Design - 11 min read</p>
</div>
</article>
<article class="post">
<img src="https://blog.flyingsaucer.nyc/hs-fs/hubfs/blog/pitchadri.png?width=1464&name=pitchadri.png" alt="">
<div class="blog-listing-info">
<a href="#">
<h2 class="blog-listing-title">13 things to make your US and UI design much better</h2>
</a>
<p class="blog-listing-tag">Design - 11 min read</p>
</div>
</article>
<article class="post">
<img src="https://blog.flyingsaucer.nyc/hs-fs/hubfs/blog/pitchadri.png?width=1464&name=pitchadri.png" alt="">
<div class="blog-listing-info">
<a href="#">
<h2 class="blog-listing-title">13 things to make your US and UI design much better</h2>
</a>
<p class="blog-listing-tag">Design - 11 min read</p>
</div>
</article>
<article class="post">
<img src="https://blog.flyingsaucer.nyc/hs-fs/hubfs/blog/pitchadri.png?width=1464&name=pitchadri.png" alt="">
<div class="blog-listing-info">
<a href="#">
<h2 class="blog-listing-title">13 things to make your US and UI design much better</h2>
</a>
<p class="blog-listing-tag">Design - 11 min read</p>
</div>
</article>
</section>
The SCSS:
* {
padding: 0px;
margin: 0px;
box-sizing: border-box;
}
.posts-grid {
padding: 10px;
display: grid;
grid-gap: 10px;
grid-template-columns: repeat(5, 1fr);
grid-template-rows: auto;
.post, .long-post {
padding: 10px;
border-radius: 6px;
}
.post:first-child, .long-post + .post {
background: greenyellow;
grid-column-end: span 3;
}
.post + .post + .post {
grid-column-end: span 1;
}
.post {
background: lightblue;
grid-column-start: auto;
grid-column-end: span 2;
}
.long-post {
background: red;
grid-column-end: span 4;
}
img {
width: 100%;
height: auto;
}
}
And here is the JsFiddle:
https://jsfiddle.net/cisco336/ebt0zfvr/

CSS tiles size tweak

i am trying to make my tiles look the same even text inside increase.but it does seems to be able to work even with word property.i want to make the "buy extended warranty" and ""List machines for service pack" to be same as others.
Anyone can help?
.tile {
width: 100%;
display: inline-block;
box-sizing: border-box;
background: #fff;
padding: 30px;
margin-bottom: 40px;
text-align:center;
}
.tile:hover
{
background:#F8F9F9;
}
<div class="tab-pane active" id="warranty">
<div class="col-md-4">
<a class="tile" style="background-color:#EBDEF0;" href="#">Show warranty </a>
</div>
<div class="col-md-4">
<a class="tile" style="background-color:#EBDEF0;" href="#">New Warranty</a>
</div>
<div class="col-md-4 ">
<a class="tile" style="background-color:#EBDEF0;" href="#">Delete Warranty</a>
</div>
<div class="col-md-4 ">
<a class="tile " style="background-color:#EBDEF0;" href="#">Enter Invoice</a>
</div>
<div class="col-md-4 ">
<a class="tile" style="background-color:#EBDEF0;" href="#">Enter Serial </a>
</div>
<div class="col-md-4">
<a class="tile" style="background-color:#EBDEF0;" href="#">Buy extended warranty </a>
</div>
<div class="col-md-4 ">
<a class="tile" style="background-color:#EBDEF0;" href="#">List Machines for service pack</a>
</div>
</div>
You could use flex-box for this:
css:
.tab-pane {
display: flex;
flex-wrap: wrap;
}
.tile {
width: 100%;
padding: 30px;
margin-bottom: 40px;
text-align: center;
display: block;
}
.tile:hover {
background: #F8F9F9 !important;
}
HTML
<div class="tab-pane active" id="warranty">
<div class="col-sm-4">
<a class="tile" style="background-color:#EBDEF0;" href="#">Show warranty </a>
</div>
<div class="col-sm-4">
<a class="tile" style="background-color:#EBDEF0;" href="#">New Warranty</a>
</div>
<div class="col-sm-4 ">
<a class="tile" style="background-color:#EBDEF0;" href="#">Delete Warranty</a>
</div>
<div class="col-sm-4 ">
<a class="tile " style="background-color:#EBDEF0;" href="#">Enter Invoice</a>
</div>
<div class="col-sm-4 ">
<a class="tile" style="background-color:#EBDEF0;" href="#">Enter Serial </a>
</div>
<div class="col-sm-4">
<a class="tile" style="background-color:#EBDEF0;" href="#">Buy extended warranty </a>
</div>
<div class="col-sm-4 ">
<a class="tile" style="background-color:#EBDEF0;" href="#">List Machines for service pack</a>
</div>
</div>
I adjusted the class on your col-md-4 to col-sm-4 so you could see it in action. I included the bootstrap CDN CSS, as you are using bootstrap class names in your HTML. And I added !important to override your inline color styles on the anchor tags.
Here's the fiddle to see it in action:
https://jsfiddle.net/mjqfjbh0/1/

Resources