How to set z-index in css background
Tags: html,css
Problem :
I have two backgrounds (calling from css), but first background is on full screen width and second is under it (is hidden). So I would like to set z-index, if it is possible. Do you know how to solve this problem? Thank you.
code
background-image:url("/images/background.png"), url("/images/fp_images/bg_image.png")
Solution :
You can't do what you want to do as you want to do it. css rules (z-index
and background-image
) are applied to the item. You can't say x rule applies to y rule, that's not how CSS works.
the only solution you have is to have two items with different background-image
and then apply the z-index
to these.
HTML
<div id="one"></div>
<div id="two"></div>
CSS
/*on top*/
#one{
background-image:url("/images/background.png");
z-index:10;
}
/*underneath*/
#two{
url("/images/fp_images/bg_image.png");
z-index:5;
}
You'll have to make the items sit underneath each other too, likely using float's but this will depend on your overall design.
CSS Howto..
You can do it as follows <table align="center" width="1200" height="370" cellpadding="7"> <tr> <th class="t_head">ID</th> <th class="t_head">NAME</th> <th class="t_head">SEX</th> <th class="t_head">COUNTRY</th> <th class="t_head">AGE</th> <th...
There's a jQuery plugin for that. http://jquery.malsup.com/corner/
If you're using an AdBlocker extension, try disable. The background can't shown for me, when the adblocker was active. Because these extensions are hide the banner and similar named selectors...
You have both width and padding set, so give box-sizing: a { text-decoration: none; font-size: 11px; font-weight: 100; width: 100%; box-sizing: border-box; } ...
You can use @media queries in CSS to make your website scalable and responsive. The are a lot of ways to use media queries, but I like to use them...
Take a look at these examples.. Masonry-style Layout ONLY with CSS Applied to your Bootstrap list-group it would look something like this.. http://bootply.com/85737 However, you need to remove the Bootstrap...
Use a div with overflow set to hidden, and a div inside of it absolutely positioned with a fixed height. #outer { height: 100px; overflow: hidden; position: relative; width: 200px;...
It seems most others have not quite understood the gist of your post. I'll break it down for you: CSS positiong is complex because it was designed by many different...
If this is an issue of specificity, you could be more specific and use something like this: form .form-group .form-error { border: 2px solid red; } jsFiddle example Remember, stylesheets...
Add 'float: left' to the first, and remove 'clear: both' from the second, a la http://jsfiddle.net/L2JgX/3/
Unquestionably you would use a class for this: <div id="Card0" class="card"> <div draggable="true" id="carte0"> <div id="no">8</div> <div id="Trefle"></div> </div> </div> <div id="Card1" class="card"> <div draggable="true" id="carte1"> <div...
Everything seems to look fine to me - assuming that I understand you correctly. Edit : Sorry - I am sure you looking for an alternatives. These might help Pure...
I create this: html <h1 class="ribbon"> <strong class="ribbon-content">CAPTURE|WEDDING PHOTOGRAPHY</strong> </h1> css .ribbon { font-size: 16px !important; /* This ribbon is based on a 16px font side and a 24px vertical...
Add this to your CSS file: .ui-layout-pane-east { padding: 0 !important; } Don't do this from the browser's inspector. jQuery UI's inner workings are supposed to calculate widths on page...
Based on the posted HTML I'd suggest following changes: The inner classes apl_widget_label and apl_widget_value are unnecessary and can simply replaced with unique elements (that is unique within the li)....
Try deleting the height property of the header and give it a padding-bottom of about say 15px for the shadow. That should do the trick.
Two Issues with Your Code First, the two images must be called within a single background-image call, otherwise the way the "cascading" part of CSS works the second one will...
You can't use HTML in prompt/alert dialogs. However you can use new line characters: prompt ("Convert Pound to Kilogram!\n Please insert your number of pound!"); ...
You can try to put a value of z-index combined with a defined position (could be fixed, absolute, relative .. ) which is higher than the default z-index value of...
So I am not very familiar with css, but you have some arguments missing from your div element for it to work. <div class="bar" style="height: <?php echo $currentHeight . "px;";...
I have put the #postcode-no element inside the bootstrap col- element to make sure it stays inside that div. If this doesn't work. Can you inspect your #postcode-no element and...
You can absolutely position a link over the <input> and then apply a text-indent to the <input> to make room for the image. For example: <div id="outer"> <a href="javascript:void(0)" onclick="alert('click')"><img...
Use the jQuery-Selectbox plugin. You can transform normal <select> elements into nice styleable HTML ones. Link to the JS file: <script src="jquery.selectbox.min.js" type="text/javascript"></script> Add the CSS file (or append contents...
Here's a way to do it without adding any additional markup, though you do need to add unique classes to each of the anchor links. CSS: .navbar-default .navbar-nav>.active>a:before, .navbar-nav>li>a:before {...
Check here! Basically you can create a transparent round shape with a big white (or black) border! background: transparent; border-radius: 50%; border: 1000px solid rgba(0, 0, 0, 0.5); JSFiddle...
For Links If you actually mean the background on the links themselves, then apply a css class name to each link and style them individually. For example: <ul> <li class="homeLink"><a...
You don't need to worry about the HTML entities nor any complex string replacing. All you need is a little CSS: #target { white-space: pre; } and use the .text()...
In the same way you can do this .class.class2.class3 { /*styles*/ } to target only things that have all 3 classes, you can can combine attribute selectors to do the...
You are using the following to show the items: $('.hover-name').show(); What this does is find everything within the doucment that has a class of .hover-name and does the show() function...
The media query should work (I ghess), but as the imgs have fixed width, they're just overflowing. You should use percentual width for the imgs as well. Remember that if...