I am not sure how to ask my question. If you go to this site: http://powellgroupconstruction.com/ I am trying to get the bottom of my content class to go over top my footer, like in this example image.
Here is my HTML:
<div class="wrapper">
<div class="content">
</div><!--content-->
</div><!--wrapper-->
<div class="footer">
</div><!--footer-->
and my CSS
.wrapper{
background-color:#FFF;
}
.content{
background-color:#FFF;
width:1027px;
min-height:300px;
margin:0 auto;
box-shadow: 12px 0 15px -4px #888, -12px 0 8px -4px #888;
border-bottom-left-radius:2em;
border-bottom-right-radius:2em;
}
.footer{
background-color:#000;
height:500px;
}
Any help would be much appreciated.
you have to only set the content to position relative and elevate a z-index.
At this point your content are over the footer.
But now to push your footer behind you need to add a margin-top -100px , because the height you have defined in your css.
try this css code. (this work):
.wrapper{
background-color:#FFF;
}
.content{
background-color:#FFF;
width:1027px;
min-height:300px;
margin:0 auto;
box-shadow: 12px 0 15px -4px #888, -12px 0 8px -4px #888;
border-bottom-left-radius:2em;
border-bottom-right-radius:2em;
position:relative;
z-index:999999;
}
.footer{
background-color:#000;
height:500px;
margin-top:-100px
}
You need to adjust the margins... Make the footer have a negative top-margin or the wrapper have a negative bottom margin... Oh, and give the wrapper a slightly elevated z-index...
.footer {
margin-top: -100px;
}
.wrapper {
position: relative;
z-index: 1;
}
OR
.wrapper {
margin-bottom: -100px;
position: relative;
z-index: 1;
}
I personally prefer the first one...
use z-index property higher than the footer
.wrapper{
background-color:#FFF;
}
.content{
z-index:100;
background-color:#FFF;
width:1027px;
min-height:300px;
margin:0 auto;
box-shadow: 12px 0 15px -4px #888, -12px 0 8px -4px #888;
border-bottom-left-radius:2em;
border-bottom-right-radius:2em;
margin-bottom: -100px;
}
.footer{
z-index:1;
background-color:#000;
height:500px;
}
.wrapper,.footer,.content{
position:relative;
}
Also set position as relative to work the z-index property.For more detail and example visit css-tricks.com.Also set margin-bottom as negative value to overflow above the footer
You can achieve the result by using z-index property and saying position : absolute in div
.content{
z-index:1000;
position : absolute
.........
}
.footer
{
z-index:0;
position : absolute
}
The problem you have is the wrapper has a background-color. z-index only works with siblings, so you can do this: remove background-color: #fff; from .wrapper (otherwise the .wrapper color will block the footer from showing where it overlaps), or move .footer inside of .wrapper. Then add the following:
.footer {
position: absolute;
top: 250px;
z-index: -1;
width: 100%;
}
Here's a working Demo
Just use the following css rules
.content {
background-color: #FFFFFF;
border-bottom-left-radius: 2em;
border-bottom-right-radius: 2em;
bottom: -90px;
box-shadow: 12px 0 15px -4px #888888, -12px 0 8px -4px #888888;
margin: 0 auto;
min-height: 300px;
position: relative;
width: 1027px;
height: 570px;
z-index: 1000;
}
.footer {
background-color: #000000;
height: 500px;
margin: 0 auto;
position: relative;
}
Related
I need to remove box-shadow just under the transparent png. Now you can see box shadow under that transparent half circle. Can I do it somehow?
Here is demo.
Problematic part is under the logo.
header {
border-bottom: none;
height: 50px;
padding: 20px 0 20px 0;
background: rgba(255,255,255,0.9);
z-index: 10 !important;
-webkit-box-shadow: 0px 0px 6px 5px rgba(0,0,0,0.22);
box-shadow: 0px 0px 6px 5px rgba(0,0,0,0.22);
position: fixed;
top: 0px;
width: 1000px;
margin:0 auto 0 auto;
left:0px
}
<html>
<header>
<img src="https://png.pngtree.com/element_our/sm/20180518/sm_5aff6089d3e02.png" style="height:80px;margin-left:200px">
<img src="http://vitezslavlorenc.cz/obloucek2.png" style="width: 51px;
height: 8px;
/* position: relative; */
bottom: -8px;
position: absolute;
left: 215px;">
</header>
<div style="height:1000px; width: 1000px;
;
position:relative;">
<img src="https://wpshindig.com/content/uploads/2018/02/Feature-Header-Image.png" style="position:absolute;top:0px;width:1000px;z-index:-1" >
</div>
https://codepen.io/korwinus/pen/bZJOgM
Have a look at this codepen link
https://codepen.io/hoonin/pen/OqYVRr
While you can't "hide" the box-shadow in just that portion you can make the image have a higher z-index value than the element with the box shadow. This means it will appear "above" it. Adding a background-color and some bottom padding to the image creates the illusion that the box-shadow disapears in that area.
Here is the code for the class I made for the image (removed the inline styles to):
.ig-logo {
background-color:#fff;
border-radius:50%;
z-index:9999;
height:80px;
margin-left:200px;
padding-bottom:5px;
}
I'm having trouble getting my image to be responsive. It's a image that sits above another image, so I used absolute positioning. If I make the page smaller, everything gets all out of whack.
This is my css for the image that sits above the other image.
.page-header .logo img {
position: absolute;
top: 240%;
left: 126%;
width: 200px;
height: 150px;
padding:1px;
border:1px solid #021a40;
background-color:#000;
margin-top: -250px; /* Half the height */
margin-left: -250px; /* Half the width */
}
And this is the css for the image behind it.
.page .carousel img {
-webkit-border-radius: 4px 4px 0 0;
-moz-border-radius: 4px 4px 0 0;
border-radius: 4px 4px 0 0;
}
How can I make the above image to resize properly with the image behind it?
Here's a little fiddle I put together to get you closer. Depending on the size of the logo, you'll have to adjust the percentages a little bit to get what you want.
HTML
<div class='page-header'>
<div class='carousel' id='portfolio-carousel'>
<img alt="1396051485478" src="http://www.placehold.it/650x350" class="bg" />
</div>
<div class="logo-wrap">
<img alt="Logo" src="http://www.placehold.it/250x150" class="logo" />
</div>
</div>
CSS
.page-header {
position:relative;
width:100%;
}
.logo-wrap {
width:100%;
position:absolute;
margin-top:-43%;
}
.logo {
position: absolute;
padding:1px;
border:1px solid #021a40;
background-color:#000;
top:22%;
left:25%;
width:50%;
}
.carousel {
position:relative;
width:100%;
}
.bg {
-webkit-border-radius: 4px 4px 0 0;
-moz-border-radius: 4px 4px 0 0;
border-radius: 4px 4px 0 0;
width:100%;
}
Fiddle
http://jsfiddle.net/disinfor/9b332ghd/4/
I believe this will get you what you are looking for. Also, I may have changed some of your class names while I was troubleshooting it for you.
I am having an issue where I have three divs within a parent div which need to be center aligned. I do not understand why the center alignment of the text isn't doing it's usual magic?
I have recreated the issue here Demo fiddle
<div class="container_alt">
<div class="pricing_options_col">
<div class="pck1">pck1</div>
<div class="pck2">pck2</div>
<div class="pck3">pck3</div>
</div>
</div>
.container_alt{
max-width: 1000px;
margin: 0 auto;
}
.pricing_options{
width: 100%;
background-color: #fff;
height: auto;
overflow:auto;
text-align:center;
display:inline-block;
}
.pricing_options_col{
width: 100%;
max-width:1000px;
margin: 0 auto;
text-align:center;
padding:100px 0;
display:inline-block;
}
.pck1{
float: left;
margin: 0 auto;
width: 200px;
background-color: green;
border-radius: 6px;
box-sizing:border-box;
padding: 20px;
}
.pck2{
float: left;
margin: 0 auto;
width: 400px;
background-color: red;
border-radius: 6px;
box-sizing:border-box;
padding: 20px;
-webkit-box-shadow: 0px 0px 20px 0px rgba(50, 50, 50, 0.75);
-moz-box-shadow: 0px 0px 20px 0px rgba(50, 50, 50, 0.75);
box-shadow: 0px 0px 20px 0px rgba(50, 50, 50, 0.75);
z-index: 999999;
}
.pck3{
float: left;
margin: 0 auto;
width: 200px;
background-color: pink;
border-radius: 6px;
box-sizing:border-box;
padding: 20px;
}
remove float: left; from the css for .pck1 .pck2 .pck3
update: i guess this is what you are looking for:
.pricing_options_col{
width: 800px;
margin-left:auto;
margin-right:auto;
max-width:1000px;
margin: 0 auto;
text-align:center;
padding:100px 0;
display:inline-block;
}
For .pck1, pck2 and pck3, remove float:left and add display:inline-block.
Floating an element is used to move it all the way to one side or the other (which obviously does the opposite of cetering). Preventing the "stacking" is a by-product of that, but there are other ways to keep elements from stacking. By default, divs have display:block, which means they'll each display on their own line ("stacking"). By changing it to display:inline-block, they display in-line.
Here is a demo.
Try this. This is because your parent and child both holds the width of 100%
.pricing_options_col{
width: 100%; <-- Remove
max-width:1000px;
margin: 0 auto;
text-align:center;
padding:100px 0;
display:inline-block;
}
DEMO
I have a basic HTML page where everything is wrapped inside a mainWrapper div and secondWrapper div.
everything is set to 960px size (the pageHeader, the pageContent and pageFooter).
I need to keep everything 960px apart from the pageFooter.
This is my CSS code:
<style type="text/css">
<!--
body {
}
#secondWrapper {
margin-left:auto;
margin-right:auto;
width:960px;
min-width:910px;
}
#mainWrapper{
margin-left:auto;
margin-right:auto;
width:960px;
}
#pageHeader {
height:80px;
width:100%;
min-width: 918px;
border-bottom: solid 1px #ededed;
z-index:1000;
position:relative;
}
#pageContent {
clear:both;
width:100%;
min-width: 918px;
background-image:url(img/map.png);
height:600px;
background-repeat:no-repeat;
background-position:center;
box-shadow: 6px 0px 5px -5px #999, -6px 0px 5px -5px #999;
z-index:1;
}
#pageFooter {
background-color:#CCC;
width:100%;
min-width: 918px;
}
#logo{
position: absolute;
margin-left:29px;
background-color:#cb202d;
width:120px;
height:110px;
top: 0;
text-align:center;
vertical-align:center;
display:block;
font-family:Tahoma, Geneva, sans-serif;
font-size:24px;
color:#FFF;
font-weight:bold;
float:left;
z-index:1000;
-webkit-box-shadow: 0 5px 6px -6px grey;
-moz-box-shadow: 0 5px 6px -6px grey;
box-shadow: 0 5px 6px -6px grey;
}
#logoTxt{
position: relative;
top:26%;
}
#yourCurrentTime{
float:left;
left:220px;
top:10%;
position:relative;
border: 10px solid #1abc9c;
border-radius:4px;
}
#arrow-down {
position:absolute;
width: -23px;
height: 2px;
border-left: 5px solid transparent;
border-right: 5px solid transparent;
border-top: 5px solid #1abc9c;
left: 99px;
top: 30px;
}
#b {
position:absolute;
width:200px;
height:115px;
z-index:10000000;
left: -59px;
top: 48px;
background-color:#333;
display:none;
}
div#a:hover div#b {
display: inline;
}
div#a:hover {
background-color:#eceded;
cursor:pointer;
}
div#divBtn:hover {
background-color:#4a4a52;
cursor:pointer;
}
div#a{
width:140px;
height:47px;
position:absolute;
left: 825px;
top: 0px;
}
-->
</style>
I did try a few solutions found on Google and stackoverflow like this:
html,
body {
margin:0;
padding:0;
height:100%;
}
but that didn't work for me!
Any help would be appreciated.
Here is the Jsfiddle: http://jsfiddle.net/crf121359/jwgfH/
You need to do it like this:
HTML
<div class="wrap">
<div class="wrap_inner>
<!-- Pwraput here your pageHeader and pageContent -->
</div>
</div>
<footer>
</footer>
CSS
.wrap {
position: relative;
min-height: 100%;
padding-bottom: 200px /*footer height*/
}
.wrap_inner {
width: 960px;
margin: 0 auto;
}
footer {
width: 100%;
height: 200px;
position: absolute;
left: 0;
bottom: 0;
}
You just need to take your pageFooter outside of the wrapper.
Here's a working example:
http://jsfiddle.net/jwgfH/3/
You should see how it looks here, not inside the little frame:
http://jsfiddle.net/jwgfH/3/show
width: 100%;
only works if the parent element has a width defined.
Try giving your body element a max-width and see if that works
can you show your html too ? if the parent div or container is having 100% width then it should show the perfect result.
If you want to create a webpage that's 960px wide, define it in your <body> tag's by placing width:960px; in the CSS.
Then, use width:100%; in the rest of your elements - only for those that you want to display as 960px. The rest can be divided by using width:50%;, width:25%;, which is 50% of 960px and 25% of 960px respectively.
Also, height:100% is negligible, the rest of the elements will automatically define the height of the webpage, as long as you place them correctly.
In short, do this:
body {
width:960px;
margin:0 auto;
}
#secondWrapper {
width:100%;
float:left;
}
...and so on and so forth.
(NOTE: To solve your positioning problem, float:left is probably the best way to go. Use it on most of the elements you need to position accurately. If not, the browser will estimate where it will go.)
AFTER EDIT:
If you want a 960px gap between the #pageContent and #pageFooter, you can always define a margin-top like this:
#pageFooter {
margin-top:960px;
}
im using this css code:
/* status update page style */
#content_wrapper {
display: inline;
width: 80%;
padding: 0;
margin: 0 auto;
}
#content_update {
display: block;
float: left;
padding: 20px;
margin-top:20px;
width: 100%;
background-color: #eee;
border-radius: 10px;
box-shadow: 0 1px 6px rgba(0,0,0,0.5);
}
#content_maintainance {
display: block;
float: left;
padding: 20px;
margin-top:20px;
width: 100%;
background-color: #eee;
border-radius: 10px;
box-shadow: 0 1px 6px rgba(0,0,0,0.5);
}
#content_sidebar {
display: block;
float: right;
width: 230px;
padding: 20px;
background-color: #eee;
border-radius: 10px;
box-shadow: 0 1px 6px rgba(0,0,0,0.5);
}
/* FOOTER */
#footer {
width:100%;
height:580px;
position:absolute;
bottom:0;
left:0;
border-top:4px solid #ed1c24;
background-color:#eeeeee;
}
#footer-inner {
width:80%;
margin:0 auto 0 auto;
height:inherit;
}
#footerTop {
width:100%;
height:480px;
padding-top:10px;
border-bottom:2px #000000 solid;
}
#footerTopLeft {
width:30%;
height:420px;
float:left;
display:inline;
margin-top:10px;
padding:0 15px 10px 15px;
border-right:1px solid #000000;
}
#footerTopMid {
width:30%;
height:420px;
float:left;
display:inline;
margin-top:10px;
padding:0 15px 10px 15px;
border-right:1px solid #000000;
}
#footerTopRight {
width:30%;
height:420px;
float:left;
display:inline;
padding:0 15px 10px 15px;
}
but the divs are displaying behind the footer divs. i have created a fiddle here so you can see the html too - http://jsfiddle.net/wmrhC/
It's because you have set the footer div to be absolutely positioned at the bottom of the browser window with a height of 580px. This takes the div out of the regular document flow, which means other elements can start hiding behind it, and since it is 580px high, most other elements on the page will hide behind it. You could fix this by setting the z-index on the footer to -1, but that's probably not what you are after, as it would just mean that the div's will start floating over the top of the footer instead of behind the footer, and that still doesn't look pretty.
You should get rid of the absolute positioning which you have set currently, and maybe look at something like CSS sticky footer for an approach which will let you set a footer which sticks to the bottom of the page instead of to the bottom of the browser window.
When working with position: absolute or fixed you should always be aware that these elements can cover other parts of your site, and you have to manage their depth manually
You can do this using the z-index property.
Let's say that you would like that the footer part appears below all contents.
You could add the z-index property like this:
#footer {
/* other styles */
z-index: -1;
}
See it in action
Though note, that this only fixes the "content is displayed behind" problem. But looking at your page you have more positioning problems to solve.
As stated in other answers, it's because you've positioned your footer div to be fixed.
Something along this line (regarding HTML and CSS) should help for your page lay-out:
JSFiddle demo
This is the CSS (see the JS Fiddle for the full code):
...
.wrapper {
position: relative;
float: left;
left: 5.00%;
width: 90.00%;
background-color: #cccccc
}
.left1 {
position: relative;
float: left;
left: 0.50%;
width: 32.00%;
background-color: #ccccff
}
.left2 {
position: relative;
float: left;
left: 1.50%;
width: 32.00%;
background-color: #ccccff
}
.right {
position: relative;
float: right;
right: 0.50%;
width: 32.00%;
background-color: #ccccff
}
.footer {
position: relative;
float: left;
left: 5.00%;
width: 90.00%;
margin: 10px 0px;
background-color: #cfcfcf
}
...
As you can see, none of these items are positioned absolute or fixed.
Be sure to check this link too, which explains how you can create a sticky footer:
CSS Sticky footer (As indicated by another answer).