IE8 Image bigger than div, relative / absolute and negative margins - html

So here is my HTML code in question.
<script type="text/css">
.slider-holder {
background-color:transparent;
}
.slider-bg {
min-height: 295px;
position: relative;
z-index: 1;
border-bottom:0px;
}
.slider {
height: 295px;
padding: 1px 17px 0;
margin: 0 auto;
position: relative;
background: transparent;
}
.slider .items,
.slider .items2 {
position: relative;
height: 293px;
float: left;
}
.slider .items div.item,
.slider .items2 div.item{
height: 293px;
display: none;
position: absolute;
top: 0;
left: 0;
z-index: 0;
}
.slider .slider-text {
width: 720px;
position: relative;
z-index: 2;
padding: 70px 0 0;
}
.slider .slider-text, .slider .slider-text p {
background-color: inherit;
color: #fff;
font-size: 32px;
line-height: 33px;
}
.slider .slider-text.smaller p
{
font-size:24px;
}
.slider .slider-text p { padding: 0 0 10px; }
.slider .slider-text a.slider-btn {
background: #58940a url('img/btn/slider-btn.png') no-repeat 8px 7px;
display: block;
float: left;
-webkit-border-radius: 1px;
-moz-border-radius: 1px;
border-radius: 1px;
-webkit-box-shadow: 0px 0px 40px #666;
-moz-box-shadow: 0px 0px 40px #666;
box-shadow: 0px 0px 40px #666;
padding: 6px 10px 6px 32px;
color: #fff;
font-size: 15px;
line-height: 20px;
height: 20px;
}
.slider .slider-img {
position: absolute;
bottom: 0px;
padding: 0 5px 0 0;
z-index: 1;
left:-312px;
zoom: 1;
}
.slider .slidetabs {
position: absolute;
left:375px;
bottom: 27px;
z-index: 3;
}
.slider .slidetabs a {
background: url('img/elem/thumbnail-disc.png') no-repeat left top;
display: block;
width: 11px;
height: 11px;
float: left;
margin: 0 6px 0 0;
}
.slider .slidetabs a:hover, .slider .slidetabs a.current { background-position: left bottom; }
</script>
<div class="slider-holder">
<div class="slider-bg">
<!--begin:slider-->
<div class="slider">
<div class="items">
<!--begin:item-->
<div class="item" style="display: none; ">
<div class="slider-text"></div>
<div class="slider-img">
<img src="image.jpg" alt="" width="1600" height="294" align="center">
</div>
</div>
<!--end:item-->
<!--begin:item-->
<div class="item" style="display: none; ">
<div class="slider-text smaller"></div>
<div class="slider-img">
<img src="image2.jpg" alt="" width="1600" height="294" align="center">
</div>
</div>
<!--end:item-->
<!--begin:item-->
<div class="item" style="display: block; ">
<div class="slider-text"></div>
<div class="slider-img">
<a href="http://www.link.com" target="_blank">
<img src="image.jpeg" alt="" width="1600" height="294" align="center">
</a>
</div>
</div>
<!--end:item-->
</div>
<div class="slidetabs">
</div>
</div>
<!--end:slider-->
</div>
</div>
The problem with this particular setup is that the img is bigger than the div (which is intentional. And this setup works in most browswers except IE8. It gets cut off at the .slider-holder box (or at least it appears to).

Found out that a caching plugin was breaking the site. carry on.

Related

why does my image mix with my navigation bar

When i scroll on the website the image and nav bar mix together. The image goes through the navigation bar
and it looks like the background of the navigation bar is the image.
i put the position of the nav bar fixed and the z-index 1 and the div of the image position relative and z-index 0
<div class="header-top">
<span class="br">BR</span><span class="arch"> Architects</span>
<div class="meny">
Projects
About
Contact
</div>
</div>
<div id="home">
<div class="image">
<img src="skyscraper.jpg" alt="">
</div>
</div>
</html>
.header-top{
box-shadow: 0px 5px 8px -2px rgba(0,0,0,0.75);
position: fixed;
width: 100%;
top: 0;
left: 0;
padding: 6px 0px;
z-index: 1;
}
.meny{
float: right;
word-spacing: 26px;
padding: 0px 25px 0px 0px;
}
.meny-link{
color: black;
text-decoration: none;
letter-spacing: 3px;
}
.br{
padding: 0px 0px 0px 10px;
font-weight: bold;
}
#home{
position: relative;
top: 23px;
z-index: 0;
}
.image img{
width: 100%;
height: 675px;
}
You can simply add background: white; to .header-top if you don't want it being transparent.
Here's an example:
.header-top{
box-shadow: 0px 5px 8px -2px rgba(0,0,0,0.75);
position: fixed;
width: 100%;
top: 0;
left: 0;
padding: 6px 0px;
z-index: 1;
background: white;
}
.meny{
float: right;
word-spacing: 26px;
padding: 0px 25px 0px 0px;
}
.meny-link{
color: black;
text-decoration: none;
letter-spacing: 3px;
}
.br{
padding: 0px 0px 0px 10px;
font-weight: bold;
}
#home{
position: relative;
top: 23px;
z-index: 0;
}
.image img{
width: 100%;
height: 675px;
}
<div class="header-top">
<span class="br">BR</span><span class="arch"> Architects</span>
<div class="meny">
Projects
About
Contact
</div>
</div>
<div id="home">
<div class="image">
<img src="https://www.tommasocimarelli.com/wp-content/uploads/2020/01/skyscraper-manhattan.jpg" alt="">
</div>
</div>
Try to write a big number into property z-index to navbar like 99

Make footer position sticked to the end

I'm trying to make a google clone page, I am trying to make the footer to be sticked to the end of the viewport. But when I try position: absolute bottom: 0, it sticks to the end, but the page overflows.
I tried to use html, body and * height: 100% but it doesn't work.
I share my github repository for you to check the code: https://github.com/Diefonro/HTML-CSS
You can also check the webpage (on a PC) at: https://diefonro.github.io/HTML-CSS/
Code:
* {
margin: 0;
}
html{
max-height: 100%;
}
body {
font-family: Arial, sans-serif;
}
nav {
text-align: right;
position: relative;
top: 9px;
right: 8px;
}
#nav-g-i {
display: inline-block;
position: relative;
top: 2px;
right: 23px;
}
#nav-gr-a {
display: inline-block;
position: relative;
top: 5px;
right: 10px;
}
#grid,
#profile-pic {
opacity: 50%;
}
section {
text-align: center;
position: relative;
top: 24px;
}
.input-g {
position: relative;
bottom: 2px;
width: 500px;
line-height: 17px;
border: none;
outline: none;
}
.input-cont {
width: 553px;
height: 16px;
position: relative;
bottom: 2px;
right: 1px;
color: #222;
border: 1px solid #dfe1e5;
font-size: 13px;
padding: 14px;
border-radius: 80px;
margin: 24px 0px;
display: inline-block;
}
.input-cont:hover,
.input-cont:focus {
box-shadow: 0 1px 5px 0 rgba(32, 33, 36, 0.28);
border-color: rgba(40, 40, 41, 0);
}
.input-cont > img {
position: absolute;
top: 10px;
right: 11px;
width: 23px;
}
.input-cont .search-i {
position: absolute;
top: 11.5px;
right: 547px;
width: 20px;
opacity: 40%;
}
#grid {
position: relative;
bottom: 3px;
margin-right: 16px;
}
.menu-item {
font-size: 13px;
color: #5b5f63;
text-decoration: none;
position: relative;
bottom: 8px;
margin-right: 10px;
}
.menu-item:hover {
text-decoration: underline;
}
#profile-pic {
width: 32px;
height: 32px;
}
.btn-cont {
position: relative;
top: 3px;
}
.custom-btn {
background-color: #f2f2f291;
color: #a2a8af;
font-size: 14px;
height: 36px;
padding: 0 16px;
background-image: linear-gradient(top, #f5f5f5, #f1f1f1);
border: 1px solid transparent;
box-shadow: 0 1px 1px rgba(0, 0, 0, 0);
color: #222;
border-radius: 5px;
}
.custom-btn:first-of-type {
margin-right: 7px;
}
.custom-btn:hover {
border: 1px solid #c6c6c656;
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
color: #222;
}
.custom-btn:active {
border: 1px solid cornflowerblue;
}
.drop-d {
width: 285px;
padding: 10px;
border: 1px solid #ccc;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
text-align: center;
position: absolute;
right: 11px;
border-radius: 12px;
display: none;
}
.grid:hover {
display: inline-block;
}
.dd-item:hover {
border: 1px solid rgba(0, 0, 0, 0.2);
border-radius: 8px;
}
.dd-item {
margin-top: 10px;
display: inline-block;
width: 70px;
padding: 6px 3px;
}
.dd-item > img {
height: 50px;
width: 50px;
}
.dd-item > p {
color: rgba(0, 0, 0, 0.87);
margin: 0;
margin-top: 15px;
margin-bottom: 5px;
}
.dd-cont {
display: inline-block;
}
.dd-cont:hover .drop-d {
display: block;
}
.s-lang {
font-size: 13px;
color: #333;
position: relative;
top: 30px;
right: 3px;
}
.s-lang a {
text-decoration: underline;
}
.s-lang a:visited {
color: rgb(30, 30, 179);
}
.ll {
display: inline-block;
position: relative;
left: 3px;
}
.footer1,
.footer2 {
font-size: 15px;
background-color: #d6d8da49;
color: #8a8686;
border-bottom: 1px solid rgba(155, 155, 155, 0.267);
position: relative;
top: 200px;
}
.footer2 a {
display: inline-block;
text-decoration: none;
padding: 12px;
font-size: 14px;
}
.footer3 a {
font-size: 14px;
padding: 14px;
position: relative;
top: 170px;
left: 990px;
text-decoration: none;
color: #8a868683;
}
span.f1 {
display: inline-block;
margin-left: 15px;
padding: 16px;
}
.a-li {
margin-left: 20px;
}
a:visited {
color: inherit;
}
.footer-cont {
position: absolute;
bottom: 0;
width: 100%;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Google Clone Optimized (by Diefonro)</title>
<link rel="shortcut icon" href="assets/icons/favicon.ico" />
<link
href="https://fonts.googleapis.com/icon?family=Material+Icons"
rel="stylesheet"
/>
<link rel="stylesheet" href="styles.css" />
</head>
<body>
<header>
<nav>
<div class="nav">
<div id="nav-g-i">
<a class="menu-item" href="#">Gmail</a>
<a class="menu-item" href="https://google.com/imghp">Images</a>
</div>
<div class="" id="nav-gr-a">
<div class="dd-cont">
<div class="grid">
<img
id="grid"
src="assets/icons/apps_black_24dp.svg"
alt="apps-icon"
/>
</div>
<div class="drop-d">
<div class="dd-item">
<img
id="dd-search"
src="assets/icons/google-logo-dd.png"
alt="google-search-icon"
/>
<p>Search</p>
</div>
<div class="dd-item">
<img
id="dd-maps"
src="assets/icons/google-maps-dd.png"
alt="google-maps-icon"
/>
<p>Maps</p>
</div>
<div class="dd-item">
<img
id="dd-keep"
src="assets/icons/google-keep-dd.png"
alt="google-keep-icon"
/>
<p>Keep</p>
</div>
<div class="dd-item">
<img
class="dd-drive"
src="assets/icons/Google_Drive_dd.png"
alt="google-keep-icon"
/>
<p>Drive</p>
</div>
<div class="dd-item">
<img
class="dd-calendar"
src="assets/icons/512px-Google_Calendar_icon_dd.png"
alt="google-calendar-icon"
/>
<p>Calendar</p>
</div>
<div class="dd-item">
<img
class="dd-photos"
src="assets/icons/google_photos-dd.png"
alt="google-photos-icon"
/>
<p>Photos</p>
</div>
</div>
</div>
<img
id="profile-pic"
src="assets/icons/account_circle_black_24dp.svg"
alt="account-icon"
/>
</div>
</div>
</nav>
</header>
<main>
<section>
<div class="logo-cont">
<img
id="google-logo"
src="assets/images/googlelogo_color_272x92dp.png"
alt="google-logo"
/>
</div>
<div class="input-cont">
<input class="input-g" type="text" />
<img
src="assets/icons/search_black_24dp.svg"
alt="search-icon"
class="search-i"
/>
<img
class="mic"
src="assets/icons/Google_mic.svg.png"
alt="voice-search-icon"
/>
</div>
<div class="btn-cont">
<button class="custom-btn">Google Search</button>
<button class="custom-btn custom-btn-l">I'm Feeling Lucky</button>
</div>
<span class="s-lang"
>Google offered in:
<a href="#" class="s-link"
><div class="ll">Español (Latinoamérica)</div></a
>
</span>
</section>
</main>
<footer>
<div class="footer-cont">
<div class="footer1">
<span class="f1">Colombia</span>
</div>
<div class="footer2">
<div class="a-li">
About
Advertising
Business
How Search works
</div>
</div>
<div class="footer3">
Privacy
Terms
Settings
</div>
</div>
</footer>
</body>
</html>
try to change your width to 100vw and. you can use flex box to footer2 and footer3. so the code will be :
<footer>
<div class="footer-cont">
<div class="top-footer">
<span class="f1">Colombia</span>
</div>
<div class="bottom-footer">
<div class="left-footer">
<div class="a-li">
About
Advertising
Business
How Search works
</div>
</div>
<div class="right-footer">
Privacy
Terms
Settings
</div>
</div>
</div>
</footer>
and the css will be :
footer{
position : relative;
width: 100vw;
}
.footer-cont{
position: absolute;
width : 100%;
bottom : 0;
left : 0;
height : fit-content;
height : -moz-fit-content;
}
.top-footer{
border-bottom : 1px solid #333;
}
.bottom-footer{
display : flex;
justify-content : space-between
align-items : center;
}

How can I make my footer to meet the end of the VP

I'm trying to make a google clone page, I am trying to make the footer to be sticked to the end of the viewport. But when I try position: absolute bottom: 0, it sticks to the end, but the page overflows.
I tried to use html, body and * height: 100% but it doesn't work.
I share my github repository for you to check the code: https://github.com/Diefonro/HTML-CSS
You can also check the webpage (on a PC) at: https://diefonro.github.io/HTML-CSS/
Code:
<body>
<header>
<nav>
<div class="nav">
<div id="nav-g-i">
<a class="menu-item" href="#">Gmail</a>
<a class="menu-item" href="https://google.com/imghp">Images</a>
</div>
<div class="" id="nav-gr-a">
<div class="dd-cont">
<div class="grid">
<img
id="grid"
src="assets/icons/apps_black_24dp.svg"
alt="apps-icon"
/>
</div>
<div class="drop-d">
<div class="dd-item">
<img
id="dd-search"
src="assets/icons/google-logo-dd.png"
alt="google-search-icon"
/>
<p>Search</p>
</div>
<div class="dd-item">
<img
id="dd-maps"
src="assets/icons/google-maps-dd.png"
alt="google-maps-icon"
/>
<p>Maps</p>
</div>
<div class="dd-item">
<img
id="dd-keep"
src="assets/icons/google-keep-dd.png"
alt="google-keep-icon"
/>
<p>Keep</p>
</div>
<div class="dd-item">
<img
class="dd-drive"
src="assets/icons/Google_Drive_dd.png"
alt="google-keep-icon"
/>
<p>Drive</p>
</div>
<div class="dd-item">
<img
class="dd-calendar"
src="assets/icons/512px-Google_Calendar_icon_dd.png"
alt="google-calendar-icon"
/>
<p>Calendar</p>
</div>
<div class="dd-item">
<img
class="dd-photos"
src="assets/icons/google_photos-dd.png"
alt="google-photos-icon"
/>
<p>Photos</p>
</div>
</div>
</div>
<img
id="profile-pic"
src="assets/icons/account_circle_black_24dp.svg"
alt="account-icon"
/>
</div>
</div>
</nav>
</header>
<main>
<section>
<div class="logo-cont">
<img
id="google-logo"
src="assets/images/googlelogo_color_272x92dp.png"
alt="google-logo"
/>
</div>
<div class="input-cont">
<input class="input-g" type="text" />
<img
src="assets/icons/search_black_24dp.svg"
alt="search-icon"
class="search-i"
/>
<img
class="mic"
src="assets/icons/Google_mic.svg.png"
alt="voice-search-icon"
/>
</div>
<div class="btn-cont">
<button class="custom-btn">Google Search</button>
<button class="custom-btn custom-btn-l">I'm Feeling Lucky</button>
</div>
<span class="s-lang"
>Google offered in:
<a href="#" class="s-link"
><div class="ll">Español (Latinoamérica)</div></a
>
</span>
</section>
</main>
<footer>
<div class="footer-cont">
<div class="top-footer">
<span class="f1">Colombiac test</span>
</div>
<div class="bottom-footer">
<div class="left-footer">
<div class="a-li">
About
Advertising
Business
How Search works
</div>
</div>
<div class="right-footer">
Privacy
Terms
Settings
</div>
</div>
</div>
</footer>
</body>
* {
margin: 0;
}
html{
height: 100vh;
}
body {
font-family: Arial, sans-serif;
}
nav {
text-align: right;
position: relative;
top: 9px;
right: 8px;
}
#nav-g-i {
display: inline-block;
position: relative;
top: 2px;
right: 23px;
}
#nav-gr-a {
display: inline-block;
position: relative;
top: 5px;
right: 10px;
}
#grid,
#profile-pic {
opacity: 50%;
}
section {
text-align: center;
position: relative;
top: 24px;
}
.input-g {
position: relative;
bottom: 2px;
width: 500px;
line-height: 17px;
border: none;
outline: none;
}
.input-cont {
width: 553px;
height: 16px;
position: relative;
bottom: 2px;
right: 1px;
color: #222;
border: 1px solid #dfe1e5;
font-size: 13px;
padding: 14px;
border-radius: 80px;
margin: 24px 0px;
display: inline-block;
}
.input-cont:hover,
.input-cont:focus {
box-shadow: 0 1px 5px 0 rgba(32, 33, 36, 0.28);
border-color: rgba(40, 40, 41, 0);
}
.input-cont > img {
position: absolute;
top: 10px;
right: 11px;
width: 23px;
}
.input-cont .search-i {
position: absolute;
top: 11.5px;
right: 547px;
width: 20px;
opacity: 40%;
}
#grid {
position: relative;
bottom: 3px;
margin-right: 16px;
}
.menu-item {
font-size: 13px;
color: #5b5f63;
text-decoration: none;
position: relative;
bottom: 8px;
margin-right: 10px;
}
.menu-item:hover {
text-decoration: underline;
}
#profile-pic {
width: 32px;
height: 32px;
}
.btn-cont {
position: relative;
top: 3px;
}
.custom-btn {
background-color: #f2f2f291;
color: #a2a8af;
font-size: 14px;
height: 36px;
padding: 0 16px;
background-image: linear-gradient(top, #f5f5f5, #f1f1f1);
border: 1px solid transparent;
box-shadow: 0 1px 1px rgba(0, 0, 0, 0);
color: #222;
border-radius: 5px;
}
.custom-btn:first-of-type {
margin-right: 7px;
}
.custom-btn:hover {
border: 1px solid #c6c6c656;
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
color: #222;
}
.custom-btn:active {
border: 1px solid cornflowerblue;
}
.drop-d {
width: 285px;
padding: 10px;
border: 1px solid #ccc;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
text-align: center;
position: absolute;
right: 11px;
border-radius: 12px;
display: none;
}
.grid:hover {
display: inline-block;
}
.dd-item:hover {
border: 1px solid rgba(0, 0, 0, 0.2);
border-radius: 8px;
}
.dd-item {
margin-top: 10px;
display: inline-block;
width: 70px;
padding: 6px 3px;
}
.dd-item > img {
height: 50px;
width: 50px;
}
.dd-item > p {
color: rgba(0, 0, 0, 0.87);
margin: 0;
margin-top: 15px;
margin-bottom: 5px;
}
.dd-cont {
display: inline-block;
}
.dd-cont:hover .drop-d {
display: block;
}
.s-lang {
font-size: 13px;
color: #333;
position: relative;
top: 30px;
right: 3px;
}
.s-lang a {
text-decoration: underline;
}
.s-lang a:visited {
color: rgb(30, 30, 179);
}
.ll {
display: inline-block;
position: relative;
left: 3px;
}
.top-footer,
.bottom-footer {
font-size: 15px;
background-color: #d6d8da49;
color: #8a8686;
position: relative;
top: 200px;
}
.top-footer{
border-bottom: 1px solid rgba(155, 155, 155, 0.267);
}
.left-footer a {
display: inline-block;
text-decoration: none;
padding: 12px;
font-size: 14px;
}
.right-footer a {
font-size: 14px;
padding: 14px;
text-decoration: none;
color: #8a8686;
}
.bottom-footer{
display: flex;
justify-content: space-between;
align-items: center;
}
.bottom-footer a:hover{
text-decoration: underline;
}
span.f1 {
display: inline-block;
margin-left: 15px;
padding: 16px;
}
.a-li {
margin-left: 20px;
}
a:visited {
color: inherit;
}
.footer-cont {
position: absolute;
bottom: 0;
width: 100%;
left: 0;
height: fit-content;
height: -moz-fit-content;
}
footer{
position: relative;
width: 100vw;
}
You can remove top: 200px on .top-footer, .bottom-footer. Why? because you have added bottom: 0 to .footer-cont which increases its position to 0 (.footer-cont) + 200px (.top-footer, .bottom-footer) = 200px down. If scroll bars in vertical bother you, you can add overflow-y: hidden style to body or html.

Top border radius in linear gradient background

I am making testimonial feature in a carousel
This is the sample pic of what I wanted to achieve
And this is what I've achieved so far
https://jsfiddle.net/2we347xu/
but this time I wanted to make the top part of the rectangle a bit more rounded like the bottom part of it and so I used border-radius but it didn't turn out the way I wanted.
Here is my code
.carousel-inner {
position: relative;
width: 100%;
overflow: hidden;
}
.col-center {
margin: 0 auto;
float: none !important;
}
.carousel {
margin: 0px auto;
padding: 0 70px;
height: 100%;
background: linear-gradient(180deg, white 15%,#0E2149 15%);
border-radius: 20px;
}
.carousel {
position: relative;
}
.carousel .item {
color: #fff;
font-size: 14px;
text-align: center;
overflow: hidden;
min-height: 290px;
}
.carousel .item .img-box {
width: 200px;
height: 200px;
margin: 0 auto;
padding: 5px;
border: 10px solid #0E2149;
border-radius: 50%;
background: #fff;
}
.carousel .img-box img {
width: 100%;
height: 100%;
display: block;
border-radius: 50%;
}
.carousel .testimonial {
padding: 0px 0 0px;
line-height: 1.5;
color: #fff;
}
.carousel .overview {
font-style: italic;
}
.carousel .overview b {
text-transform: uppercase;
color: #7AA641;
}
.carousel .carousel-control {
width: 40px;
height: 40px;
margin-top: -20px;
top: 50%;
background: none;
}
.carousel-control i {
font-size: 30px;
line-height: 65px;
position: absolute;
display: inline-block;
color: rgba(0, 0, 0, 0.8);
text-shadow: 0 3px 3px #e6e6e6, 0 0 0 #000;
margin-left: -5px;
}
.carousel .carousel-indicators {
bottom: -40px;
}
.carousel-indicators li, .carousel-indicators li.active {
width: 10px;
height: 10px;
margin: 1px 3px;
border-radius: 50%;
}
.carousel-indicators li {
background: #999;
border-color: transparent;
box-shadow: inset 0 2px 1px rgba(0,0,0,0.2);
}
.carousel-indicators li.active {
background: #555;
box-shadow: inset 0 2px 1px rgba(0,0,0,0.2);
}
<div class="col-md-4">
<div class="row">
<div class="col-md-12">
<div id="myCarousel" class="carousel slide" data-ride="carousel">
<!-- Carousel indicators -->
<!-- Wrapper for carousel items -->
<div class="carousel-inner">
<div class="item carousel-item active">
<div class="img-box"><img src="images/cd logo.jpg" alt=""></div>
<p class="testimonial">Some text here
</p>
<p class="overview"><b>Paula Wilson</b>, Media Analyst</p>
</div>
<div class="item carousel-item">
<div class="img-box"><img src="/examples/images/clients/2.jpg" alt=""></div>
<p class="testimonial">Text here</p>
<p class="overview"><b>Antonio Moreno</b>, Web Developer</p>
</div>
</div>
<!-- Carousel controls -->
<a class="carousel-control left carousel-control-prev" href="#myCarousel" data-slide="prev">
<i class="fa fa-angle-left"></i>
</a>
<a class="carousel-control right carousel-control-next" href="#myCarousel" data-slide="next">
<i class="fa fa-angle-right"></i>
</a>
</div>
</div>
<div id="background"></div>
</div>
</div>
How do I achieve the look at the top part of the carousel?
Instead of that gradient you can use :before or :after pseudo elements, position it absolutely, under all other content, and do what you want.
It seems that it's working perfectly as expected. The problem here is that you are not able to view it because the background color of the top bar is white and so is your body background color. If you change it to something else, you'll see the difference.
Either you change the color of the linear gradient to
.carousel {
...
background: linear-gradient(180deg, grey 15%,#0E2149 15%);
/* You can use any other color than grey, it's just for demo purpose */
...
}
Or you can use pseudo selectors for achieving what you want.
Here's an example using ::before by setting it's position to absolute:
.carousel {
/* remove linear gradient from here! */
}
.carousel::after {
position: absolute;
left: 0;
top: 15%;
content: ' ';
width: 100%;
height: 85%;
background: #0E2149;
z-index: -1; /* To keep it below the content */
border-radius: 20px;
}
.carousel::before {
position: absolute;
left: 0;
top: 0;
content: ' ';
width: 100%;
height: 20%; /* Extra 5% */
background: white;
z-index: -2; /* To keep it below the content and the ::after element */
}
Are u expecting like this:
.carousel-inner {
position: relative;
width: 100%;
overflow: hidden;
margin-bottom: 20px;
border-radius: 15px;
box-shadow: 0 4px 10px 0 rgba(0,0,0,0.2), 0 4px 20px 0 rgba(0,0,0,0.19);
}
hr{
margin:2px 40px;
background-color:#cbcbcb;
color: #cbcbcb;
border-radius: 10px;
}
.col-center {
margin: 0 auto;
float: none !important;
}
.carousel {
margin: 0px auto;
padding: 0 70px;
height: 100%;
border-radius: 20px;
}
.carousel {
position: relative;
}
.carousel .item {
color: #fff;
font-size: 14px;
background-color: white;
text-align: center;
overflow: hidden;
min-height: 290px;
position: relative;
}
.carousel .item::after{
content: "";
display: block;
background-color:#0E2149;
position: absolute;
left: 0;
right: 0;
top: 100px;
bottom: 0;
border-bottom-left-radius: 15px;
border-bottom-right-radius: 15px;
}
.carousel .item > *{
position: relative;
z-index: 1;
}
.carousel .item .img-box {
width: 130px;
height: 130px;
margin: 0 auto;
margin-top: 25px;
border-radius: 50%;
padding: 10px;
background-color:#0E2149 ;
}
.carousel .img-box img {
width: 100%;
height: 100%;
display: block;
border-radius: 50%;
}
.carousel .testimonial {
padding: 0px 0 0px;
line-height: 1.5;
color: white;
font-weight: bold;
font-size: 30px;
}
.carousel .overview {
font-style: italic;
}
.carousel .overview b {
text-transform: uppercase;
color: #7AA641;
}
.carousel .carousel-control {
width: 40px;
height: 40px;
margin-top: -20px;
top: 50%;
background: none;
}
.carousel-control i {
font-size: 30px;
line-height: 65px;
position: absolute;
display: inline-block;
color: rgba(0, 0, 0, 0.8);
text-shadow: 0 3px 3px #e6e6e6, 0 0 0 #000;
margin-left: -5px;
}
.carousel .carousel-indicators {
bottom: -40px;
}
.carousel-indicators li, .carousel-indicators li.active {
width: 10px;
height: 10px;
margin: 1px 3px;
border-radius: 50%;
}
.carousel-indicators li {
background: #999;
border-color: transparent;
box-shadow: inset 0 2px 1px rgba(0,0,0,0.2);
}
.carousel-indicators li.active {
background: #555;
box-shadow: inset 0 2px 1px rgba(0,0,0,0.2);
}
<section class="second-section">
<div class="container">
<div class="row">
<div class="col-md-4">
<div class="row">
<div class="col-md-12">
<div id="myCarousel" class="carousel slide" data-ride="carousel">
<!-- Carousel indicators -->
<!-- Wrapper for carousel items -->
<div class="carousel-inner">
<div class="item carousel-item active">
<div class="img-box"><img src="https://dummyimage.com/300" alt=""></div>
<p class="testimonial">Some text here
</p>
<hr>
<p class="overview"><b>Paula Wilson</b>, Media Analyst</p>
</div>
</div>
<div class="carousel-inner">
<div class="item carousel-item">
<div class="img-box"><img src="https://dummyimage.com/300" alt=""></div>
<p class="testimonial">Text here</p>
<p class="overview"><b>Antonio Moreno</b>, Web Developer</p>
</div>
</div>
<div class="carousel-inner">
<div class="item carousel-item">
<div class="img-box"><img src="https://dummyimage.com/300" alt=""></div>
<p class="testimonial">Text here</p>
<p class="overview"><b>Antonio Moreno</b>, Web Developer</p>
</div>
</div>
</div>
<!-- Carousel controls -->
<a class="carousel-control left carousel-control-prev" href="#myCarousel" data-slide="prev">
<i class="fa fa-angle-left"></i>
</a>
<a class="carousel-control right carousel-control-next" href="#myCarousel" data-slide="next">
<i class="fa fa-angle-right"></i>
</a>
</div>
</div>
<div id="background"></div>
</div>
</div>
</div>
</section>

Form elements not clickable even with positive z-index and positioned. Form on animated card flip DIV

I am trying to get it so that the user can submit comments on the "back" of an element that does a 3d flip using css animate. However I cannot get the form clickable.
I have tried using z-index on the positioned element.
You can tab into the form and enter data and submit without issue. You just cannot click it.
What am I missing here?
Thank you for your help.
.entry_wrapper {
width: 50%;
margin: 1.5em auto;
}
.entry_wrapper {
-webkit-perspective: 2000;
}
.entry_wrapper:hover .face {
transform: rotateY(180deg);
}
.face {
box-shadow: 5px 5px 20px 5px #000000;
transform-style: preserve-3d;
transition: all 1.0s linear;
backface-visibility: hidden;
width: 100%;
height: 100%;
}
.face .back {
width: 100%;
height: 100%;
position: absolute;
top: 0;
transform: rotateY(180deg);
border: solid white 1px;
border-radius: 5px;
background: grey;
z-index: 30;
}
.entry {
display: block;
position: relative;
width: 100%;
height: auto;
}
.entry_img {
margin: 0 auto;
width: 100%;
height: auto;
}
.entry img {
Width: 100%;
height: auto;
margin-bottom: -5px;
}
.entry_img p {
display: inline;
position: absolute;
bottom: 0;
z-index: 10;
color: white;
text-align: center;
margin: 0;
width: 100%;
background: rgba(0, 0, 0, 0.6);
}
.entry_footer {
width: 100%;
height: 3em;
text-align: center;
margin: 0 auto;
background: rgba(256, 256, 256, 0.8);
}
.comment {
width: 66%;
background: #cccccc;
border: 2px solid #000000;
border-radius: 5px;
margin: 15px auto;
}
.comment p {
margin: 2px 5px;
}
.comment_name {
font-size: .8em;
}
.comment_name span {
display:block;
float:right;
width:50%;
margin-left:10px;
}
.add_comment {
width: 66%;
display: block;
margin: 15px auto;
background: #cccccc;
border: 2px solid #000000;
border-radius: 5px;
z-index: 50;
}
#comment_form {
z-index: 50;
}
<main>
<div class="entry_wrapper">
<div class="face">
<div class="entry">
<div class="entry_img">
<img src="img/family.jpg">
<p>Birth of first daughter Sophia.</p>
</div>
</div>
<div class="entry_footer">
<p>Like?</p>
</div>
<div class="back face">
<div class="comment">
<p> I really like this picture.</p>
<div >
<p class="comment_name">By: Matthew <span class="date">On: Nov 5th, 2014</span></p>
</div>
</div>
<form id="comment_form" action="comment_submit.php">
<input type="submit">
</form>
<textarea name="comment1" class="add_comment" form="comment_form" placeholder="test"></textarea>
</div>
</div>
</div>
<div class="entry_wrapper">
<div class="entry">
<div class="entry_img">
<img src="img/summit.jpg">
<p>I made it to the top!</p>
</div>
</div>
<div class="entry_footer">
<p>Like?</p>
</div>
</div>
</main>