Fixed Height for overview-box - html

I would like to fix the height of each box while using this style.
Here is my CSS and HTML code for this overview-boxes for reference. Probably you will not get the same UI as mine, picture that I put is what I am trying to fix.
If the span gets longer values box height automatically increases. I would like to prevent that outcome while still using this format of overview-items
.ohs-text-overview h2{
font-weight: 300;
color: #fff;
font-size: 36px;
line-height: 1;
margin-bottom: 5px;
}
.ohs-text-overview span{
font-size: 18px;
color: rgba(255, 255, 255, 0.6);
}
/* ----- Overview ----- */
.ohs-overview-wrap {
display: -webkit-box;
display: -webkit-flex;
display: -moz-box;
display: -ms-flexbox;
display: flex;
-webkit-box-pack: justify;
-webkit-justify-content: space-between;
-moz-box-pack: justify;
-ms-flex-pack: justify;
justify-content: space-between;
-webkit-box-align: center;
-webkit-align-items: center;
-moz-box-align: center;
-ms-flex-align: center;
align-items: center;
}
#media (max-width: 767px) {
.ohs-overview-wrap {
-webkit-box-direction: normal;
-webkit-flex-direction: column;
-moz-box-direction: normal;
-ms-flex-direction: column;
flex-direction: column;
}
.ohs-overview-wrap .button {
-webkit-box-ordinal-group: 2;
-webkit-order: 1;
-moz-box-ordinal-group: 2;
-ms-flex-order: 1;
order: 1;
}
.ohs-overview-wrap h2 {
-webkit-box-ordinal-group: 3;
-webkit-order: 2;
-moz-box-ordinal-group: 3;
-ms-flex-order: 2;
order: 2;
}
}
.ohs-overview-item {
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
padding: 30px;
padding-bottom: 0;
-webkit-box-shadow: 0px 2px 5px 0px rgba(0, 0, 0, 0.1);
-moz-box-shadow: 0px 2px 5px 0px rgba(0, 0, 0, 0.1);
box-shadow: 0px 2px 5px 0px rgba(0, 0, 0, 0.1);
margin-bottom: 40px;
}
#media (min-width: 992px) and (max-width: 1519px) {
.ohs-overview-item {
padding-left: 15px;
padding-right: 15px;
}
}
.ohs-overview-item--c1 {
background-image: -moz-linear-gradient(90deg, #3f5efb 0%, #fc466b 100%);
background-image: -webkit-linear-gradient(90deg, #3f5efb 0%, #fc466b 100%);
background-image: -ms-linear-gradient(90deg, #3f5efb 0%, #fc466b 100%);
}
.ohs-overview-item--c2 {
background-image: -moz-linear-gradient(90deg, #11998e 0%, #38ef7d 100%);
background-image: -webkit-linear-gradient(90deg, #11998e 0%, #38ef7d 100%);
background-image: -ms-linear-gradient(90deg, #11998e 0%, #38ef7d 100%);
}
.ohs-overview-item--c3 {
background-image: -moz-linear-gradient(90deg, #ee0979 0%, #ff6a00 100%);
background-image: -webkit-linear-gradient(90deg, #ee0979 0%, #ff6a00 100%);
background-image: -ms-linear-gradient(90deg, #ee0979 0%, #ff6a00 100%);
}
.ohs-overview-item--c4 {
background-image: -moz-linear-gradient(90deg, #45b649 0%, #dce35b 100%);
background-image: -webkit-linear-gradient(90deg, #45b649 0%, #dce35b 100%);
background-image: -ms-linear-gradient(90deg, #45b649 0%, #dce35b 100%);
}
.ohs-overview-box .icon {
display: inline-block;
vertical-align: top;
margin-right: 15px;
}
.ohs-overview-box .icon i {
font-size: 60px;
color: #fff;
}
#media (min-width: 992px) and (max-width: 1199px) {
.ohs-overview-box .icon {
margin-right: 3px;
}
.ohs-overview-box .icon i {
font-size: 30px;
}
}
#media (max-width: 991px) {
.ohs-overview-box .icon {
font-size: 46px;
}
}
<div class="row m-t-25" id="corrective_action_summary_ii" style="text-align: center;">
<div class="col-md">
</div>
<div class="col-sm">
</div>
<div class="col-sm">
<div class="ohs-overview-item ohs-overview-item--c2">
<div class="ohs-overview__inner">
<div class="ohs-overview-box clearfix">
<div class="ohs-text-overview">
<h2>1</h2>
<span>Action Will Described</span>
</div>
</div>
</div>
</div>
</div>
<div class="col-sm">
<div class="ohs-overview-item ohs-overview-item--c2">
<div class="ohs-overview__inner">
<div class="ohs-overview-box clearfix">
<div class="ohs-text-overview">
<h2>1</h2>
<span>Action Is In Progress</span>
</div>
</div>
</div>
</div>
</div>
<div class="col-sm">
<div class="ohs-overview-item ohs-overview-item--c2">
<div class="ohs-overview__inner">
<div class="ohs-overview-box clearfix">
<div class="ohs-text-overview">
<h2>0</h2>
<span>Action Completed</span>
</div>
</div>
</div>
</div>
</div>
<div class="col-sm">
</div>
</div>

.ohs-overview-item {
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
padding: 30px;
padding-bottom: 0;
-webkit-box-shadow: 0px 2px 5px 0px rgba(0, 0, 0, 0.1);
-moz-box-shadow: 0px 2px 5px 0px rgba(0, 0, 0, 0.1);
box-shadow: 0px 2px 5px 0px rgba(0, 0, 0, 0.1);
margin-bottom: 40px;
min-height: 120px;
}
adding min-height has solved my problem thanks to gpl

Related

Dropdown Menu Element Not Displaying

I'm making a website that uses a group of images as a menu.
I was able to get one side to properly display the dropdown (slideout, in this case) menus. But even though both sides are identical, the other one does not display the menu on mouseOver.
I looked through the code for the last hour, and just can't find what is wrong.
Here is the jsFiddle.
Thanks :)
* {
box-sizing: border-box;
}
h1 {
font-size: 50px;
color: aliceblue
}
.topbar{
margin-top: 0px;
padding: 1px;
background-color:#605E5E;
border-bottom-style:inset;
border-bottom-color: #888888;
}
.touch-menu{
/* Permalink - use to edit and share this gradient: https://colorzilla.com/gradient-editor/#eda954+0,e5933b+29,e59f54+56,e89230+79,e89230+91,e89230+100 */
background: rgb(237,169,84); /* Old browsers */
background: -moz-linear-gradient(top, rgba(237,169,84,1) 0%, rgba(229,147,59,1) 29%, rgba(229,159,84,1) 56%, rgba(232,146,48,1) 79%, rgba(232,146,48,1) 91%, rgba(232,146,48,1) 100%); /* FF3.6-15 */
background: -webkit-linear-gradient(top, rgba(237,169,84,1) 0%,rgba(229,147,59,1) 29%,rgba(229,159,84,1) 56%,rgba(232,146,48,1) 79%,rgba(232,146,48,1) 91%,rgba(232,146,48,1) 100%); /* Chrome10-25,Safari5.1-6 */
background: linear-gradient(to bottom, rgba(237,169,84,1) 0%,rgba(229,147,59,1) 29%,rgba(229,159,84,1) 56%,rgba(232,146,48,1) 79%,rgba(232,146,48,1) 91%,rgba(232,146,48,1) 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eda954', endColorstr='#e89230',GradientType=0 ); /* IE6-9 */
display: flex;
padding: 10px;
}
ul {
text-align: center;
list-style-type: none;
margin: 10px;
vertical-align: middle;
}
.slideout-content-top-left, .slideout-content-bottom-left {
display: none;
height: 95%;
margin: 10px 0px 10px 0px;
min-width: 16px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
background-color: #736E6F;
z-index: 1;
}
.slideout-content-top-right, .slideout-content-bottom-right {
display: none;
height: 95%;
margin: 10px 10px 10px 0px;
background-color: #736E6F;
min-width: 16px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;
vertical-align: middle;
}
.menu-top-right :hover + .slideout-content-top-right , .menu-bottom-right :hover + .slideout-content-bottom-right {
display: inline-block;
}
.slideout-content-bottom-right:hover , .slideout-content-top-right:hover {
display: inline-block;
}
.menu-top-left :hover + .slideout-content-top-left , .menu-bottom-left :hover + .slideout-content-bottom-left {
display: inline-block;
}
.slideout-content-bottom-left:hover , .slideout-content-bottom-left:hover {
display: inline-block;
}
.touch-menu img:hover {
filter: brightness(1.25);
}
.column {
flex: 50%;
display: flex;
flex-direction: column;
vertical-align: middle;
}
.menu-top-left , .menu-bottom-left , .menu-bottom-right, .menu-top-right {
flex: 50%;
height: 100%;
}
.menu-bottom-left img, .menu-top-left img{
width: 50%;
height: 95%;
float: right;
margin: 10px 10px 10px 0px;
}
.menu-bottom-right img , .menu-top-right img {
width: 50%;
height: 95%;
float: left;
margin: 10px 0px 10px 10px;
}
<!DOCTYPE html>
<html lang="en">
<head>
<title>Heter Iska</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" href="images/favicon.png">
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="css/styles.css">
<style>
body {font-family: "Lato", sans-serif}
</style>
</head>
<body>
<header>
<div class="topbar" align="center">
<h1>Links of Links</h1>
</div>
</header>
<div class="touch-menu" align="center">
<div class="column slideout-left" align="right">
<div class="menu-top-left" >
<div class="slideout-content-top-left" id="top-left">
<ul>
<li>
scaleLink 1
</li>
<li>
scaleLink 2
</li>
<li>
scaleLink 3
</li>
</ul>
</div>
<img class="slideout" src="https://avatarfiles.alphacoders.com/105/thumb-105223.jpg" alt="scale">
</div>
<div class="menu-bottom-left" >
<div class="slideout-content-bottom-left" id="bottom-left">
<ul>
<li>
bookLink 1
</li>
<li>
bookLink 2
</li>
<li>
bookLink 3
</li>
</ul>
</div>
<img class="slideout " src="https://avatarfiles.alphacoders.com/105/thumb-105223.jpg" alt="Book" >
</div>
</div>
<div class="column slideout-right" align="left">
<div class= "menu-top-right">
<img class="slideout " src="https://avatarfiles.alphacoders.com/105/thumb-105223.jpg" alt="topGavel">
<div class="slideout-content-top-right" id="top-right" >
<ul class="slidelist">
<li>
ugavelLink 1
</li>
<li>
ugavelLink 2
</li>
<li>
ugavelLink 3
</li>
</ul>
</div>
</div>
<div class="menu-bottom-right">
<img class="slideout" src="https://avatarfiles.alphacoders.com/105/thumb-105223.jpg" alt="bottomGavel">
<div class="slideout-content-bottom-right" id="bottom-right">
<ul>
<li>
lgavelLink 1
</li>
<li>
lgavelLink 2
</li>
<li>
lgavelLink 3
</li>
</ul>
</div>
</div>
</div>
</div>
<!-- Footer -->
<footer class="w3-container w3-padding-2 w3-center w3-opacity w3-dark-grey w3-xlarge">
<p class="w3-medium">Powered by Barack Obama</p>
</footer>
<script>
function expandTab(n) {
document.getElemen
}
</script>
</body>
</html>
Your css is wrong. You are using + instead >
* {
box-sizing: border-box;
}
h1 {
font-size: 50px;
color: aliceblue
}
.topbar {
margin-top: 0px;
padding: 1px;
background-color: #605E5E;
border-bottom-style: inset;
border-bottom-color: #888888;
}
.touch-menu {
/* Permalink - use to edit and share this gradient: https://colorzilla.com/gradient-editor/#eda954+0,e5933b+29,e59f54+56,e89230+79,e89230+91,e89230+100 */
background: rgb(237, 169, 84); /* Old browsers */
background: -moz-linear-gradient(top, rgba(237, 169, 84, 1) 0%, rgba(229, 147, 59, 1) 29%, rgba(229, 159, 84, 1) 56%, rgba(232, 146, 48, 1) 79%, rgba(232, 146, 48, 1) 91%, rgba(232, 146, 48, 1) 100%); /* FF3.6-15 */
background: -webkit-linear-gradient(top, rgba(237, 169, 84, 1) 0%, rgba(229, 147, 59, 1) 29%, rgba(229, 159, 84, 1) 56%, rgba(232, 146, 48, 1) 79%, rgba(232, 146, 48, 1) 91%, rgba(232, 146, 48, 1) 100%); /* Chrome10-25,Safari5.1-6 */
background: linear-gradient(to bottom, rgba(237, 169, 84, 1) 0%, rgba(229, 147, 59, 1) 29%, rgba(229, 159, 84, 1) 56%, rgba(232, 146, 48, 1) 79%, rgba(232, 146, 48, 1) 91%, rgba(232, 146, 48, 1) 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#eda954', endColorstr='#e89230', GradientType=0); /* IE6-9 */
display: flex;
padding: 10px;
}
ul {
text-align: center;
list-style-type: none;
margin: 10px;
vertical-align: middle;
}
.slideout-content-top-left, .slideout-content-bottom-left {
display: none;
height: 95%;
margin: 10px 0px 10px 0px;
min-width: 16px;
box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
background-color: #736E6F;
z-index: 1;
}
.slideout-content-top-right, .slideout-content-bottom-right {
display: none;
height: 95%;
margin: 10px 10px 10px 0px;
background-color: #736E6F;
min-width: 16px;
box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
z-index: 1;
vertical-align: middle;
}
.menu-top-right:hover > .slideout-content-top-right, .menu-bottom-right:hover > .slideout-content-bottom-right {
display: inline-block;
}
.slideout-content-bottom-right:hover, .slideout-content-top-right:hover {
display: inline-block;
}
.menu-top-left:hover > .slideout-content-top-left, .menu-bottom-left:hover > .slideout-content-bottom-left {
display: inline-block;
}
.slideout-content-bottom-left:hover, .slideout-content-bottom-left:hover {
display: inline-block;
}
.touch-menu img:hover {
filter: brightness(1.25);
}
.column {
flex: 50%;
display: flex;
flex-direction: column;
vertical-align: middle;
}
.menu-top-left, .menu-bottom-left, .menu-bottom-right, .menu-top-right {
flex: 50%;
height: 100%;
}
.menu-bottom-left img, .menu-top-left img {
width: 50%;
height: 95%;
float: right;
margin: 10px 10px 10px 0px;
}
.menu-bottom-right img, .menu-top-right img {
width: 50%;
height: 95%;
float: left;
margin: 10px 0px 10px 10px;
}

Css input slider has weird positioning

I'm trying to get a input slider within another parent div. The
desired result looks like this:
The problem is when I try this the input slider gets a huge width, and
the height is messed up aswel.
I made Fiddle:
.wrapper {
display: inline-block;
width: 100%;
max-width: 100px;
background: #353434;
color: rgba(255, 255, 255, 0.9);
box-shadow: inset 0px 0px 4px 0px rgba(0, 0, 0, 0.75);
font-family: 'Raleway', 'Helvetica Neue', 'Helvetica', 'Arial'
}
.wrapper-header {
display: flex;
flex-flow: row nowrap;
justify-content: center;
padding: .5rem;
}
.wrapper-middle {
display: flex;
justify-content: center;
align-items: center;
}
.wrapper-end {
display: flex;
flex-flow: row nowrap;
justify-content: center;
height: 340px;
padding-top: 1rem;
padding-bottom: 1rem;
}
.slider-value {
min-width: 24px;
padding: .25rem;
border-radius: 2px;
color: #1fcc1f;
background: #333;
box-shadow: inset 0 0 3px 3px rgba(0, 0, 0, 0.5);
font-family: 'VT323', monospace;
text-align: center;
}
.button {
padding: .55rem;
border-radius: 2px;
background: linear-gradient(to bottom, #4f4f4f 0%, #0e0e0e 100%);
box-shadow: 0px 0px 1px 1px rgba(0, 0, 0, 0.5);
}
.wrapper-end-left {
height: 100%;
background: red;
}
.wrapper-end-right {
height: 100%;
background: blue;
}
[type='range'] {
-webkit-appearance: none; /* Hides the slider so that custom slider can be made */
margin: 0;
padding: 0;
width: 30rem;
height: 1.5em;
transform: rotate(-90deg);
background: transparent;
}
input[type=range]::-webkit-slider-thumb {
-webkit-appearance: none;
box-sizing: border-box;
border: none;
width: 1.5em; height: 1.5em;
border-radius: 50%;
background: #f90;
}
input[type=range]::-webkit-slider-runnable-track {
box-sizing: border-box;
border: none;
margin: 0;
padding: 0;
width: 100%; height: 100%;
background: #ccc;
}
<div class="wrapper">
<div class="wrapper-header">
<div class="button">
x
</div>
<div class="button">
x
</div>
</div>
<div class="wrapper-middle">
<div class="slider-value">
1
</div>
</div>
<div class="wrapper-end">
<div class="wrapper-end-left">
<input type="range">
</div>
<div class="wrapper-end-right">
two
</div>
</div>
</div>
Does someone know why this is happening?
Already read a lot here about input sliders but can't fix it.
https://css-tricks.com/styling-cross-browser-compatible-range-inputs-css/
https://codepen.io/freoted/pen/WGvxmN
https://jsfiddle.net/rwaldron/XukVc/
It is a little hacky but it resembles the desired layout now slightly closer - not tested to see how this would fare at different locations on the page or at different sizes. one of the key things that changed the layout was setting the transform-origin and tweaking the location with translate3d
document.addEventListener('DOMContentLoaded',(e)=>{
document.querySelector('[type="range"]').addEventListener('change',(e)=>{
document.querySelector('div.slider-value').textContent=e.target.value > 0 ? e.target.value : e.target.value * -1;
});
});
.wrapper {
display: inline-block;
width: 100%;
max-width: 100px;
background: #353434;
color: rgba(255, 255, 255, 0.9);
box-shadow: inset 0px 0px 4px 0px rgba(0, 0, 0, 0.75);
font-family: 'Raleway', 'Helvetica Neue', 'Helvetica', 'Arial'
}
.wrapper,.wrapper *{
box-sizing: border-box;
}
.wrapper-header {
display: flex;
flex-flow: row nowrap;
justify-content: center;
padding: .5rem;
}
.wrapper-middle {
display: flex;
justify-content: center;
align-items: center;
}
.wrapper-end {
display: flex;
flex-flow: row nowrap;
justify-content: center;
height: 340px;
padding-top: 1rem;
padding-bottom: 1rem;
}
.slider-value {
min-width: 24px;
padding: .25rem;
border-radius: 2px;
color: #1fcc1f;
background: #333;
box-shadow: inset 0 0 3px 3px rgba(0, 0, 0, 0.5);
font-family: 'VT323', monospace;
text-align: center;
}
.button {
padding:0.55rem;
border-radius:2px;
background: linear-gradient(to bottom, #4f4f4f 0%, #0e0e0e 100%);
box-shadow: 0px 0px 1px 1px rgba(0, 0, 0, 0.5);
}
.wrapper-end-left {
height: 100%;
padding:0;
margin:0 1.25rem 0 0;
display:flex;
flex-direction:column;
flex-wrap:no-wrap;
align-content:center;
justify-content:stretch;
}
.wrapper-end-right {
height:100%;
width:0.75rem!important;
background:linear-gradient(0deg, rgba(13,60,2,1) 0%, rgba(57,241,17,1) 79%, rgba(245,157,63,1) 92%, rgba(255,0,0,1) 100%);
}
.wrapper-end-left,
.wrapper-end-right{
width:2rem;
}
[type='range'] {
-webkit-appearance:none;
margin:0;
padding:0;
flex:1;
height:1.5rem;
width:19.2rem;
transform-origin:5% 50%;
transform:rotate(-90deg) translate3d( -8.6rem, -0.25rem, 0 );
background:transparent;
outline:0;
}
input[type=range]::-webkit-slider-thumb {
-webkit-appearance:none;
border:none;
width:1.5em;
height:1.5em;
border-radius:50%;
background:black;
border:2px solid silver;
margin:-0.35rem 0 0 0;
}
input[type=range]::-webkit-slider-runnable-track {
box-sizing:border-box;
border:none;
margin:0;
padding:0;
height:0.5rem;
flex:1;
background:#ccc;
}
<div class="wrapper">
<div class="wrapper-header">
<div class="button">x</div>
<div class="button">x</div>
</div>
<div class="wrapper-middle">
<div class="slider-value">0</div>
</div>
<div class="wrapper-end">
<div class="wrapper-end-left"><input type="range" step=3 min=-60 max=12 value=0 /></div>
<div class="wrapper-end-right"> </div>
</div>
</div>

One Font awesome icon not showing, despite others that do

I wanted to add a certain font awesome icon (fa-arrow-alt-circle-down), but it's not showing. I copied the classes from the website and entered them in my HTML. I tried other icons before and there was no issue with them. Sometimes I change .far to .fa, but now that doesn't work either. Can someone see why?
<div class="jumbotron jumbotron-fluid">
<h1 class="heading-primary heading-primary--main"> Wizard's unite fans</h1>
<div class="navigation-container">
<button class="find-locals-nav-btn">Find Local players</button>
<button class="forum-nav-btn">Forum</button>
<button>login / register</button>
</div>
<i class="far fa-arrow-alt-circle-down"></i>
</div>
SCSS file
.jumbotron {
height: 100vh;
background-image: linear-gradient(
rgba(0, 0, 0, 0.5),
rgba(0, 0, 0, 0.5)
), url("https://i.amz.mshcdn.com/-7R3bLC1xTVhrjc86pBeYAogXFY=/950x534/filters:quality(90)/https%3A%2F%2Fblueprint-api-production.s3.amazonaws.com%2Fuploads%2Fcard%2Fimage%2F760683%2F2117d274-d2cf-46b9-b60c-698d65361438.jpg");
background-size: cover;
position: relative;
padding: 5rem;
margin-bottom: 2rem;
-webkit-clip-path: polygon(0 0, 100% 0, 100% 85vh, 0 100%);
clip-path: polygon(0 0, 100% 0, 100% 85%, 0 100%);
text-align: center;
display: flex;
align-items: center;
justify-content: center;
.heading-primary {
opacity: .8;
}
#include respond(phone) {
-webkit-clip-path: polygon(0 0, 100% 0, 100% 90vh, 0 100%);
clip-path: polygon(0 0, 100% 0, 100% 90vh, 0 100%);
background-position: center top;
}
.navigation-container {
border-radius: 20px;
background-color: #fff;
font-size: 2rem;
width: 70%;
margin: 4rem auto 0 auto;
display: flex;
text-align: center;
justify-content: center;
padding: 1rem;
background-image: linear-gradient(to bottom right, #ccc, #666);
> * {
background-color: transparent;
border: none;
flex: 1 0 0;
cursor: pointer;
color: #fff;
text-transform: uppercase;
letter-spacing: 1px;
&:hover {
transform: translateY(-.2rem);
}
&:not(:last-child) {
border-right: 1px solid #444;
}
}
}
.fa-arrow-alt-circle-down {
font-size: 4rem;
color: #fff;
}
}
.fa Font Awesome are v4. .far are v5.
For all icons existing in both, changing far to fa will do the trick. For the ones added in v5, obviously, it won't, as they do not exist in v4.
You can view all v4.7 icons here.
For future notice, finding version specific FA icons is by searching for "font awesome x.x cheatsheet". Replace x.x with the proper version.

Content remains behind :before Div overlay in IE

I am struggling with this overlay. On the prod site the :before element overlays a div with a full image bg. When viewing the site in Chrome and Firefox the content is displayed above the overlay as intended. However, when viewing the content in IE11 the :before element overlays everything in that parent div.
I would like the result in Chrome to be the same in IE.
Ex. Overlay above image, text/content on top of the overlay.
See: JSFiddle
.foreverCTA:before {
content: "";
width: 100%;
height: 900px;
background: #2f71a9;
background: -webkit-radial-gradient(circle, transparent -25%, #2f71a9 81%);
background: -o-radial-gradient(circle, transparent -25%, #2f71a9 81%);
background: -moz-radial-gradient(circle, transparent -25%, #2f71a9 81%);
background: radial-gradient(circle, transparent -25%, #2f71a9 81%);
position: absolute;
left: 0;
}
.foreverCTA {
color: #fff;
/*display: flex;*/
background: #fff url("images/2015APR06_RAYSBASEBALL_MFPB6240s.jpg") no-repeat center;
background-size: cover;
height: 900px;
/*justify-content: center;
flex-wrap: wrap;
align-items: center;*/
}
.foreverCTA p,
.foreverCTA h2,
.foreverCTA h4 {
color: #fff!important;
}
.foreverCTA li,
.foreverCTA ul {
list-style: none;
padding: 0;
}
.foreverCTA p,
.foreverCTA h3,
.foreverCTA h2,
.foreverCTA li {
-webkit-filter: drop-shadow(0px 0px 10px rgba(0, 0, 0, .4));
filter: drop-shadow(0px 0px 10px rgba(0, 0, 0, .4));
}
.ion-ios-baseball {
margin: 3px;
padding-top: 10px;
font-size: 2em;
vertical-align: center;
}
.foreverGame {
margin-top: 50px;
}
.foreverHeader {
padding-top: 50px;
/*-webkit-flex: 1 1 100%;
-moz-flex: 1 1 100%;
-ms-flex: 1 1 100%;
-o-flex: 1 1 100%;
flex: 1 1 100%;
z-index: 999;*/
}
.waysToBuy {
margin: 50px 0;
}
.buyDetails {
min-height: 210px;
text-align: center;
}
.foreverHeader h1,
.waysToBuy h1 {
font-size: 4.5em;
color: #ECDC00!important;
padding: 0!important;
margin: 0;
-webkit-filter: drop-shadow(2px 4px 0px rgba(249, 159, 28, 1));
filter: drop-shadow(2px 4px 0px rgba(249, 159, 28, 1));
}
.foreverHeader h3 {
font-size: 3.5em;
color: #fff!important;
margin: 5px;
}
.foreverBuy {
/*display: flex;
justify-content: center;
flex-wrap: wrap;
align-items: flex-start;*/
}
.buy1,
.buy2 {
height: 400px;
/*display: flex;
flex-direction: column;
justify-content: center;
flex-wrap: wrap;
align-items: flex-end;
flex-basis: 20%;*/
}
.buyDetails {
/*align-self: flex-start;*/
}
.buyButton {
/*flex-basis: 50%;
align-self: center;*/
vertical-align: bottom;
}
.buy2 a {
color: #ECDC00!important;
}
<div class="foreverCTA">
<div class="row">
<div class="foreverHeader">
<h3>Lorem ipsum<br></h3>
<h1>Lorem ipsum<br></h1>
<h3>Lorem ipsum</h3>
</div>
</div>
<div class="row">
<div class="foreverGame">
<h2>Lorem ipsum</h2>
</div>
<div class="foreverDate">
<h3>Lorem ipsum</h3>
</div>
</div>
</div>
This will do the trick,
check this fiddle here
first remove position:absolute property and add following properties as,
display:block;
margin-bottom:-900px;
so your final CSS will be as follows,
.foreverCTA:before {
content: "";
width: 100%;
height: 900px;
background: #2f71a9;
background: -webkit-radial-gradient(circle, transparent -25%, #2f71a9 81%);
background: -o-radial-gradient(circle, transparent -25%, #2f71a9 81%);
background: -moz-radial-gradient(circle, transparent -25%, #2f71a9 81%);
background: radial-gradient(circle, transparent -25%, #2f71a9 81%);
left: 0;
display:block;
margin-bottom:-900px;
}

Some child elements do not affect the parent's height

I am building a design for my university but have come across this peculiar problem: the <div> element' height is not affected by its insides.
Just take a look at these screenshots:
demo
Just to make some sense: I'm trying to build something complicated (for me) without using tables (only CSS - we are living in a modern web-epoch though =) ). Here's my goal:
I have some long and messy HTML and CSS code - I'm truly not a designer yet. Here it is:
HTML:
<html>
<head>
<title>verstka</title>
<link rel="stylesheet" type="text/css" href="verstka.css" media="all" />
</head>
<body>
<div class="top">
<div class="header angled-stripes">
<div class="logo"></div>
<div class="right-menu">
<div class="quick-links links">
<div class="item">
Home
</div>
<div class="item">
Login
</div>
<div class="item">
<span>Sitemap</span>
</div>
</div>
<div class="quick-search">
<form action="" method="get" onsubmit="javascript:void(0);">
<input type="text" name="q" size="20" />
search
</form>
</div>
</div>
</div>
<div class="top-menu">
<div class="item">
Products
</div>
<div class="item">
Download
</div>
<div class="item">
Support
</div>
<div class="item">
Contacts
</div>
</div>
</div>
<div class="middle table-positioning">
<div class="row-positioning">
<div class="left-column">
<div class="content">
<div class="block product angled-stripes">
<div class="title">BASIC Package</div>
<div class="body">
<img src="product-green.png" />
<span>blah-blah-blah-blah-blah-blah-blah-blah-blah-blah-blah-blah-blah-blah-blah-blah-blah-blah-blah-blah-blah-blah-blah</span>
<div class="links">
Details
Download
</div>
purchase now
</div>
<div class="clearer"></div>
</div>
<div class="block product angled-stripes">
<div class="title">FULL Package</div>
<div class="body">
<span>lorem ipsumlorem ipsumlorem ipsumlorem ipsumlorem ipsumlorem ipsumlorem ipsumlorem ipsumlorem ipsumlorem ipsumlorem ipsumlorem ipsum</span>
<div class="links">
Details
Download
</div>
purchase now
</div>
<div class="clearer"></div>
</div>
<div class="block plain">
<div class="title">Popular Products</div>
<ul class="green-arrow-markered">
<li>
Set True Image 9.0
</li>
<li>
Standard Recorder 6.5
</li>
<li>
Disk Director Upgrade 4.56
</li>
<li>
ZippeNotes 6.22
</li>
</ul>
</div>
</div>
<div class="footer">
©<span class="bolder">Software Company</span>
<div class="links">
Privacy Policy
Terms of Use
<div class="clearer"></div>
</div>
</div>
</div>
<div class="right-column">
<div class="content">
<div class="post">
<div class="title green-title">Company Address</div>
<div class="image"><img src="company-photo.jpg" alt="company photo"></div>
<div class="content"></div>
</div>
<div class="post left-post">
<div class="title">Contact Form</div>
<form action="#" onsubmit="javascript:void(0);">
<div class="input">
<label for="name">Your full name:</label>
<input id="name" name="name" type="text" />
</div>
<div class="input">
<label for="email">E-mail address:</label>
<input id="email" name="email" type="text" />
</div>
<div class="input">
<label for="phone">Your phone:</label>
<input id="phone" name="phone" type="text" />
</div>
<div class="input">
<label for="message">Your message</label>
<textarea name="message" id="message" cols="30" rows="10"></textarea>
</div>
<input type="submit" />
</form>
<div class="row">
reset
submit
</div>
</div>
<div class="highlighted-block post">
<div class="title green-title">
<img src="newsletter" alt="newsletter icon" />
<div>
<span class="uppercase">newsletter</span><br /><span class="sub-title">signup</span>
</div>
</div>
<div class="clearer"></div>
<form action="#" onsubmit="javascript:void(0);">
<label for="newsletter-name">Enter your name, please:</label>
<input id="newsletter-name" name="name" type="text" />
<label for="newsletter-email">Enter your e-mail, please:</label>
<input id="newsletter-email" name="email" type="text" />
subscribe now
</form>
<div>
<strong>Note:</strong>
<span>lorem ipsum ololo!</span>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
<div class="links">
Home
Products
Download
Support
Contacts
Login
Sitemap
<div class="clearer"></div>
</div>
</div>
</div>
</div>
</div>
<div class="bottom">
</div>
</body>
</html>
CSS:
html, body {
margin: 0 0 80px 0;
padding: 0;
background-color: #313131;
color: #fff;
font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif;
font-size: 12px;
}
a, a:hover, a:visited {
color: #fff;
}
/*.links .item:nth-child(n+2):before {
content: '|';
}
*/
.links .item:nth-child(n+2) {
margin-left: 10px;
padding-left: 10px;
border-left: 1px solid #9C9C9C;
}
.links .item {
color: #9c9c9c;
float: left;
display: inline-block;
}
.links a.item:visited {
color: #9c9c9c;
}
.links a.item:hover {
color: #9c9c9c;
}
.bolder {
font-weight: bold;
}
.footer {
color: #9c9c9c;
}
.middle .left-column .content .block.product:nth-child(n+1) {
/*background: #8dc63f;*/
background-color: #86bc3c;
/*background-size: 25px 25px;*/
/*box-shadow: 1px 1px 8px #77ad32;*/
}
.middle .left-column .content .block.product:nth-child(n+2) {
/*background: #ee8911;*/
background-color: #ee8911;
/*background-size: 25px 25px;*/
/*box-shadow: 1px 1px 8px #eb7e0e;*/
}
.middle .left-column .content .block.product .title {
border-radius: 5px 5px 0 0;
padding-left: 20px;
text-shadow: 2px -1px 1px black;
min-height: 40px;
line-height: 40px;
vertical-align: middle;
}
.middle .left-column .content .block.product:nth-child(n+1) .title {
background: #6ce25d; /* Old browsers */
/* IE9 SVG, needs conditional override of 'filter' to 'none' */
background: -moz-linear-gradient(top, #6ce25d 16%, #4ebb30 36%, #bee884 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(16%,#6ce25d), color-stop(36%,#4ebb30), color-stop(100%,#bee884)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #6ce25d 16%,#4ebb30 36%,#bee884 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #6ce25d 16%,#4ebb30 36%,#bee884 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #6ce25d 16%,#4ebb30 36%,#bee884 100%); /* IE10+ */
background: linear-gradient(to bottom, #6ce25d 16%,#4ebb30 36%,#bee884 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6ce25d', endColorstr='#bee884',GradientType=0 ); /* IE6-8 */
}
.middle .left-column .content .block.product:nth-child(n+2) .title {
background: #db8a08; /* Old browsers */
background: -moz-linear-gradient(top, #db8a08 17%, #c76307 36%, #ef9366 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(17%,#db8a08), color-stop(36%,#c76307), color-stop(100%,#ef9366)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #db8a08 17%,#c76307 36%,#ef9366 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #db8a08 17%,#c76307 36%,#ef9366 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #db8a08 17%,#c76307 36%,#ef9366 100%); /* IE10+ */
background: linear-gradient(to bottom, #db8a08 17%,#c76307 36%,#ef9366 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#db8a08', endColorstr='#ef9366',GradientType=0 ); /* IE6-8 */
}
.middle .left-column .content .block .body .links .item:nth-child(n+2) {
border-left-color: #fff;
}
.middle .left-column .content .block .body .links .item {
color: #fff;
}
.middle .left-column .content .block.product .body img {
width: 30%;
float: left;
margin: 10px;
}
.middle .left-column {
width: 20%;
max-height: 350px;
}
.middle .right-column {
width: 65%;
}
.middle .right-column .content {
background-color: #fff;
border-radius: 5px;
border: 3px solid #1c1c1c;
}
.top .header .quick-links .item {
color: #fff;
}
.top .header {
font-size: 10pt;
}
.top .header .right-menu {
display: inline-block;
position: absolute;
right: 20px;
top: 20px;
}
.top .header .right-menu .quick-links {
display: block;
float: right;
margin: 20px 0;
}
.top .header .right-menu .quick-search {
display: block;
height: 20px;
line-height: 10px;
}
.top .header .right-menu .quick-search form {
margin-right: -10px;
}
.top .header .right-menu .quick-search form * {
display: inline-block;
float: left;
margin: 0 3px;
}
.button {
color: #fff !important;
text-transform: uppercase;
display: inline-block;
background-color: #a4dff2;
border: 1px solid #027499;
text-decoration: none;
font-family: Arial;
font-weight: bold;
text-shadow: #17688d;
font-size: 10pt !important;
text-align: center;
min-width: 70px;
max-height: 20px;
padding: 5px 5px;
border-radius: 3px;
text-shadow: 1px -1px 1px #000;
background: #69ace0; /* Old browsers */
background: -moz-linear-gradient(top, #69ace0 14%, #207cca 38%, #7db9e8 66%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(14%,#69ace0), color-stop(38%,#207cca), color-stop(66%,#7db9e8)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #69ace0 14%,#207cca 38%,#7db9e8 66%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #69ace0 14%,#207cca 38%,#7db9e8 66%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #69ace0 14%,#207cca 38%,#7db9e8 66%); /* IE10+ */
background: linear-gradient(to bottom, #69ace0 14%,#207cca 38%,#7db9e8 66%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#69ace0', endColorstr='#7db9e8',GradientType=0 ); /* IE6-8 */
}
.top {
height: 220px;
}
.top .header {
background-color: #09aad3;
/*background-size: 25px 25px;*/
box-shadow: 1px 1px 8px #0480a7;
height: 115px;
}
.top .header .logo {
width: 300px;
height: 50px;
margin: 20px 25px;
border-radius: 6px;
background-color: #027297;
position: absolute;
top: 0;
left: 0;
display: inline-block;
}
.top {
text-align: center;
}
.top .top-menu {
display: block;
height: 100px;
text-align: center;
}
.top .top-menu .item {
width: 190px;
height: 100px;
background-color: #363636;
display: inline-block;
margin: 0 -3px;
vertical-align: middle;
line-height: 50px;
/*font-family: Arial;*/
font-size: 14pt;
border: 1px solid #000;
border-radius: 4px;
}
.top .top-menu .item a {
text-decoration: none;
}
.middle .left-column .content .block .body {
margin: 10px;
}
.middle .left-column .content .block {
/*padding: 10px;*/
border-radius: 10px;
width: 225px;
max-width: 225px;
font-size: 12px;
margin: 7px;
border: 3px solid #1b1b1b;
}
.middle .left-column .content .block.plain {
background-color: #3f3f3f;
padding: 10px;
width: 205px;
}
.middle .left-column .content .block .title {
font-size: 16pt;
}
.middle .left-column .content .block.plain ul {
}
.middle .left-column .footer {
margin-left: 7px;
}
ul.green-arrow-markered {
list-style: disc outside url("list-bullet.gif");
padding-left: 15px;
}
.left-column {
padding-left: 5px;
}
.clearer {
clear: both;
}
.angled-stripes {
/*
background-color: #09aad3;
box-shadow: 1px 1px 8px #0480a7;
linear-gradient(45deg, rgba(255, 255, 255, 0.2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0.2) 75%, transparent 75%, transparent);
*/
background-image: /* Safari 5 and earlier */
-webkit-gradient(linear, 100% 100%, 0 0,
color-stop(.25, rgba(255, 255, 255, 0.2)),
color-stop(.25, rgba(255, 255, 255, 0)),
color-stop(.5, rgba(255, 255, 255, 0)),
color-stop(.5, rgba(255, 255, 255, 0.2)),
color-stop(.75, rgba(255, 255, 255, 0.2)),
color-stop(.75, rgba(255, 255, 255, 0)),
color-stop(1, rgba(255, 255, 255, 0)));
background-image: /* Chrome and Webkit Nightly build */
-webkit-linear-gradient(45deg,
rgba(255, 255, 255, 0.2) 25%,
rgba(255, 255, 255, 0) 25%,
rgba(255, 255, 255, 0) 50%,
rgba(255, 255, 255, 0.2) 50%,
rgba(255, 255, 255, 0.2) 75%,
rgba(255, 255, 255, 0) 75%,
rgba(255, 255, 255, 0) 100%
);
background-image: /* Firefox */
-moz-linear-gradient(45deg,
rgba(255, 255, 255, 0.2) 25%,
rgba(255, 255, 255, 0) 25%,
rgba(255, 255, 255, 0) 50%,
rgba(255, 255, 255, 0.2) 50%,
rgba(255, 255, 255, 0.2) 75%,
rgba(255, 255, 255, 0) 75%,
rgba(255, 255, 255, 0) 100%
);
background-image: /* IE10 */
-ms-linear-gradient(45deg,
rgba(255, 255, 255, 0.2) 25%,
rgba(255, 255, 255, 0) 25%,
rgba(255, 255, 255, 0) 50%,
rgba(255, 255, 255, 0.2) 50%,
rgba(255, 255, 255, 0.2) 75%,
rgba(255, 255, 255, 0) 75%,
rgba(255, 255, 255, 0) 100%
);
background-image: /* opera 11+ */
-o-linear-gradient(45deg,
rgba(255, 255, 255, 0.2) 25%,
rgba(255, 255, 255, 0) 25%,
rgba(255, 255, 255, 0) 50%,
rgba(255, 255, 255, 0.2) 50%,
rgba(255, 255, 255, 0.2) 75%,
rgba(255, 255, 255, 0) 75%,
rgba(255, 255, 255, 0) 100%
);
background-image:
linear-gradient(45deg,
rgba(255, 255, 255, 0.2) 25%,
rgba(255, 255, 255, 0) 25%,
rgba(255, 255, 255, 0) 50%,
rgba(255, 255, 255, 0.2) 50%,
rgba(255, 255, 255, 0.2) 75%,
rgba(255, 255, 255, 0) 75%,
rgba(255, 255, 255, 0) 100%
);
background-size: 15px 15px;
-moz-background-size: 15px 15px;
-webkit-background-size: 15px 15px;
-o-background-size: 15px 15px;
-ms-background-size: 15px 15px;
}
input[type=submit], input[type=button] {
display: none;
}
.middle {
position: relative;
width: 100%;
margin: 0;
}
.middle .right-column {
color: #000;
width: 80%;
position: absolute;
top: 0;
}
.table-positioning {
display: table;
width: 100%;
}
.table-positioning .row-positioning {
display: table-row;
padding-left: 20px;
}
.table-positioning .row-positioning .cell-positioning {
display: table-cell;
}
.middle .left-column, .middle .right-column {
display: table-cell;
}
.middle .right-column .post .title {
font-size: 16pt;
color: #09aad3;
}
.green-title {
color: #4ebb30 !important;
}
.blue-title {
color: #09aad3 !important;
}
.uppercase {
text-transform: uppercase;
}
.middle .right-column .post .title {
padding: 10px 0;
margin: 10px;
border-bottom: 1px solid #bebebe;
}
.middle .right-column .post form input, .middle .right-column .post form label, .middle .right-column .post form textarea {
display: block;
width: 100%;
}
.middle .right-column .post form input[type=submit], .middle .right-column .post form input[type=button] {
display: none;
}
.middle .right-column .post .image {
display: inline-block;
border: 1px solid #bebebe;
border-radius: 4px;
padding: 3px;
}
.middle .right-column .post .image img {
border: none;
min-width: 124px;
min-height: 124px;
width: 124px;
height: 124px;
max-width: 124px;
max-height: 124px;
}
.middle .right-column .post .content {
margin: 10px;
border: none;
border-radius: 0;
border-bottom: 1px solid #bebebe;
}
.middle .right-column .post {
padding: 0 20px;
}
.split-content {
display: table;
}
.highlighted-block {
border: 1px solid #bebebe;
border-radius: 6px;
background-color: #eeeeee;
margin: 20px;
min-height: 420px;
width: 300px;
float: right;
display: inline-block;
}
.middle .right-column .left-post {
float: left;
display: inline-block;
width: 500px;
}
.middle .right-column .left-post .row {
clear: both;
display: inline-block;
float: right;
}
.highlighted-block img {
display: inline-block;
float: left;
}
.highlighted-block .title {
display: block;
height: 110px;
}
.highlighted-block .title div {
display: inline-block;
}
.highlighted-block .title img {
display: inline-block;
float: left;
width: 100px;
margin: 10px;
height: 100px;
}
.middle .right-column .post .button {
float: right;
margin-left: 10px;
}
.middle .right-column .cell-positioning.post {
margin: 20px;
}
.cell-positioning.wider {
width: 65%;
}
.middle .right-column .post .input {
display: block;
position: relative;
margin: 10px;
float: left;
clear: both;
width: 100%;
}
.middle .right-column .post .input * {
display: inline-block !important;
width: 50%;
}
.middle .right-column .post .input input, .middle .right-column .post .input textarea {
position: absolute;
right: 0;
}
.middle .right-column .footer .links {
float: right;
margin: 5px 10px;
}
As you can see, i have one block, .middle, containing the left part, left-column and the right part, .right-column.
The right column contains only one element - .content. But the elements of that container could be divided into several columns recursively (it contains two columns, one of which contains two columns, one of which contain two columns...).
So I tried to use the CSS3 display: table;, display: table-row; and display: table-column; properties. Somehow it helped me. A bit. I've tried to apply the same changes to my current problem but it doesn't seem to be working. So, I decided to try the <div> approach. The problem with this is that the <div>, containing the label and its input is not sizing by the maximum child' height (<textarea> is much larger than the <label>, but the container' height is as big as the label' one).
I have two questions based on this information:
Why does the "miscalculation of the height" happen and how do I prevent it?
How should I do the layout to get my code modern, stupidly simple (KISS) and yet responsive?
why do things like that "miscalculation of the height" happen and how to prevent them?
That's because you're using float on all objects within the container. Floats are a little weird, so I recommend reading this CSS-Tricks article on them.
In short, though, when you float an element, you take it out of the document flow. When all elements in a (non-floated) container are floated, the parent thinks it doesn't have any children, and therefore collapses. There are a few ways you can fix this:
Set overflow: hidden on the parent container (this only really works if the container does not have a specified height)
Add clear: both to an element immediately after the floated elements, inside the parent container (this works well, but may add extra markup if you add elements specifically for this purpose)
Harness the power of the :after pseudo-element (this only works for browsers that support it; the good news is that the majority do, albeit possibly requiring a polyfill).
how i should do the layout of the elements to get my code modern, stupidly simple (KISS) and yet responsive?
From what I can see here, you're doing a number of things that are making your work more difficult than is necessary. It seems to me that you're missing some fundamentals.
You might want to look more into semantic markup. You're experiencing what we in the trade call "divitis". That is, you're wrapping things in <div> tags that are probably better suited to other elements.
For example, every place that you use <div class="item">, you can change to an unordered list (<ul>) and each "item" is a list item (<li>). This saves you from attaching a class to absolutely everything.
Additionally, you don't have to reinvent the wheel with your button. There are both an input type=button and <button> element. Using either of these will open up the form.submit action that you can then hook into (instead of recreating it, too).
You also shouldn't need chains of CSS selectors that are half a dozen selectors long. Take a look at how CSS and specificity works, or you're going to cause yourself migraines in the relatively near future.
I recommend picking up Dan Cederholm's Handcrafted CSS and Bulletproof Web Design, as well as perusing A List Apart and CSS-Tricks, to get a better grasp on CSS and HTML at a fundamental level.
Try Using
.input { overflow: hidden }
It may solve your problem.
When you have floating elements inside another one the height of this parent gets compromised since the child elements are "floating"