Apply gradient brightness filter to image - html

I have a series of photos displayed in a bootstraps card class. The images need to have white text on top of them, so I have added a dark filter to the photos filter: brightness(60%); so the text is clear to read.
See how the image currently looks https://i.ibb.co/TTTdrDP/card-image.jpg
The white text is only positioned at the bottom of the photos so I'd like to only apply the filter: brightness(60%); to the bottom of the image only and fade into the normal brightness.
I've tried many forms of gradient but all that does is apply a hard colour over the photo (removing the photo completely), rather than a transparent (gradient) filter on top of the image?
My CSS
<style>
.card {
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.2);
transition: 0.3s;
width: 100%;
}
.card:hover {
box-shadow: 0 6px 10px 0 rgba(0, 0, 0, 0.2);
}
/* Card image dark filter */
.card-img-top {
width: 100%;
height: 220px;
object-fit: cover;
filter: brightness(60%);
}
/* Align heading text to bottom of photo */
.bottom {
position: absolute;
right: 0;
left: 0;
padding: 10px;
bottom: 0px;
padding-bottom: 40px;
}
.card-footer {
font-size: 12px;
font-weight: normal;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
color: grey;
background-color: #eeeeee !important;
}
</style>
Image card
<div class="card" style="width:100%;">
<img class="card-img-top" src="PHOTO HERE" alt="Card image">
<div class="card-img-overlay">
<div class="bottom text-light">
<h2>Hiking in Eastbourne for all who want to join.</h2>
</div>
</div>
<div class="card-footer p-2">
<div class="d-flex">
<div>
<i class="fa fa-calendar-alt fa-fw"></i><a>&nbsp</a><a>4th June</a>
</div>
<div class="ml-auto">
<a>3421</a><a>&nbsp</a><i class="fa fa-user-friends fa-fw"></i>
</div>
</div>
</div>
</div>
[1]: https://i.ibb.co/TTTdrDP/card-image.jpg

Do you mean something like this?
.card {
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.2);
transition: 0.3s;
width: 100%;
}
.card:hover {
box-shadow: 0 6px 10px 0 rgba(0, 0, 0, 0.2);
}
/* Card image dark filter */
.card-img-top {
width: 100%;
height: 220px;
object-fit: cover;
filter: brightness(100%);
}
/* Align heading text to bottom of photo */
.bottom {
position: absolute;
right: 0;
left: 0;
bottom: 35px;
padding-top: 90px;
padding-left: 10px;
padding-right: 10px;
height: 150px;
background: linear-gradient(to top, rgba(0, 0, 0, 1), rgba(0, 0, 0, 0));
}
.card-footer {
font-size: 12px;
font-weight: normal;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
color: grey;
background-color: #eeeeee !important;
/*filter: brightness(100%); */
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<div class="card" style="width:100%;">
<img class="card-img-top" src="https://media-cdn.tripadvisor.com/media/photo-s/0f/3d/89/4d/foto-com-dome.jpg" alt="Card image">
<div class="card-img-overlay">
<div class="bottom text-light">
<h2>Hiking in Eastbourne for all who want to join.</h2>
</div>
</div>
<div class="card-footer p-2">
<div class="d-flex">
<div>
<i class="fa fa-calendar-alt fa-fw"></i><a> </a><a>4th June</a>
</div>
<div class="ml-auto">
<a>3421</a><a> </a><i class="fa fa-user-friends fa-fw"></i>
</div>
</div>
</div>
</div>

Related

Web page structure not staying aligned on zooming

I am having problem displaying my content in proper alignment. I made a timer web app using html and css, but the display structure gets messed up when i zoom in or out in the web page. The outer box and inner button do not zoom in or out together also the buttons go into the next line when zoomed in. I have attached screenshots of how they look.
Web page on 100%
Zoomed in
I used flex boxes to align the components
Here is the code I wrote:
body {
height: 100vh;
font-family: "Poppins", "PT sans", Arial, sans-serif;
background-image: url("bg.jpg");
background-repeat: no-repeat;
background-attachment: fixed;
background-size: cover;
display: flex;
justify-content: center;
align-items: center;
}
.container {
background-color: rgba(0, 0, 0, 0.8);
border-radius: 10%;
-webkit-box-shadow: 0px 2px 7px 8px rgba(255, 255, 255, 0.40);
box-shadow: 0px 6px 12px 13px rgba(255, 255, 255, 0.40);
width: 55vh;
height: 70vh;
display: flex;
flex-direction: column;
}
.image {
margin-top: 10%;
}
.block {
display: inline-block;
}
span {
font-size: 50px;
color: white;
}
button {
align-items: center;
margin: 12px;
border-radius: 50px;
font-size: 18px;
height: 90%;
padding: 10px 40px;
z-index: 1;
cursor: pointer;
transition: 0.5s;
position: relative;
}
button:hover {
color: white;
background: none;
}
/*.button::before{
content: "";
position: absolute;
left: 0;
height: 0%;
width: 100%;
background: none;
z-index: -1;
transition: 0.5s;
}*/
<body>
<div class="container">
<div class="image">
<center><img src="timer.png" width="40%" height="20%" alt="" id="timer">
<br>
<span id="countdown"> 60 </span> <span id="plural">s</span>
<br>
<div class="block">
<button id="start" name="start" class="fill" onclick="startTimer()">START</button><br>
<button id="add" name="+5" class="fill" onclick="add()">+5</button><br>
</div>
<div class="block">
<button id="pause" name="pause" class="fill" onclick="pauseTimer()">PAUSE</button> <br>
<button id="remove" name="remove" class="fill" onclick="remove()">-5</button> <br>
</div>
<div class="block2"><button id="end" name="" class="fill" onclick="endTimer()">END</button></div>
</center>
</div>
<!-- <div class="text"></div> -->
<div></div>
</div>
<script src="index.js"></script>
</body>
I just got started so any help would be great. Thanks!
I am guessing a little at what you're going for, but if I understand your correctly, your height and width values on .container were causing you problems. I removed them, and also replaced <center> with a <div> as Paulie commented, it is obsolete:
body {
height: 100vh;
font-family: "Poppins", "PT sans", Arial, sans-serif;
background-image: url("bg.jpg");
background-repeat: no-repeat;
background-attachment: fixed;
background-size: cover;
display: flex;
justify-content: center;
align-items: center;
}
.container {
text-align: center;
background-color: rgba(0, 0, 0, 0.8);
border-radius: 10%;
-webkit-box-shadow: 0px 2px 7px 8px rgba(255, 255, 255, 0.40);
box-shadow: 0px 6px 12px 13px rgba(255, 255, 255, 0.40);
display: flex;
flex-direction: column;
}
.image {
margin-top: 10%;
}
.block {
display: inline-block;
}
span {
font-size: 50px;
color: white;
}
button {
align-items: center;
margin: 12px;
border-radius: 50px;
font-size: 18px;
height: 90%;
padding: 10px 40px;
z-index: 1;
cursor: pointer;
transition: 0.5s;
position: relative;
}
button:hover {
color: white;
background: none;
}
<body>
<div class="container">
<div class="image">
<div><img src="timer.png" width="40%" height="20%" alt="" id="timer">
<br>
<span id="countdown"> 60 </span> <span id="plural">s</span>
<br>
<div class="block">
<button id="start" name="start" class="fill" onclick="startTimer()">START</button><br>
<button id="add" name="+5" class="fill" onclick="add()">+5</button><br>
</div>
<div class="block">
<button id="pause" name="pause" class="fill" onclick="pauseTimer()">PAUSE</button> <br>
<button id="remove" name="remove" class="fill" onclick="remove()">-5</button> <br>
</div>
<div class="block2"><button id="end" name="" class="fill" onclick="endTimer()">END</button></div>
</div>
</div>
<!-- <div class="text"></div> -->
<div></div>
</div>
<script src="index.js"></script>
</body>

How to make responsive horizontal cards?

My code
I want to create responsive horizontal cards but failing in all cases.
I kind of tried to give different background image according to to the viewport but still failing to accomplish.
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh"
crossorigin="anonymous">
<!-- Font Awesome -->
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.2/css/all.css">
<!-- Material Design Bootstrap -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/mdbootstrap/4.15.0/css/mdb.min.css" rel="stylesheet">
<!-- add icon link -->
<link rel="icon" href="./img/icon1.icon" type="image/x-icon">
<link rel="stylesheet" href="pool.css">
<link rel="stylesheet" href="font.css">
<!-- scrollReveal property -->
<script src="https://unpkg.com/scrollreveal#4"></script>
<script>
window.sr = ScrollReveal({
distance: '50px', //for animation of page scroll
duration: 1000,
easing: 'ease',
mobile: true,
reset: true,
viewFactor: 0.4,
});
</script>
<title>Pool2 | PLAY4LUX</title>
</head>
<body>
<div class="poolContainer">
<div class="container-fluid">
<div class="row ">
<div class="col">
<div class="poolBackground hoverable">
<div class="row poolContentRow">
<!-- Image Container -->
<div class="col-sm-5">
<div class="poolImageContainer"></div>
</div>
<!-- pool Right side content -->
<div class="col-sm-7">
<div class="poolRightContentContainer">
<h3 class="productName gara">GIORGIO ARMANI</h3>
<!-- drawdate -->
<div class="drawDate clearfix gara">
<h6 class="title">Draw Date :</h6>
<h5 class="data float-right">10 / 09 /2020</h5>
</div>
<!-- winning odds -->
<div class="winningOdd clearfix gara">
<h6 class="title">Winning Odds :</h6>
<h5 class="data float-right focused">10 / 300</h5>
</div>
<!-- Actual Price -->
<div class="actualPrice clearfix gara">
<h6 class="title">Actual Price :</h6>
<h5 class="data float-right">180,000.0/-</h5>
</div>
<!-- token Price -->
<div class="tokenPrice clearfix gara">
<h6 class="title">Token Price :</h6>
<h5 class="data float-right focused">180/-</h5>
</div>
<!-- button -->
<div class="buyTicket text-center">
<button class=" btnGold">Buy Ticket</button>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col">
<div class="poolBackground hoverable">
<div class="row poolContentRow">
<!-- Image Container -->
<div class="col-sm-5">
<div class="poolImageContainer"></div>
</div>
<!-- pool Right side content -->
<div class="col-sm-7">
<div class="poolRightContentContainer">
<h3 class="productName gara">GIORGIO ARMANI</h3>
<!-- drawdate -->
<div class="drawDate clearfix gara">
<h6 class="title">Draw Date :</h6>
<h5 class="data float-right">10 / 09 /2020</h5>
</div>
<!-- winning odds -->
<div class="winningOdd clearfix gara">
<h6 class="title">Winning Odds :</h6>
<h5 class="data float-right focused">10 / 300</h5>
</div>
<!-- Actual Price -->
<div class="actualPrice clearfix gara">
<h6 class="title">Actual Price :</h6>
<h5 class="data float-right">180,000.0/-</h5>
</div>
<!-- token Price -->
<div class="tokenPrice clearfix gara">
<h6 class="title">Token Price :</h6>
<h5 class="data float-right focused">180/-</h5>
</div>
<!-- button -->
<div class="buyTicket text-center">
<button class=" btnGold">Buy Ticket</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js " integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n "
crossorigin="anonymous "></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js#1.16.0/dist/umd/popper.min.js " integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo "
crossorigin="anonymous "></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js " integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6 "
crossorigin="anonymous "></script>
<!-- MDB core JavaScript -->
<script type="/text/javascript " src="https://cdnjs.cloudflare.com/ajax/libs/mdbootstrap/4.15.0/js/mdb.min.js "></script>
</body>
</html>
CSS
.container-fluid {
width: 78%;
margin: 0 auto;
}
.poolBackground {
background-image: url("image/r/Group\ 4#2x.png");
background-position: center;
background-size: cover;
background-repeat: no-repeat;
width: 565px;
height: 288px;
position: relative;
}
.poolImageContainer {
background-image: url(imgi1.jpg);
background-position: center;
background-size: cover;
background-repeat: no-repeat;
width: 204px;
height: 264px;
position: absolute;
top: 11px;
left: 30px;
box-shadow: 3px 5px 18px 0px #08061a;
border-width: 4px;
border-style: solid;
border-image: linear-gradient(45deg, #8e602c, #b98b43, #f8ed8d, #b98b43, #8e602c) 1 1 1 1;
}
.poolRightContentContainer {
position: absolute;
top: 38px;
padding-left: 28px;
width: 80%;
}
.productName {
font-size: 20px;
background: linear-gradient(45deg, #8e602c, #f8ed8d);
background: -webkit-linear-gradient(90deg, #8e602c, #f8ed8d, #8e602c);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
filter: drop-shadow(2px 3px 3px #000);
font-weight: 900;
margin-bottom: .9rem;
}
.title {
display: inline-block;
font-size: 17px;
font-weight: 600;
background: -webkit-linear-gradient(90deg, #fff, #fff);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
font-weight: 600;
}
.data {
font-size: 19px;
background: -webkit-linear-gradient(90deg, #fff, #fff);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
font-weight: 600;
}
.focused {
font-size: 20px;
background: -webkit-linear-gradient(90deg, #f8ed8d, #f8ed8d);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
font-weight: 900;
}
.drawDate, .winningOdd, .actualPrice, .tokenPrice {
background: -webkit-linear-gradient(90deg, #fff, #fff);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
filter: drop-shadow(2px 4px 3px #000);
font-weight: 600;
margin-bottom: .6rem;
}
/* On hover style */
.tokenPrice .title {
position: absolute;
right: 5px;
top: -39px;
}
.tokenPrice .data {
position: absolute;
right: 24px;
border: 1px solid yellow;
padding: 2px 6px;
}
.actualPrice .data {
position: absolute;
top: 42px;
left: 5px;
border: 1px solid yellow;
padding: 2px 6px;
/* box-shadow: 0px 6px 21px -9px black; */
}
.poolBackground:hover .tokenPrice .title {
position: initial;
}
.poolBackground:hover .tokenPrice .data {
position: initial;
border: none;
}
.poolBackground:hover .actualPrice .data {
position: initial;
border: none;
}
.poolBackground:hover .productName, .drawDate, .winningOdd, .actualPrice, .tokenPrice {
margin-bottom: .5rem;
}
/* end of on hover transition */
.buyTicket {
visibility: hidden;
transform: translateY(-17px);
margin-top: 17px;
}
.poolBackground:hover .buyTicket {
visibility: visible;
}
.btnGold {
border-width: 1px;
border-style: solid;
border-image: linear-gradient(45deg, #8e602c, #b98b43, #f8ed8d, #b98b43, #8e602c) 1 1 1 1;
font-size: 18px;
background: linear-gradient(45deg, #8e602c, #f8ed8d);
background: -webkit-linear-gradient(45deg, #8e602c, #f8ed8d, #8e602c);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
padding: 4px 20px;
box-shadow: 8px 4px 15px black;
}
/* media queries */
#media (min-width:1800px) and (max-width: 1920px) {
.poolBackground {
width: 100%;
height: 47vh;
}
.poolImageContainer {
width: 13.594vw;
height: 324px;
}
.poolRightContentContainer {
top: 56px;
}
}
#media (min-width:1387px) and (max-width: 1525px) {
.poolBackground {
background-image: url(image/r/Group\ 7#2x.jpg);
width: 100%;
height: 288px;
}
.poolImageContainer {
width: 12.625vw;
}
}
#media (min-width:565px) and (max-width: 1386px) {
.poolBackground {
background-image: url(image/r/Group\ 7#2x.jpg);
height: 288px;
}
.col {
flex-basis: 0;
-ms-flex-positive: 1;
flex-grow: 1;
max-width: auto;
}
.poolImageContainer {
width: 193px;
}
}
The things which i tried were:
tried giving image in html itself. it was resizing with vw but the inside contents were not resizing with it properly.
I thought of giving full block for one card on mobile and medium dimensions and two cards per row in large and above dimensions like in above picture but failed to accomplish it.
Have you tried controlling the div itself rather than the picture? You'd make the size of the containing div itself vary according to viewport, and the image CSS would look something like this:
img {
max-width: 100%;
height: auto;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh"
crossorigin="anonymous">
<!-- Font Awesome -->
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.2/css/all.css">
<!-- Material Design Bootstrap -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/mdbootstrap/4.15.0/css/mdb.min.css" rel="stylesheet">
<!-- add icon link -->
<link rel="icon" href="./img/icon1.icon" type="image/x-icon">
<link rel="stylesheet" href="pool.css">
<link rel="stylesheet" href="font.css">
<!-- scrollReveal property -->
<script src="https://unpkg.com/scrollreveal#4"></script>
<script>
window.sr = ScrollReveal({
distance: '50px', //for animation of page scroll
duration: 1000,
easing: 'ease',
mobile: true,
reset: true,
viewFactor: 0.4,
});
</script>
<title>Pool2 | PLAY4LUX</title>
</head>
<style>
.container-fluid {
width: 78%;
margin: 0 auto;
}
.poolBackground {
background-image: url("image/r/Group\ 4#2x.png");
background-position: center;
background-size: cover;
background-repeat: no-repeat;
max-width: 565px;
width: 100%;
min-height: 288px;
position: relative;
}
.poolImageContainer {
background-image: url(imgi1.jpg);
background-position: center;
background-size: cover;
background-repeat: no-repeat;
max-width: 204px;
width: 100%;
min-height: 264px;
/*position: absolute;*/
top: 11px;
left: 30px;
box-shadow: 3px 5px 18px 0px #08061a;
border-width: 4px;
border-style: solid;
border-image: linear-gradient(45deg, #8e602c, #b98b43, #f8ed8d, #b98b43, #8e602c) 1 1 1 1;
}
.poolRightContentContainer {
/*position: absolute;*/
top: 38px;
padding-left: 28px;
width: 80%;
}
.productName {
font-size: 20px;
background: linear-gradient(45deg, #8e602c, #f8ed8d);
background: -webkit-linear-gradient(90deg, #8e602c, #f8ed8d, #8e602c);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
filter: drop-shadow(2px 3px 3px #000);
font-weight: 900;
margin-bottom: .9rem;
}
.title {
display: inline-block;
font-size: 17px;
font-weight: 600;
background: -webkit-linear-gradient(90deg, #fff, #fff);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
font-weight: 600;
}
.data {
font-size: 19px;
background: -webkit-linear-gradient(90deg, #fff, #fff);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
font-weight: 600;
}
.focused {
font-size: 20px;
background: -webkit-linear-gradient(90deg, #f8ed8d, #f8ed8d);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
font-weight: 900;
}
.drawDate, .winningOdd, .actualPrice, .tokenPrice {
background: -webkit-linear-gradient(90deg, #fff, #fff);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
filter: drop-shadow(2px 4px 3px #000);
font-weight: 600;
margin-bottom: .6rem;
}
/* On hover style */
.tokenPrice .title {
/*position: absolute;*/
right: 5px;
top: -39px;
}
.tokenPrice .data {
/*position: absolute;*/
right: 24px;
border: 1px solid yellow;
padding: 2px 6px;
}
.actualPrice .data {
/*position: absolute;*/
top: 42px;
left: 5px;
border: 1px solid yellow;
padding: 2px 6px;
/* box-shadow: 0px 6px 21px -9px black; */
}
.poolBackground:hover .tokenPrice .title {
position: initial;
}
.poolBackground:hover .tokenPrice .data {
position: initial;
border: none;
}
.poolBackground:hover .actualPrice .data {
position: initial;
border: none;
}
.poolBackground:hover .productName, .drawDate, .winningOdd, .actualPrice, .tokenPrice {
margin-bottom: .5rem;
}
/* end of on hover transition */
.buyTicket {
visibility: hidden;
transform: translateY(-17px);
margin-top: 17px;
}
.poolBackground:hover .buyTicket {
visibility: visible;
}
.btnGold {
border-width: 1px;
border-style: solid;
border-image: linear-gradient(45deg, #8e602c, #b98b43, #f8ed8d, #b98b43, #8e602c) 1 1 1 1;
font-size: 18px;
background: linear-gradient(45deg, #8e602c, #f8ed8d);
background: -webkit-linear-gradient(45deg, #8e602c, #f8ed8d, #8e602c);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
padding: 4px 20px;
box-shadow: 8px 4px 15px black;
}
/* media queries */
#media (min-width:1800px) and (max-width: 1920px) {
.poolBackground {
width: 100%;
height: 47vh;
}
.poolImageContainer {
width: 13.594vw;
height: 324px;
}
.poolRightContentContainer {
top: 56px;
}
}
#media (min-width:1387px) and (max-width: 1525px) {
.poolBackground {
background-image: url(image/r/Group\ 7#2x.jpg);
width: 100%;
height: 288px;
}
.poolImageContainer {
width: 12.625vw;
}
}
#media (min-width:565px) and (max-width: 1386px) {
.poolBackground {
background-image: url(image/r/Group\ 7#2x.jpg);
height: 288px;
}
/*.col {
flex-basis: 0;
-ms-flex-positive: 1;
flex-grow: 1;
max-width: auto;
}*/
.poolImageContainer {
width: 193px;
}
}
</style>
<body>
<div class="poolContainer">
<div class="container-fluid">
<div class="row ">
<div class="col-md-6">
<div class="poolBackground">
<div class="row poolContentRow hoverable">
<!-- Image Container -->
<div class="col-sm-5">
<div class="poolImageContainer"></div>
</div>
<!-- pool Right side content -->
<div class="col-sm-7">
<div class="poolRightContentContainer">
<h3 class="productName gara">GIORGIO ARMANI</h3>
<!-- drawdate -->
<div class="drawDate clearfix gara">
<h6 class="title">Draw Date :</h6>
<h5 class="data float-right">10 / 09 /2020</h5>
</div>
<!-- winning odds -->
<div class="winningOdd clearfix gara">
<h6 class="title">Winning Odds :</h6>
<h5 class="data float-right focused">10 / 300</h5>
</div>
<!-- Actual Price -->
<div class="actualPrice clearfix gara">
<h6 class="title">Actual Price :</h6>
<h5 class="data float-right">180,000.0/-</h5>
</div>
<!-- token Price -->
<div class="tokenPrice clearfix gara">
<h6 class="title">Token Price :</h6>
<h5 class="data float-right focused">180/-</h5>
</div>
<!-- button -->
<div class="buyTicket text-center">
<button class=" btnGold">Buy Ticket</button>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-6">
<div class="poolBackground">
<div class="row poolContentRow hoverable">
<!-- Image Container -->
<div class="col-sm-5">
<div class="poolImageContainer"></div>
</div>
<!-- pool Right side content -->
<div class="col-sm-7">
<div class="poolRightContentContainer">
<h3 class="productName gara">GIORGIO ARMANI</h3>
<!-- drawdate -->
<div class="drawDate clearfix gara">
<h6 class="title">Draw Date :</h6>
<h5 class="data float-right">10 / 09 /2020</h5>
</div>
<!-- winning odds -->
<div class="winningOdd clearfix gara">
<h6 class="title">Winning Odds :</h6>
<h5 class="data float-right focused">10 / 300</h5>
</div>
<!-- Actual Price -->
<div class="actualPrice clearfix gara">
<h6 class="title">Actual Price :</h6>
<h5 class="data float-right">180,000.0/-</h5>
</div>
<!-- token Price -->
<div class="tokenPrice clearfix gara">
<h6 class="title">Token Price :</h6>
<h5 class="data float-right focused">180/-</h5>
</div>
<!-- button -->
<div class="buyTicket text-center">
<button class=" btnGold">Buy Ticket</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js " integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n "
crossorigin="anonymous "></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js#1.16.0/dist/umd/popper.min.js " integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo "
crossorigin="anonymous "></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js " integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6 "
crossorigin="anonymous "></script>
<!-- MDB core JavaScript -->
<script type="/text/javascript " src="https://cdnjs.cloudflare.com/ajax/libs/mdbootstrap/4.15.0/js/mdb.min.js "></script>
</body>
</html>
Few amendments.. but still i suggest to re-write the or i can write for you from scratch if u want.. cheers bro... Happy to Help...

Bootstrap 4.3 Make Navbar Static at Top of the Page AND Transparent

I have done my best checking and googling everywhere for info before asking here... Hopefully I am not redundant.
I am trying to make a static navbar at the top of my page in Bootstrap 4.3.
However, no matter how hard I try, it does not seem to be working:
- I have tried some of the former .static-top / .navbar-static-top classes and other similar workarounds ;
- I have also tried installing plugins (which I have now removed, due to ineffectiveness) - though this mostly "hides" the navbar, instead of leaving it static at the very top of the page.
- I have tried modifying, to no avail, my CSS with "top: 0;" and other formatting tags on the concerned elements.
I have cleaned my code again, to avoid making a big mess of things not working together. (my previous Bootstrap attempt finished in unusable code, hence me trying to be and stay clean, and remove unused / unnecessary code)
Feeling quite lost. Not a "super coder", mostly graphic designer with plenty of logic understanding. And desperate to have some kind of default functionality to make my navbar static.
The catch is my navbar has to remain transparent (this isn't always the case when working with some classes)
Here is my code.
/* 0. HTML Defaults
-----------------------------------------------------------------------------------------------------------------------------*/
:root {
--da-pink: lightpink;
--da-grey: rgba(5,5,5,1);
--da-grey: #454545;
--da-grey-grad: linear-gradient(to bottom right, #131313, #454545);
--da-grey-opac: rgba(69, 69, 69, .8);
--da-grey-opac: rgb(69, 69, 69);
}
html, body {
background-color: black;
background: rgba(65,65,65,1);
background: -moz-linear-gradient(-45deg, rgba(65,65,65,1) 0%, rgba(5,5,5,1) 100%);
background: -webkit-gradient(left top, right bottom, color-stop(0%, rgba(65,65,65,1)), color-stop(100%, rgba(5,5,5,1)));
background: -webkit-linear-gradient(-45deg, rgba(65,65,65,1) 0%, rgba(5,5,5,1) 100%);
background: -o-linear-gradient(-45deg, rgba(65,65,65,1) 0%, rgba(5,5,5,1) 100%);
background: -ms-linear-gradient(-45deg, rgba(65,65,65,1) 0%, rgba(5,5,5,1) 100%);
background: linear-gradient(135deg, rgba(65,65,65,1) 0%, rgba(5,5,5,1) 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#414141', endColorstr='#050505', GradientType=1 );
background-repeat: no-repeat;
background-attachment: fixed;
margin: 0;
height: 100%;
overflow: auto;
z-index: 10;
}
html body * {
}
h1 {
font-family: century-gothic, sans-serif;
font-weight: 700;
font-style: normal;
color: lightpink;
font-size: 3vw;
line-height: 4vw;
}
h2 {}
h3 {}
h4 {}
h5 {}
h6 {}
p {
font-family: itc-american-typewriter, serif;
font-weight: 300;
font-style: normal;
font-size: 12.5pt;
color: #ffffff;
text-align: justify;
text-decoration: none;
/* text-indent: 50px; */
/* word-spacing: 5px */
/* white-space: pre; */
letter-spacing: 1px;
/* line-height: 1.3; */
/* padding: 50px; */
display: block;
border:0;
}
p a:link {
text-decoration: none;
border-bottom: dotted;
font-family: century-gothic, sans-serif;
font-weight: 700;
font-style: normal;
font-size: 12.5pt;
color: lightpink;
}
p a:visited {
text-decoration: none;
font-family: century-gothic, sans-serif;
font-weight: 700;
font-style: normal;
font-size: 12.5pt;
color: lightpink;
}
p a:hover {
text-decoration: none;
border-bottom: dotted;
font-family: century-gothic, sans-serif;
font-weight: 700;
font-style: normal;
font-size: 12.5pt;
color: lightpink;
}
p a:active {
color: lightpink;
font-family: century-gothic, sans-serif;
font-weight: 700;
font-style: normal;
font-size: 12.5pt;
color: lightpink;
}
p.error {}
a,
a:link {}
a:hover {}
/* 10. NAV
-----------------------------------------------------------------------------------------------------------------------------*/
body > #nav_desktop {
position: absolute;
top: 0;
left: 0;
right: 0;
}
#nav_desktop > *,
#nav_desktop > div {
background: none !important;
/* background: rgba(0, 0, 0, .0) !important; */
}
.navbar {
margin-bottom: 0;
padding: 0 0;
z-index: 100;
}
/*
.navbar-toggle {
padding-top: 15px;
margin-top: 0px;
margin-bottom: 0;
} */
.navbar-nav.navbar-center {
position: absolute;
left: 50%;
transform: translate(-50%);
}
.nav_text {
font-family: itc-american-typewriter, serif;
font-weight: 300;
font-style: normal;
font-size: 12.5pt;
color: #ffffff;
letter-spacing: 2px;
}
/* 50. Header
-----------------------------------------------------------------------------------------------------------------------------*/
header {}
/* 60. Carousel Hero slider
-----------------------------------------------------------------------------------------------------------------------------*/
.carousel {
top:0;
}
.hero-text {
padding-top: 50px;
padding-bottom: 50px;
background-image: url('./logo_transp.png');
background-size: auto;
background-repeat: no-repeat;
background-position: center -50px;
text-shadow: 1px 1px 3px black;
text-align: center;
position: absolute;
top: 75%;
left: 50%;
transform: translate(-50%, -75%);
}
.carousel,
.item,
.active {
height:100vh;
}
.carousel-inner {
height:100vh;
}
.carousel-inner img {
margin: auto;
}
/* Zz. Bootstrap edit
-----------------------------------------------------------------------------------------------------------------------------*/
.overlay {
background: black;
opacity: 0.7;
/* background-size: cover; */
}
button {
display: inline-block;
border: 1px solid;
border-color: white;
padding: 10px 10px;
margin: 0;
text-decoration: none;
background: none;
color: white;
font-family: century-gothic, sans-serif;
font-weight:700;
font-style: normal;
font-size: 12 pt;
text-align: center;
}
button:hover,
button:focus {
background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5));
}
button:focus {
outline: 1px solid transparent;
outline-offset: -4px;
}
button:active {
transform: scale(0.99);
}
.clearfix::after {
content: " ";
clear: both;
display: table;
}
.responsive-image {
max-width: 100%;
height: auto;
}
.center-block {
display: block;
margin-left: auto;
margin-right: auto;
}
<!DOCTYPE html>
<html>
<head>
<title>Welcome to the Design Angels</title>
<!-- META DATA -->
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Welcome to theDesignAngels, we make it look glittery and shiny."/>
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="files/lib/jQuery.js"></script>
<script src="files/lib/lib/popper/Popper.js"></script>
<!-- BOOTSTRAP CSS -->
<script src="files/lib/bootstrap.min.js"></script>
<link rel="stylesheet" type="text/css" href="files/lib/bootstrap.min.css">
<!-- Libraries & frameworks -->
<script src="functions.js"></script>
<link rel="stylesheet" style="text/css" href="style.css"/>
<link rel="stylesheet" href="xxx">
<link rel="shortcut icon" href="assets/favicon.jpg" type="image/x-icon" />
</head>
<body>
<!-- NAVBAR -->
<nav id="nav_desktop" class="navbar navbar-expand-md" role="navigation">
<!-- Brand -->
<div class="container-fluid">
<a class="navbar-brand" href="#"><img src="logo_menu.png" style="width:180px;height:auto" alt="the Design Angels" data-toggle="tooltip" title="home"></a>
<!-- Collect the nav links, forms, and other content -->
<!-- Site nav -->
<ul class="nav navbar-nav navbar-center">
<li><a href="#services">
<span class="nav_text">SERVICES</span>
</a>
</li>
<li><a href="#portfolio">
<span class="nav_text">PORTFOLIO</span>
</a>
</li>
<li><a href="#contact">
<span class="nav_text">CONTACT</span>
</a>
</li>
</ul>
<!-- Social media -->
<ul class="nav navbar-nav ml-auto">
<li><a href="http://facebook.com/thedesignangels" target="_blank" alt="The Design Angels on Facebook">
<img src="social/fb_.png" onmouseover="this.src='./social/fb_mouseov.png'" onmouseout="this.src='./social/fb_.png'" style="height: 15px; margin-top: -5px;" >
</a>
</li>
<li><a href="https://www.instagram.com/thedesignangels/" target="_blank" alt="The Design Angels on Instagram">
<img src="social/inst_.png" onmouseover="this.src='./social/inst_mouseov.png'" onmouseout="this.src='./social/inst_.png'" style="height: 15px; margin-top: -5px;" >
</a>
<li><a href="https://twitter.com/thedesignangels" target="_blank" alt="The Design Angels on Twitter">
<img src="social/twit_.png" onmouseover="this.src='./social/twit_mouseov.png'" onmouseout="this.src='./social/twit_.png'" style="height: 15px; margin-top: -5px;" >
</a>
</li>
</ul>
</div>
</nav>
<!-- CAROUSEL HERO -->
<div id="myCarousel " class="carousel slide" data-ride="carousel">
<!-- Wrapper for slides -->
<div class="carousel-inner">
<div class="carousel-item active">
<img src="slider-01.jpg" class="overlay">
</div>
<div class="carousel-item">
<img src="slider-02.jpg" class="overlay">
</div>
<div class="carousel-item">
<img src="slider-03.jpg" class="overlay">
</div>
<div class="carousel-item">
<img src="slider-04.jpg" class="overlay">
</div>
<div class="carousel-item">
<img src="slider-05.jpg" class="overlay">
</div>
</div>
<!-- Hero Text -->
<div class="hero-text container">
<h1 class="hero-cust">Looking for Character<br> and Innovation ?</h1><br> <br>
<p style="text-align: center;">The Design Angels have solutions for you,<br> on top of offering advice and custom-made designs</p><br> <br>
<button>GET IN TOUCH</button>
</div>
</div>
<!-- Introduction -->
<div class="container-fluid">
<div class="container">
<div class="row">
<div class="col-lg-4 col-md-4 col-sm-6 col-xs-12" style="padding-top:50px;">
<h1>Great design<br>
is powerful</h1>
</div>
<div class="col-lg-4 col-md-4 col-sm-6 col-xs-12 clearfix" style="padding-top:50px;">
<p class="tab">Not only does it brings personality and brand recognition to goods or services,
but it establishes a recognition and creates the <span style="color:lightpink;">feeling of trust</span> we feel for those brands we love.<br> <br> <br></p>
<p class="tab">Set yourself above the competition with professional design and packaging: <span style="color:lightpink;">great communication</span> shows the world how serious you are about business.
</p>
</div>
<div class="col-lg-4 col-md-4 col-sm-6 col-xs-12 clearfix" style="padding-top:50px;">
<img src="mockup.png" class="responsive-image" style="width:200px; height: auto; vertical-align: top; float: right;" >
</div>
</div>
</div>
</div><br><br><br>
<!-- Services -->
<div class="container-fluid overlay"><br>
<div class="container">
<h1 style="text-align:center;">Our services</h1><br><br>
<p style="text-align:center;">We always go the extra mile to bring you kick-ass design.</p><br><br><br>
</div>
<div class="container">
<div class="row" style="padding-bottom: 50px;">
<div class="col-lg-4 col-md-4 col-sm-12 col-xs-12 specialties clearfix"><br>
<p style="text-align:center;">
<img src="drukwerk.png"><br><br><br>PRE-PRESS SPECIALTY<br><br>
Packagings, posters, cards, flyers,
letterheads, banners, calendars,
brochures, books, stickers,
custom work... <br>Know more<br>
</p>
</div>
<div class="col-lg-4 col-md-4 col-sm-12 col-xs-12 specialties clearfix"><br>
<p style="text-align:center;">
<img src="illu.png"><br><br>ILLUSTRATION & <br>IMAGE<br><br>
Commercial illustration for packaging,
small animations, logo & branding,
photoshopping, vector illustrations,
paintings... <br>Know more
</p>
</div>
<div class="col-lg-4 col-md-4 col-sm-6 col-xs-12 specialties clearfix"><br>
<p style="text-align:center; ">
<img src="digi.png"><br><br>DIGITAL & <br>WEB<br><br>
Banners, animated GIFs, brochures,
PDFs, web sites, videos, social media content... <br>Know more
</p>
</div>
</div>
</div>
</div>
<!-- Optional JavaScript -->
<script src="script.js">
</script>
</body>
</html>
Thanking you in advance.
Angie.
===============================
Update:
in the CSS, if I remove position: absolute; from body > #nav_desktop { then my navbar becomes transparent but isn't static.
If I leave that snippet in, the navbar is static, but non-transparent.
The aim is the navbar to be transparent so that the carousel picture remains fully visible.
Bootstrap 4 supports for the navbar a class called fixed-top. This allows you to make your navbar fixed to the top with a simple class.
You will need to add this to your nav:
<nav id="nav_desktop" class="navbar navbar-expand-md fixed-top" role="navigation">
You can find more info about this here.
Here is also a quick example that I already tested:
<!DOCTYPE html>
<html>
<head>
<title>Welcome to the Design Angels</title>
<!-- META DATA -->
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Welcome to theDesignAngels, we make it look glittery and shiny."/>
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="files/lib/jQuery.js"></script>
<script src="files/lib/lib/popper/Popper.js"></script>
<!-- BOOTSTRAP CSS -->
<script src="files/lib/bootstrap.min.js"></script>
<link rel="stylesheet" type="text/css" href="files/lib/bootstrap.min.css">
<!-- Libraries & frameworks -->
<script src="functions.js"></script>
<link rel="stylesheet" style="text/css" href="style.css"/>
<link rel="stylesheet" href="xxx">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<link rel="shortcut icon" href="assets/favicon.jpg" type="image/x-icon" />
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-light bg-light fixed-top">
<a class="navbar-brand" href="#">Navbar</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
</nav>
<div class="col-8 offset-1"><h1>bla bla bla</h1></div>
<div class="col-8 offset-1"><h1>bla bla bla</h1></div>
<div class="col-8 offset-1"><h1>bla bla bla</h1></div>
<div class="col-8 offset-1"><h1>bla bla bla</h1></div>
<div class="col-8 offset-1"><h1>bla bla bla</h1></div>
<div class="col-8 offset-1"><h1>bla bla bla</h1></div>
<div class="col-8 offset-1"><h1>bla bla bla</h1></div>
<div class="col-8 offset-1"><h1>bla bla bla</h1></div>
<div class="col-8 offset-1"><h1>bla bla bla</h1></div>
<div class="col-8 offset-1"><h1>bla bla bla</h1></div>
<div class="col-8 offset-1"><h1>bla bla bla</h1></div>
<div class="col-8 offset-1"><h1>bla bla bla</h1></div>
<div class="col-8 offset-1"><h1>bla bla bla</h1></div>
<div class="col-8 offset-1"><h1>bla bla bla</h1></div>
<div class="col-8 offset-1"><h1>bla bla bla</h1></div>
<div class="col-8 offset-1"><h1>bla bla bla</h1></div>
<div class="col-8 offset-1"><h1>bla bla bla</h1></div>
<div class="col-8 offset-1"><h1>bla bla bla</h1></div>
<div class="col-8 offset-1"><h1>bla bla bla</h1></div>
<div class="col-8 offset-1"><h1>bla bla bla</h1></div>
</body>
</html>
Just move your Carousel div to top using negative margin-top:
#myCarousel {
margin-top: -42px; /* set it equal to the menu height */
}
And change the position of the menu from absolute to relative:
body > #nav_desktop {
position: relative;
}
Thank you for all the ideas and input everyone, it kinda got me rethinking how I set the whole thing up.
While playing around with some elements (in the end, it always comes down to targeting the right classes), I found the solution.
screen capture of the working solution
The attribues needed to be moved as follows:
#nav_desktop > *,
#nav_desktop > div {
background: none !important;
position: absolute;
top: 0 !important;
transform: translate(0%);
which would look like this, all put together:
/*-----------------------------------------------------------------------------------------------------------------------------
*** Angie's CSS File | The Design Angels ***
---------------------------------------------------------------------------------------------------------------
Version: 0.0.1
Date: 02-02-2020
-----------------------------------------------------------------------------------------------------------------------------*/
/* 0. HTML Defaults
-----------------------------------------------------------------------------------------------------------------------------*/
:root {
--da-pink: lightpink;
--da-grey: rgba(5,5,5,1);
--da-grey: #454545;
--da-grey-grad: linear-gradient(to bottom right, #131313, #454545);
--da-grey-opac: rgba(69, 69, 69, .8);
--da-grey-opac: rgb(69, 69, 69);
}
html, body {
background-color: black;
background: rgba(65,65,65,1);
background: -moz-linear-gradient(-45deg, rgba(65,65,65,1) 0%, rgba(5,5,5,1) 100%);
background: -webkit-gradient(left top, right bottom, color-stop(0%, rgba(65,65,65,1)), color-stop(100%, rgba(5,5,5,1)));
background: -webkit-linear-gradient(-45deg, rgba(65,65,65,1) 0%, rgba(5,5,5,1) 100%);
background: -o-linear-gradient(-45deg, rgba(65,65,65,1) 0%, rgba(5,5,5,1) 100%);
background: -ms-linear-gradient(-45deg, rgba(65,65,65,1) 0%, rgba(5,5,5,1) 100%);
background: linear-gradient(135deg, rgba(65,65,65,1) 0%, rgba(5,5,5,1) 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#414141', endColorstr='#050505', GradientType=1 );
background-repeat: no-repeat;
background-attachment: fixed;
margin: 0;
height: 100%;
overflow: auto;
z-index: 10;
}
html body * {
}
h1 {
font-family: century-gothic, sans-serif;
font-weight: 700;
font-style: normal;
color: lightpink;
font-size: 3vw;
line-height: 4vw;
}
h2 {}
h3 {}
h4 {}
h5 {}
h6 {}
p {
font-family: itc-american-typewriter, serif;
font-weight: 300;
font-style: normal;
font-size: 12.5pt;
color: #ffffff;
text-align: justify;
text-decoration: none;
/* text-indent: 50px; */
/* word-spacing: 5px */
/* white-space: pre; */
letter-spacing: 1px;
/* line-height: 1.3; */
/* padding: 50px; */
display: block;
border:0;
}
p a:link {
text-decoration: none;
border-bottom: dotted;
font-family: century-gothic, sans-serif;
font-weight: 700;
font-style: normal;
font-size: 12.5pt;
color: lightpink;
}
p a:visited {
text-decoration: none;
font-family: century-gothic, sans-serif;
font-weight: 700;
font-style: normal;
font-size: 12.5pt;
color: lightpink;
}
p a:hover {
text-decoration: none;
border-bottom: dotted;
font-family: century-gothic, sans-serif;
font-weight: 700;
font-style: normal;
font-size: 12.5pt;
color: lightpink;
}
p a:active {
color: lightpink;
font-family: century-gothic, sans-serif;
font-weight: 700;
font-style: normal;
font-size: 12.5pt;
color: lightpink;
}
p.error {}
a,
a:link {
color: white;
text-decoration:none;
}
a:hover {
color: white;
text-decoration:none;
}
/* 10. NAV
-----------------------------------------------------------------------------------------------------------------------------*/
body > #nav_desktop {
left: 0;
right: 0;
}
#nav_desktop > *,
#nav_desktop > div {
background: none !important;
position: absolute;
top: 0 !important;
transform: translate(0%);
/* background: rgba(0, 0, 0, .0) !important; */
}
.navbar {
margin-bottom: 0;
padding: 0 0;
z-index: 100;
}
.navbar-nav.navbar-center {
position: absolute;
left: 50%;
transform: translate(-50%);
}
.nav_text {
font-family: itc-american-typewriter, serif;
font-weight: 300;
font-style: normal;
font-size: 12.5pt;
color: #ffffff;
letter-spacing: 2px;
}
#media only screen and (max-width: 768px) {
.navbar-brand > img {
position: absolute !important;
left: 50% !important;
transform: translate(-50%) !important;
}
}
ul.d-md-inline > li {
display:inline !important;
}
/* 50. Header
-----------------------------------------------------------------------------------------------------------------------------*/
header {}
/* 60. Carousel Hero slider
-----------------------------------------------------------------------------------------------------------------------------*/
.carousel {
top:0;
}
.hero-text {
padding-top: 50px;
padding-bottom: 50px;
background-image: url('./logo_transp.png');
background-size: auto;
background-repeat: no-repeat;
background-position: center -50px;
text-shadow: 1px 1px 3px black;
text-align: center;
position: absolute;
top: 75%;
left: 50%;
transform: translate(-50%, -75%);
}
.carousel,
.item,
.active {
height:100vh;
}
.carousel-inner {
height:100vh;
}
.carousel-inner img {
margin: auto;
}
/* 100. Content
-----------------------------------------------------------------------------------------------------------------------------*/
content {}
/* 200. Specialties section
-----------------------------------------------------------------------------------------------------------------------------*/
.specialties {
height: 375px;
width: 29%;
display: inline-box;
column-gap: 5px !important;
background-color: black;
background: rgba(65,65,65,1);
background: -moz-linear-gradient(-45deg, rgba(65,65,65,1) 0%, rgba(5,5,5,1) 100%);
background: -webkit-gradient(left top, right bottom, color-stop(0%, rgba(65,65,65,1)), color-stop(100%, rgba(5,5,5,1)));
background: -webkit-linear-gradient(-45deg, rgba(65,65,65,1) 0%, rgba(5,5,5,1) 100%);
background: -o-linear-gradient(-45deg, rgba(65,65,65,1) 0%, rgba(5,5,5,1) 100%);
background: -ms-linear-gradient(-45deg, rgba(65,65,65,1) 0%, rgba(5,5,5,1) 100%);
background: linear-gradient(135deg, rgba(65,65,65,1) 0%, rgba(5,5,5,1) 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#414141', endColorstr='#050505', GradientType=1 );
padding: 15px !important;
margin-right: 10px;
margin-left: 10px;
margin-bottom:20px;
}
/* 900. Footer
-----------------------------------------------------------------------------------------------------------------------------*/
footer {}
/* Zz. Bootstrap edit
-----------------------------------------------------------------------------------------------------------------------------*/
.overlay {
background: black;
opacity: 0.7;
/* background-size: cover; */
}
button {
display: inline-block;
border: 1px solid;
border-color: white;
padding: 10px 10px;
margin: 0;
text-decoration: none;
background: none;
color: white;
font-family: century-gothic, sans-serif;
font-weight:700;
font-style: normal;
font-size: 12 pt;
text-align: center;
}
button:hover,
button:focus {
background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5));
}
button:focus {
outline: 1px solid transparent;
outline-offset: -4px;
}
button:active {
transform: scale(0.99);
}
.clearfix::after {
content: "";
clear: both;
display: table;
}
.responsive-image {
max-width: 100%;
height: auto;
}
.center-block {
display: block;
margin-left: auto;
margin-right: auto;
}
/* 10000. TEXT STYLING
-----------------------------------------------------------------------------------------------------------------------------*/
#media print {
p {
color: black;
}
}
.tab {
text-indent: 40px;
}
<!DOCTYPE html>
<html>
<head>
<title>Welcome to the Design Angels</title>
<!-- META DATA -->
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Welcome to theDesignAngels, we make it look glittery and shiny."/>
<meta name="keywords" content="graphic design, design, grafisch, vormgeving, dtp, geleen, limburg, nederland, francophone, franstalig, english, nederlands, vormgever, web sites, packaging, verpakking, creatief, creative, beautiful,thedesignangels, the design angels"/>
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="files/lib/jQuery.js"></script>
<script src="files/lib/lib/popper/Popper.js"></script>
<!-- BOOTSTRAP CSS -->
<script src="files/lib/bootstrap.min.js"></script>
<link rel="stylesheet" type="text/css" href="files/lib/bootstrap.min.css">
<!-- Libraries & frameworks -->
<script src="functions.js"></script>
<link rel="stylesheet" style="text/css" href="style.css"/>
<link rel="stylesheet" href="https://xxx">
<link rel="shortcut icon" href="assets/favicon.jpg" type="image/x-icon" />
</head>
<body>
<!-- NAVBAR -->
<nav id="nav_desktop" class="navbar navbar-expand-md" role="navigation">
<!-- Brand -->
<div class="container-fluid">
<a class="navbar-brand" href="#"><img src="logo_menu.png" style="width:180px;height:auto" alt="the Design Angels" data-toggle="tooltip" title="home"></a>
<!-- Collect the nav links, forms, and other content -->
<!-- Site nav -->
<ul class="nav navbar-nav navbar-center d-none d-md-inline">
<li><a href="#services">
<span class="nav_text">SERVICES</span>
</a><span> </span>
</li>
<li><a href="#portfolio">
<span class="nav_text">PORTFOLIO</span>
</a><span> </span>
</li>
<li><a href="#contact">
<span class="nav_text">CONTACT</span>
</a><span> </span>
</li>
</ul>
<!-- Social media -->
<ul class="nav navbar-nav ml-auto d-none d-md-inline">
<li><a href="http://facebook.com/thedesignangels" target="_blank" alt="The Design Angels on Facebook">
<img src="social/fb_.png" onmouseover="this.src='./social/fb_mouseov.png'" onmouseout="this.src='./social/fb_.png'" style="height: 15px; margin-top: -5px;" >
</a>
</li>
<li><a href="https://www.instagram.com/thedesignangels/" target="_blank" alt="The Design Angels on Instagram">
<img src="social/inst_.png" onmouseover="this.src='./social/inst_mouseov.png'" onmouseout="this.src='./social/inst_.png'" style="height: 15px; margin-top: -5px;" >
</a>
<li><a href="https://twitter.com/thedesignangels" target="_blank" alt="The Design Angels on Twitter">
<img src="social/twit_.png" onmouseover="this.src='./social/twit_mouseov.png'" onmouseout="this.src='./social/twit_.png'" style="height: 15px; margin-top: -5px;" >
</a>
</li>
</ul>
</div>
</nav>
<!-- CAROUSEL HERO -->
<div id="myCarousel " class="carousel slide" data-ride="carousel">
<!-- Wrapper for slides -->
<div class="carousel-inner">
<div class="carousel-item active">
<img src="slider-01.jpg" class="overlay">
</div>
<div class="carousel-item">
<img src="slider-02.jpg" class="overlay">
</div>
<div class="carousel-item">
<img src="slider-03.jpg" class="overlay">
</div>
<div class="carousel-item">
<img src="slider-04.jpg" class="overlay">
</div>
<div class="carousel-item">
<img src="slider-05.jpg" class="overlay">
</div>
</div>
<!-- Hero Text -->
<div class="hero-text container">
<h1 class="hero-cust">Looking for Character<br> and Innovation ?</h1><br> <br>
<p style="text-align: center;">The Design Angels have solutions for you,<br> on top of offering advice and custom-made designs</p><br> <br>
<button>GET IN TOUCH</button>
</div>
</div>
<!-- Introduction -->
<div class="container-fluid">
<div class="container">
<div class="row">
<div class="col-lg-4 col-md-4 col-sm-6 col-xs-12" style="padding-top:50px;">
<h1>Great design<br>
is powerful</h1>
</div>
<div class="col-lg-4 col-md-4 col-sm-6 col-xs-12 clearfix" style="padding-top:50px;">
<p class="tab">Not only does it brings personality and brand recognition to goods or services,
but it establishes a recognition and creates the <span style="color:lightpink;">feeling of trust</span> we feel for those brands we love.<br> <br> <br></p>
<p class="tab">Set yourself above the competition with professional design and packaging: <span style="color:lightpink;">great communication</span> shows the world how serious you are about business.
</p>
</div>
<div class="col-lg-4 col-md-4 col-sm-6 col-xs-12 clearfix" style="padding-top:50px;">
<img src="mockup.png" class="responsive-image" style="width:200px; height: auto; vertical-align: top; float: right;" >
</div>
</div>
</div>
</div><br>
<!-- Optional JavaScript -->
<script src="script.js">
</script>
</body>
</html>
Hope this can eventually help someone...

How can I make Hover overlay text fixed to an Image

This is the portion of my HTML: I want to have to the text fixed to an image and not disappear when I stop hovering on the text.
.overlay1 {
position: relative;
bottom: 0;
background: rgb(0, 0, 0);
background: rgba(0, 0, 0, 0.5); /* Black see-through */
color: #f1f1f1;
width: 100%;
transition: .5s ease;
opacity:0;
color: white;
font-size: 20px;
padding: 20px;
text-align: center;
}
/*Test hover*/
.container1:hover .overlay1 {
opacity: 0.5;
}
<div class="container1">
<a href="/content/gallery">
<div class="columny">
<div class="row1">
<img src="sites/chau.ac.zm/themes/chau/images/AF.jpg" alt="Snow" class="image" style="width:100%">
<!-- <div class="overlay1"> -->
<div class="overlay1">Gallery</div>
<!-- </div> -->
</div>
</div>
</a>
</div>
If I get you right, you want div.overlay1 to
be invisible initially
be visible on hover over div.container1
stay visible even if you hover out of div.container1
You cannot achieve 3. without using JavaScript.
I suggest this code:
/* You need this container to limit the .overlay1 position */
.img-container {
position: relative;
}
.overlay1 {
position: absolute;
bottom: 0;
background: rgb(0, 0, 0);
background: rgba(0, 0, 0, 0.5); /* Black see-through */
color: #f1f1f1;
width: 100%;
transition: .5s ease;
opacity:0;
color: white;
font-size: 20px;
padding: 20px;
text-align: center;
}
/*Test hover - change :hover to class .visible */
.container1.visible .overlay1 {
opacity: 0.5;
}
<div id="container1" class="container1">
<a href="/content/gallery">
<div class="columny">
<div class="row1">
<div class="img-container">
<img src="https://images.unsplash.com/photo-1462899006636-339e08d1844e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=750&h=150&q=80" alt="Snow" class="image" style="width:100%">
<!-- <div class="overlay1"> -->
<div class="overlay1">Gallery</div>
<!-- </div> -->
</div>
</div>
</div>
</a>
</div>
<script>
// get element
var container1 = document.getElementById("container1");
// add hover event function
container1.addEventListener("mouseover", function() {
container1.className = "container1 visible";
});
</script>
See the solution if it works!
Just one question:
If you need a text to be fixed to an image, then why are you using hover?
.overlay1 {
position: absolute;
background: rgb(0, 0, 0);
background: rgba(0, 0, 0, 0.5); /* Black see-through */
color: #f1f1f1;
width: auto;
transition: .5s ease;
opacity:1;
color: white;
font-size: 20px;
padding: 20px;
text-align: center;
right:-20px;
top:50%;
}
.row1{
position:relative;
width:500px; margin:0 auto;
}
<div class="container1">
<a href="/content/gallery">
<div class="columny">
<div class="row1">
<img src="https://image.shutterstock.com/image-photo/field-spring-flowers-sunlight-450w-377208970.jpg" alt="" />
<!-- <div class="overlay1"> -->
<div class="overlay1">Gallery</div>
<!-- </div> -->
</div>
</div>
</a>
</div>
remove class from gallery div
<div class="overlay1">Gallery</div> remove the class and use without any "overlay1"class

Overlapping <div>'s with an image on a wrapper

I know this question has been answered but I am having extreme difficulty using the answers given before and applying them into my code.
I am making an tab-pane with different images. I want to put the image in the lighter orange section on the right with the text on the left. However, this tab is placed onto a wrapper and it's confusing me with the indexes.
In addition, all the solutions that work without considering the wrapper doesn't work when I use XXAMP.
Below is what I have so far and applies to the description :
Here is the code I have so far:
body {
background-color: #FFF;
background-image: url(../media/style/background.jpg);
font-family: helvetica;
background-repeat: no-repeat;
background-size: cover;
overflow-x: hidden;
background-attachment: fixed;
}
#wrapper img {
width: 80%;
height: 60%;
}
#wrapper {
width: 900px;
background-color: rgba(255, 255, 255, 0.8);
padding: 20px;
margin-top: 20;
margin-right: auto;
margin-bottom: 20;
margin-left: auto;
height: auto;
border: medium none #9C0;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}
.images {
position: relative;
text-align: center;
}
.tab-content {
width: 825px;
border-bottom: 2px solid white;
border-right: 2px solid white;
border-left: 2px solid white;
border-top: 2px solid white;
padding: 13px;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
text-align: right;
}
.nav-tabs {
margin-bottom: 0;
width: 805px;
}
.tab-content {
display: block;
background-color: rgba(245, 172, 64, 0.9);
background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.1) 50%, #F4B350 50%);
min-height: 300px;
z-index: -1;
}
.tab-content img {
position: relative;
width: 58vw;
height: 42vw;
}
.container a {
background-color: rgba(245, 172, 64, 0.9);
color: black;
}
.tab-content p {
font-size: 15px;
}
.tab-content h3 {
font-size: 28px;
}
#tab1 h3 p {
background-color: white;
}
<!DOCTYPE html>
<html>
<head>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<meta charset="UTF-8" />
<title>Hanler Products - Home</title>
</head>
<body>
<!-- TAB -->
<div class="container">
<ul class="nav nav-tabs">
<li class="active"><a data-toggle="tab" href="#tab1">Upright Towbar Caddy</a></li>
<li><a data-toggle="tab" href="#tab2">Upright Trailer lid Caddy</a></li>
<li><a data-toggle="tab" href="#tab3">Park Stand</a></li>
<li><a data-toggle="tab" href="#tab4">Gates / Burglar Bars / Security Gates</a></li>
<li><a data-toggle="tab" href="#tab5">Fences</a></li>
</ul>
<div class="tab-content">
<div id="tab1" class="tab-pane fade in active">
<div class="box">
<h3>Upright Towbar Caddy</h3>
<p>Ideal for short trips to school and back.</p>
</div>
<img src="media/style/slider/UTC.jpg" alt="Upright Towbar Caddy">
</div>
<div id="tab2" class="tab-pane fade">
<h3>Upright Trailer lid Caddy</h3>
<p>Now, taking your cycles on holiday, is a breeze.</p>
<img src="media/style/UTC.jpg" alt="Upright Trailer lid Caddy" />
</div>
<div id="tab3" class="tab-pane fade">
<h3>Park Stand</h3>
<p>Ideal for parking bikes at shops, schools and at shopping malls.<br/>The parkstand could prevent damage to vehicles <br/> in parking areas.<br/>The bike could also be chained to be stand <br/> to protect it from being stolen.</p>
</div>
<div id="tab4" class="tab-pane fade">
<h3>Gates / Burglar Bars / Security Gates</h3>
<p>Custom security bars to keep you and your belongings safe.</p>
</div>
<div id="tab5" class="tab-pane fade">
<h3>Fences</h3>
<p>Custom fencing for your home and/or business.</p>
</div>
</div>
</div>
</body>
</html>
Try pulling the text to the left, like this;
<div class="tab-content">
<div id="tab1" class="tab-pane fade in active">
<div class="box pull-left">