We have CSS .block.block-dark h2 {color: #ffba0d;} but both the h2 & p are invisible below.
The div they are in has a higher z-index than the div preceding them that has the background color (<div class="column-overlay block-dark" style="opacity: 90%"> </div>).
I can't see why the background color is displaying over the top of the div with the text in it.
Help appreciated.
.column-bg-img {background-image: url('http://mercury.herodevelopment.com.au/wp-content/uploads/2020/09/Mercury_Residential_Air_Conditioning.jpg');}
.block .block-background-image.bg-scroll {
background-attachment: scroll;
}
.block .block-background-image {
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
.block .block-background-image, .block-overlay {
bottom: 0;
left: 0;
position: absolute;
right: 0;
top: 0;
z-index: 0;
}
.columns_block .column-bg-img, .columns_block .column-overlay {
height: 100%;
left: 0;
position: absolute;
top: 0;
width: 100%;
z-index: 0;
}
.columns_block .column-overlay.block-dark {
background-color: #2d3133;
}
.block.block-dark h2, .block.block-white h2, .carousel_block .carousel .carousel-inner .carousel-item .carousel-caption .carousel-caption-inner h3 {
color: #ffba0d;
}
#media (min-width: 1200px) {
.col-xl {
flex-basis: 0;
flex-grow: 1;
max-width: 100%;
}
}
<div class="container-wrapper block columns_block block-dark">
<div class="block-overlay" style="opacity: 90%"></div>
<!-- columns-block.twig -->
<div class="block-background-image bg-scroll" style="background-image: url('');"></div>
<div class="container-fluid">
<div class="row" data-scroll="in">
<div class="col-12 col-xl">
<div class="column-bg-img" style="background-image: url('http://mercury.herodevelopment.com.au/wp-content/uploads/2020/09/Mercury_Residential_Air_Conditioning.jpg');"></div>
<div class="column-overlay block-dark" style="opacity: 90%"> </div>
<div class="column">
<h2 style="text-align: center;">Residential</h2>
<p style="text-align: center;">We’ve been installing, servicing, and repairing air conditioning systems in people’s homes for decades.<br>
Our experience and expertise allows us to offer the ideal air conditioning system for you</p>
</div>
</div>
<div class="col-12 col-xl">
<div class="column-bg-img" style="background-image: url('http://mercury.herodevelopment.com.au/wp-content/uploads/2020/09/Mercury_Commercial_Air_Conditioning.jpg');"></div>
<div class="column-overlay block-dark" style="opacity: 90%"> </div>
<div class="column">
<h2 style="text-align: center;">Commercial</h2>
<p style="text-align: center;">We install air conditioners for commercial and industrial buildings,<br>
and are able to offer systems tailored to the exact needs of your business.</p>
</div>
</div>
</div>
</div>
</div>
Its because the <div> element holding the text don't have z-index property where the <div> element holding background has z-index:0 property. Try adding this css rule.
.column {
position: relative;
z-index: 2;
}
Your problem lies in the
.columns_block .column-bg-img, .columns_block .column-overlay {
height: 100%;
left: 0;
position: absolute;
top: 0;
width: 100%;
z-index: 0;
}
Change your z-index to be z-index:-999;
this should fix your issue.
so the solution to your code is :
.columns_block .column-bg-img, .columns_block .column-overlay {
height: 100%;
left: 0;
position: absolute;
top: 0;
width: 100%;
z-index: -999;
}
Explanation: the default z-index for all elements is 0, if you did not put a z-index for the elements inside your overlay(ed) div, then they will also assume z-index:0 which is what is currently hiding your elements. Either put a higher z-index to your h2 , p tags or reduce the z-index of your background overlay to be in the negative range(-999).
Related
Hello I need to position an image as in the example. Theoretically it looks like it is positioned over 2 seperate boxes with different background colors, that is the goal, but practically it is not possible, at least for me. How to solve the problem?
Usually you'd do this with flex and vertical alignment, but since you want specifically the image to be between boxes i'd say absolute is the way to go here
.card {
display: block;
margin-left: 80px; /* image width + 20px */
}
.header, .image-container {
display: block;
margin: 0;
}
.header h1 {
margin: 0;
}
.image-container {
height: 1px;
position: relative;
}
.image-container .image {
display; inlnie-block;
width: 60px;
height: 60px;
border-radius: 50%;
background: purple;
position: absolute;
top: -50%;
left: -10px;
transform: translateY(-50%) translateX(-100%);
}
<div class="card">
<div class="header">
<h1>Header</h1>
</div>
<div class="image-container">
<div class="image"></div>
</div>
<div class="header">
<h1>Header 2</h1>
</div>
</div>
The simplest solution will be using a combination of an of z-index and position:absolute.
*A small suggestion if you may encounter the problem: you must use z-index with specifying the position (position: static will not work)
img {
width: 100px;
height: 100px;
z-index: 99;
position: absolute;
}
div {
background-color: black;
z-index: 1;
width: 200px;
height: 100px;
position: absolute;
top: 10px;
left: 5px;
}
<img src='https://upload.wikimedia.org/wikipedia/en/thumb/8/80/Wikipedia-logo-v2.svg/1200px-Wikipedia-logo-v2.svg.png'>
<div></div>
I'm trying to have an image with an overlay and some text over it. The overlay I have works fine, but the text is also fading which I don't want. I'd like the text to stay the same. here is some of my code
html:
<div class="hero">
<div class="overlay">
<div class="header">
<h1 class="overlay-text"</h1>
<p class="text-center overlay-text">SOME CONTENT HERE</p>
</div>
</div>
</div>
css:
.hero {
background-image: url('http://localhost:3000/3b1425242c422b429f78f272b0a4c0f7.jpg');
background-size: cover;
position: relative;
display: block;
min-height: 101vh;
color: white;
}
.hero:after {
content: ' ';
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
background-color: rgba(0,0,0,.2);
}
.overlay-text {
z-index: 200;
}
.overlay-text:after {
z-index: 200;
}
.overlay text was just something I tried, it doesn't do anything.
Here is a little example: https://jsfiddle.net/zydkz1ed/1/
You just need to make .overlay-text absolute or relative in order for z-index to works:
.overlay-text {
position: absolute;
z-index: 200;
}
Also the h1 tag wasn't quite right, it should be: <h1 class="overlay-text"></h1>. There was a missing > sign.
so I'm trying to tame the Footer so that it stays below the dynamic content container, but whatever way I try it (Pos: Abs, Bottom: 0; etc etc) it either appears halfway up the content or fixed at the bottom. Either I don't want. It would be appreciated if someone could shine a light on my problem.
HTML:
<div id="Content">
<div id="G6"></div>
<div id="Post-Block">
<div id="block">
<div id="feat-img"></div>
<div id="date"></div>
</div>
</div>
<div id="Footer">
<div id="G7"></div>
<div id="FooterBreak"></div>
<div id="FooterBG"></div>
<div id="FooterLinks">
</div>
<div id="Copyright">
</div>
<div id="Copyright2">
</div>
<div id="FooterBreak2"></div>
</div>
</div>
CSS:
#Footer {
width: 100%;
height: 230px;
position: absolute;
left: 0;
bottom: 0;
}
#Content {
z-index: 7;
background: url(/images/content%20bg.jpg) repeat left top;
position: absolute;
top: 336px;
width: 999px;
height: auto;
color: #fff;
min-height: 950px;
margin: 0 0 230px;
}
html {
position: relative;
height: auto !important;
}
body {
z-index: 0;
background: url(/images/background-texture%20d.jpg);
left: 0;
}
#page {
z-index: 1;
width: 1000px;
height: 1000px;
margin-left: auto;
margin-right: auto;
}
EDIT: When I used the Chrome dev tools to inspect the Crow's Perch website, it looks like your problem is that the height of your HTML is smaller than your content (ie, you use negative bottom values in your absolute positioning for some of your content). Given this, you could add bottom: -865 to #footer, but given that you said your content is dynamic, that's an EXTREMELY brittle solution. Unfortunately, since you're pixel-pushing all of your elements, I don't think there's a way to have your footer respond dynamically to your changing content. More comprehensive refactoring of your code is likely necessary.
Good luck!
Here is my test site http://mint.sbdigi.com/, notice the carousel that it has a white space in between when transitioning. I am not sure why that is happening. Any help please.
Here is a short code that I have:
HTML
<!-- Wrapper for slides -->
<div class="carousel-inner">
<div class="item text-medium active" style="height: 100%;">
<h2>Your Fresh New Family Dentist</h2>
<div class="carousel-overlay"></div><!-- carousel-overlay -->
<div style="background-image:url('http://mint.dev/wp-content/uploads/2015/06/Mint_Dental_sliderimg_02.jpg');" class="fill"></div>
</div>
<div class="item text-medium" style="height: 100%;">
<h2>Bright Smile Package</h2>
<div class="carousel-overlay"></div><!-- carousel-overlay -->
<div style="background-image:url('http://mint.dev/wp-content/uploads/2015/06/Mint_Dental_sliderimg_03.jpg');" class="fill"></div>
</div>
<div class="item text-medium" style="height: 100%;">
<h2>Refresh Package</h2>
<div class="carousel-overlay"></div><!-- carousel-overlay -->
<div style="background-image:url('http://mint.dev/wp-content/uploads/2015/06/Mint_Dental_sliderimg_04.jpg');" class="fill"></div>
</div>
<div class="item text-medium" style="height: 100%;">
<h2>New Patient Combo</h2>
<div class="carousel-overlay"></div><!-- carousel-overlay -->
<div style="background-image:url('http://mint.dev/wp-content/uploads/2015/06/Mint_Dental_sliderimg_05.jpg');" class="fill"></div>
</div>
</div></header>
CSS
header.carousel {
height: 550px;
}
#mint-landingcarousel .carousel-indicators {
z-index: 2;
}
.carousel-indicators {
bottom: 20px;
}
.carousel-inner {
overflow: hidden;
position: relative;
width: 100%;
}
header.carousel {
height: 550px;
}
header.carousel .item {
height: 100%;
}
header.carousel .item.active {
height: 100%;
}
header.carousel .item h2 {
font-size: 90px;
left: 25%;
position: absolute;
text-align: center;
top: 35%;
width: 50%;
z-index: 9999999;
}
header.carousel .carousel-inner {
height: 100%;
}
header.carousel .fill {
background-position: center center;
background-size: cover;
height: 100%;
position: relative;
width: 100%;
z-index: -9999;
}
.carousel-overlay {
background: rgba(0, 0, 0, 0.2) none repeat scroll 0 0;
height: 100%;
position: absolute;
width: 100%;
z-index: 9999;
}
I am not sure if this code is enough. let me know though if you still want of my code. Some of these codes are default in the twitter bootstrap css.
At a first look it seems that:
an .active class is being added on the active image in your carousel.
.active class defines the height for a visible/active item in your carousel.
When .active is not present height is not set so image is not visible.
You should change the behavior of your script, keeping height for visibility of you hidden images otherwise you get the white color your page background.
I hope it helps.
I think you have custom CSS .left{float:left;} and .right{float:right;}
When the carousel slides it adds classes of left and right to the containing div. Remove the left and right floats in CSS.
OR
Add a inline property
<div class="item text-medium" style="height: 100%; float:none;">
It seems there is a "left" class being added to the "active" class through every iteration. I'm not sure if that is the solution but you could research that a bit.
Being that you are only using three images, if you want you could set the background of those images to the same exact image so that through each iteration (when they disappear), there is the same image still in the background. This is not efficient nor is it good for page speed/load, however, but it is a solution nonetheless.
JSFIDDLE demo
HTML
<div class="ratio-1439-330 bg-cover" style="background-image: url('https://www.agtinternational.com/wp-content/uploads/2013/11/City-solution.jpg');">
<div class="l-center" style="max-width: 1240px;">
<div class="square-logo bg-cover"
style="background-image:url('http://www.astronautamarcospontes4077.com.br/wp-content/uploads/2014/07/person-icon.png');">
</div>
<div class="header-cover" style="background-color: #373737; opacity: 0.9; position: absolute; bottom: 0; left:0; width: 100%; overflow: hidden; padding: 10px 0;">
<div class="l-center" style="max-width: 1240px">
<div class="nav nav-tabs" style="margin-left: 338px">
<a class="active" href="#overview" data-toggle="tab">
Overview
</a>
<a href="#visits" data-toggle="tab">
Visit
</a>
</div><!-- ./tab-lined-top-->
</div><!--tabs-->
</div><!--header cover-->
</div>
</div>
<div class="tab-content l-center" style="max-width: 1240px;">
<div id="overview" class="tab-pane active">
<div class="l-center" style="max-width: 1240px;background:red;">
TEST 1
</div>
</div><!--#overview-->
<div id="visits" class="tab-pane">
<div>
TeST 2
</div>
</div>
</div><!--tab-content-->
CSS
[class*="ratio"] {
position: relative; }
[class*="ratio"]:after {
content: '';
display: block; }
[class*="ratio"] .cly-ratio-content {
display: block;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0; }
.ratio-1439-330:after {
padding-top: 22.932592078%; }
.l-center{
margin: 0 auto;
}
.square-logo{
background: #fff;
position: absolute;
width: 180px;
height: 180px;
bottom: 25px;
left: 0;
margin-left: 115px;
z-index: 800;
opacity: 1;
}
.bg-cover{
background-position: center center;
background-repeat: no-repeat;
background-size: cover;
}
.nav-tabs{
border-bottom: 0;
}
.nav{
margin-bottom: 0;
}
Currently it works on jsfiddle, but not on my local machine so you might not understand what I am asking.
Bootstrap is only there for tabs to be clickable. The logo move from left to right when browser is being resized and it looks jumpy while moving. Another issue is that the div with l-center and max-width seems not to be working well for tab pane content. Suspect that it is because of no height.
Is there any way around to force make logo stay vertically lined to tab content and tabs should move as well while browser is resizing?
Help appreciated!
If I understand you correctly, the problem must be that the block of code below has a fixed margin left property value of 115px. So it doesn't actually move on re-size, it just leans on the given margin value. Until there isn't a fixed margin-left, it will keep happening.
.square-logo {
background: #fff;
position: absolute;
width: 180px;
height: 180px;
bottom: 25px;
left: 0;
margin-left: 115px;
z-index: 800;
opacity: 1;
}
Fix I suggest you do something like below
.square-logo{
background: #fff;
position: absolute;
width: 50%; /* Adjust as needed */
height: auto;
bottom: 25px;
left: 25%; /* Adjust as needed */
z-index: 800;
opacity: 1;
}
Note: You may need to adjust the example to suit your need. Just don't use margin-left
First of all please remove the inline css for flexibility. If your html code like this
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="square-logo">
<img src="images/logo.png" alt="Logo">
</div> <!-- End Logo Block -->
</div> <!-- End Column 12 -->
</div> <!-- End row -->
</div> <!-- End Container -->
Then to make your logo center add this css code.
.square-logo {
display: table;
margin: 0 auto;
}