Background Color is affecting box-shadow - html

So here's my problem: I have a big container div, and a div inside that container. the container has a box-shadow on it that is black. When I set the inner div's background color to black, you can't see the box-shadow. I thought maybe this was an illusion caused by the eye, but taking a closer look you can see the pixel differentiation.
Example image.
Here is a more clear depiction of the problem:
Yet another example image
Raw code incoming!
HTML: (The div#footerContainer part is pretty much the important part)
<div id="bodyContainer">
<div id="menuContainer">
<div id="menuElements" class="center">
<div class="menuElement underlineHover" color="#FF0E0E">Home</div>
<div class="menuElement underlineHover" color="#13DB13">Services</div>
<div class="menuElement underlineHover" color="#1792BB">Photo Gallery</div>
<div class="menuElement underlineHover" color="#E4146B">Why Use Fox Foliage?</div>
<div class="menuElement underlineHover" color="#FF9616">Contact</div>
</div>
</div>
<div id="barSpacer" style="margin: 0 auto 20px"></div>
<div id="imageContainer">
<img src="images/image1.jpg"/>
<div id="title">
<div class="center">
<p class="spaced">Fox Foliage</p>|<p class="spaced">352-949-2481</p></p>
</div>
</div>
</div>
<div id="barSpacer"></div>
<div id="contentContainer">
<?php include("content.php") ?>
</div>
<div id="barSpacer"></div>
<div id="footerContainer">
</div>
CSS (Container DIV):
div#bodyContainer{
max-width: 1000px;
background-color: white;
margin: 0 auto;
box-shadow: 0 0 30px 2px black;
}
CSS (Footer DIV):
div#footerContainer {
height: 40px;
width: 100%;
background-color: black;
color: white;
}
The whole goal is to make sure the box-shadow is the same consistency all the way around.

Related

3 Div boxes do not fit in the container

On the Page: jerkydirect.com/base/opportunity - There are 3 boxes within the container with the picture. However, when viewed on a Large Screen - the last box sticks over the right side.
It looks great in a smaller window or mobile but not on a larger screen.
How do i get this to align correctly?
Here is the code:
<section class="plan-box opportunity">
<div class="container">
<div class="row">
<h2>Choose Your Crave:</h2>
<div class="col-xs-12 col-sm-12 col-md-12">
<center>
<div class="package">
<h3>Twin Pack</h3>
<p>2 BAGS</p>
<ul>
<li><span>Affiliate Price: </span><span>$19.75</span></li>
<li><span>Retail Price:</span><span>$21.75</span></li>
<li><span>Commission Payout:</span><span>$5.00</span></li>
</ul>
</div>
</center>
</div>
<div class="col-xs-12 col-sm-12 col-md-4">
<div class="package">
<h3>family Pack <span></span></h3>
<p>4 BAGS</p>
<ul>
<li><span>Affiliate Price: </span><span>$39.50</span></li>
<li><span>Retail Price:</span><span>$41.50</span></li>
<li><span>Commission Payout:</span><span>$10</span></li>
</ul>
</div>
</div>
<div class="col-xs-12 col-sm-12 col-md-4">
<div class="package">
<h3>Party Pack <span></span></h3>
<p>10 BAGS</p>
<ul>
<li><span>Affiliate Price: </span><span>$79.75</span></li>
<li><span>Retail Price:</span><span>$87.75</span></li>
<li><span>Commission Payout:</span><span>$15</span></li>
</ul>
</div>
</div>
</div>
</div>
</section>
Your HTML code is fine.
Problem lies with your CSS
.package {
width: 350px;
height: 230px;
background-color: rgba(0,0,0,0.6);
border: 15px solid rgba(52,53,48,0.6);
margin: 50px 0 0;
padding: 25px 20px;
}
You shouldn't hard code the width with some pixel value rather remove the pixel value.
Hope this will help you.
Remove the <div class="container"></div> you already have one right after .inner-container.
And Content should be placed within columns, and only columns may be immediate children of rows.
Remove width: 350px from .package div from css.
#service-one .package {
width: auto !important;
}
Or add this style on css files

image between 2 inline-table divs - doesn't work with bootstrap

I'm working on some trading ingame items site, that's not important here.
My actual code is:
<div class="trade">
<h6><strong>RaiZeN</strong> wants to trade: (5 minutes ago)</h6>
<div class="items-holder">
<div class="item-img" style="background-image:url('http://steamcommunity-a.akamaihd.net/economy/image/-9a81dlWLwJ2UUGcVs_nsVtzdOEdtWwKGZZLQHTxDZ7I56KU0Zwwo4NUX4oFJZEHLbXH5ApeO4YmlhxYQknCRvCo04DEVlxkKgpot7HxfDhjxszJemkV08u_mpSOhcjnI7TDglRc7cF4n-T--Y3nj1H6-hBrMW_3LIOWdlU_MlGDqwO6wrvq15C6vp-bnHY36SAm4XbYl0SwhgYMMLJqUag1Og/360fx360f');">
<div class="item-rarity">Field-Tested</div>
<div class="pink"></div>
</div>
<div class="item-img" style="background-image:url('http://steamcommunity-a.akamaihd.net/economy/image/-9a81dlWLwJ2UUGcVs_nsVtzdOEdtWwKGZZLQHTxDZ7I56KU0Zwwo4NUX4oFJZEHLbXH5ApeO4YmlhxYQknCRvCo04DEVlxkKgpot7HxfDhjxszJemkV08u_mpSOhcjnI7TDglRc7cF4n-T--Y3nj1H6-hBrMW_3LIOWdlU_MlGDqwO6wrvq15C6vp-bnHY36SAm4XbYl0SwhgYMMLJqUag1Og/360fx360f');">
<div class="item-rarity">Field-Tested</div>
<div class="pink"></div>
</div>
</div>
<div class="arrow">
<img src="http://i.imgur.com/dusRcnt.png" />
</div>
<div class="items-holder">
<div class="item-img" style="background-image:url('http://steamcommunity-a.akamaihd.net/economy/image/-9a81dlWLwJ2UUGcVs_nsVtzdOEdtWwKGZZLQHTxDZ7I56KU0Zwwo4NUX4oFJZEHLbXH5ApeO4YmlhxYQknCRvCo04DEVlxkKgpot7HxfDhjxszJemkV086jloKOhcj8NrrHj1Rd6dd2j6fA9ImniQex_UQ_NT-nJtKRJgU3aFHY_Vm-ybrqjMO56Z3OnXE27HIq-z-DyAtSAyL7/360fx360f');">
<span class="item-rarity">Battle-Scared</span>
<div class="red"></div>
</div>
</div>
</div>
JSFIDDLE
As you can see, the arrow is not at same height as rest. But, if I will remove bootstrap (remove first html line), it works just fine. Problem is, I need to use bootstrap on my site. How can I fix that?
check this - https://jsfiddle.net/7curr49y/1/
the changes i made are these -
.items-holder
{
background-color: #E7E7E7;
border-radius: 4px;
padding: 10px;
display: inline-block;
border-collapse: separate;
border-spacing: 10px 0px;
vertical-align:middle;
}
changed "inline-table" to "inline-block" and added "vertical-align:middle".
hope that helps!

Remove Container Sides

I'm having problems styling my page and I'm not sure what to do.
The issue I'm running into is that the container class in Bootstrap has a sizable amount of padding on each side, but I can't seem to reliably remove it. I want the red background to be flush against the grey image, and have blue in the background. The only way I've been able to work around this is by using the CSS property background-clip: content-box but then I begin to run into issues when I start adding things like box-shadows.
This is what I have right now:
This is what I want to have:
Here is my code:
<div class="container content-color">
<div class="row">
<div class="col-md-12">
<img class="img-responsive" src="http://placehold.it/1140x360">
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="circle center-block"></div>
</div>
<div class="col-md-4">
<div class="circle center-block"></div>
</div>
<div class="col-md-4">
<div class="circle center-block"></div>
</div>
</div>
</div>
.circle {
background-color: #48c1b0;
height: 150px;
width: 150px;
border-radius: 50%;
}
body {
background-color: blue;
}
.content-color {
background-color: red;
}
}
JS Fiddle: http://jsfiddle.net/rxvk0w2n/
col-* has a default padding of 15px on both, right side and left side.
So, if you want to remove the padding, simply use this in your css:
.removePaddingRightLeft {
padding-right: 0;
padding-left: 0;
}
And your html:
<div class="col-md-12 removePaddingRightLeft">
<img class="img-responsive" src="http://placehold.it/1140x360"/>
</div>
Updated fiddle

Make menu items align the same when adding border on hover

This is my code and I want the alignment to be the same
When I insert a border-left my text goes a bit to the right side but I want all the text to align in the same way.
When I hover it also there the same case.
If I remove the border-left then the text alignment is fine, but how do i get the same alignment when there is border?
<div class="set-leftcol">
<div class="leftcol-box">
<div class="leftcol active">
<div class="sett-i"><i class="fa fa-cog "></i></div>
<div class="sett-title">General</div>
</div>
<div class="leftcol">
<div class="sett-i"><i class="fa fa-key"></i></div>
<div class="sett-title">Security</div>
</div>
</div>
<div class="leftcol-box">
<div class="leftcol">
<div class="sett-i"><i class="fa fa-lock"></i></div>
<div class="sett-title">Privacy</div>
</div>
<div class="leftcol">
<div class="sett-i"><i class="fa fa-cog"></i></div>
<div class="sett-title">Timeline</div>
</div>
<div class="leftcol">
<div class="sett-i"></div>
<div class="sett-title">Blocking</div>
</div>
</div>
<div class="leftcol-box">
<div class="leftcol">
<div class="sett-i"><i class="fa fa-bell"></i></div>
<div class="sett-title">Notification</div>
</div>
<div class="leftcol">
<div class="sett-i"><i class="fa fa-mobile"></i></div>
<div class="sett-title">Mobile</div>
</div>
<div class="leftcol">
<div class="sett-i"><i class="fa fa-rss-square"></i></div>
<div class="sett-title">Followers</div>
</div>
</div>
</div>
http://codepen.io/anon/pen/NqGRqG
change your .leftcol to this :
.leftcol {
float: left;
clear: both;
width: 250px;
cursor: pointer;
background-color: #EBF9FF;
border-left: 4px solid transparent;
}
codepen
The wrong alignment is caused by the :hover state adding a 4px border, so the element is a bit wider when hovered.
One way to prevent that is to add a transparent border to the .leftcol elements, so that when they are hovered only the border color changes but not the width:
.leftcol {
border: 4px solid transparent;
}
Another option would be to use 4px padding on it, and remove that on hover. This is essentially the same trick as above, but uses a padding placeholder for non-hovered elements:
.leftcol {
padding-left: 4px;
}
.leftcol:hover {
padding-left: 0;
}
I don't know if you have intentionally complicated the markup to this extent because you need to do something further with the empty <div>s or have done so accidentally.
In case you didn't have a better way to figure it out, I suggest you take a look at my pen below:
Codepen link to simplify the above markup
I have stripped down your markup to the minimal level and yet achieved the same result you were expecting. Hope it helps you out. Cheers!

Css fix - chart items in a div improper alignment

Code here - http://jsfiddle.net/Cd2Ek/
html -
<div id="main-div" style="height: 250px; margin-left: 10px;">
<div class="sub-div">
<div class="">0%</div> <div class="d1" val="0" style="height: 0%"></div>
<div class=""><small>L1</small></div>
</div>
<div class="sub-div">
<div class="">0%</div> <div class="d1" val="0" style="height: 0%"></div>
<div class=""><small></small></div>
</div>
<div class="sub-div">
<div class="">33%</div> <div class="d1" val="1" style="height: 33%"></div>
<div class=""><small>L3</small></div>
</div>
<div class="sub-div">
<div class="">0%</div> <div class="d1" val="0" style="height: 0%"></div>
<div class=""><small></small></div>
</div>
<div class="sub-div">
<div>67%</div> <div class="d1" val="2" style="height: 67%"></div>
<div class=""><small>L5</small></div>
</div>
</div>
If you see the output in jsfiddle, the bars are going below the main-div. I think you can guess the actual requirement, all bars should be position from bottom, and if the % is 50, then frm bottom, bar should be upto 50% height of the main div, along with label, % indication.
I think this is what you need - fiddle. I've rearranged your code quite a lot to simplify how it works, but basically it uses absolute positioning to get the bars to stick to the bottom. Please let me know if anything is unclear.
Each bar now uses the HTML:
<div class="bar-container">
<div class="bar" style="height:50%">
<span class="percentage">50%</span>
<span class="label">L1</span>
</div>
</div>
Change your css with below one
.sub-div {
margin-right: 6%;
display: inline-block;
height: 250px;
border: 1px solid green;
**vertical-align:top;**
}
Try above code...
CSS
You missed aligning the bars add this line in you .sub-div css class
vertical-align: top;
DEMO