Make a div area transparent, other than the area where images is? - css

I have a Div with 2-3 icons in it. The icons are horizontally aligned on top of a big image div.
I want bottom image to be visible in padding area between icons. Which property can help me to achieve this functionality ? Any pointers ??

Style your div with something like this:
background: transparent, ...your other images...;
That assumes your icons are shown as background-images, if not, just specify background: transparent; to your div.

Related

CSS Background Image Property Values Explained

Can someone explain what "bottom center scroll" means in the below style
background: #f5f5f5 url('/img/bg.jpg') no-repeat bottom center scroll;
It's used here http://startbootstrap.com/templates/grayscale/ to fill the background. If I remove "bottom center scroll" the image will not scale with reduced browser size. I'd love to understand what exactly the value is doing and why it is important to how the image scales
You can find below some info about that..
Position : Specifies the position of the background images.
Repeat :Specifies how to repeat the background images.
Attachment : The background-attachment property sets whether a background image is fixed or scrolls with the rest of the page.
Ref for more details : http://www.w3schools.com/css/css_background.asp
The background bottom centre property specifies the positioning area of the background images.
The background image can be placed within the content-box, padding-box, or border-box area.

Html/CSS Disappearing div background

Few days ago i've noticed, that if a website have a background and if you overlap transparent PNG image on the div, the divs background disappears... Maybe it's only my computer rendering glitch, so I'll attach Screenshot too.
JSbin for index and css
Try:
body{
background:url('image') no-repeat top left;
}
You should not use 'background' in HTML tag!!!!!
html{
background:url('image') no-repeat top left;
}
Are you sure you don't have two images on top of each other? it seems like you have a colour image with a grey-scale image underneath.
If so, remove the bottom image.
EDIT: sorry, it seems to be an image change problem when you hover. Look at changing what the image switches to

Apply a border to background image

I have some divs, and they have their backgrounds set as images using this:
background:url(myimage.jpg);
Now what I'm looking to do is set a border on that image that is set to the background.
I don't want to set a border on the div as this does not give the desired result, it must be a border on the image.
Not sure if this is possible, is it?
You could try using multiple backgrounds, by setting your base bg image and a second one as a border.
#container {
background-image: url(Main-bg), url(Border-img.png);
background-position: center center, left bottom; /* border bottom in this case */
background-repeat: no-repeat;
}
It is not possible to do it precisely as you've mentioned. Since the background image is styling, rather than content, no additional styling can be added to it.
The best option would be to create a different image file to serve the bolder border.

What's wrong with my menu background image?

The web site is here.
See that blue bar behind the menu items? It's 40 pixels high and one pixel wide, and used as a repeating background - so, why does it look strange after the right-most menu item?
The image is here, if anyone needs it.
The image is used thusly:
.menu_bar
{
background-image: url("http://leonixsolutions.com/images/menu_background.jpg");
background-repeat: repeat-x;
font-size: large;
padding-left: 160px;
padding-top: 5px;
text-align: center;
}
Nothing is wrong with it,
Your menu container div.pd_menu_01 has a background color #ffffff remove it and you'll be fine...
The real problem here is that .pd_menu_01 extends too far to the right (and with its white background, covers the gradient). Try making it inline-block with an auto width, or something similar, so that it doesn't extend further to the right than it has to. You could also set its background color to transparent (but in my browser, .pd_menu_01 makes the page too wide and thus introduces unnecessary and ugly horizontal scrollbars, so the width solution is still relevant).
.pd_menu_01 has a background color of white declared, and is a div. Since divs are block level elements, they have a default width of 100%.
Either declare the div to be display:inline, wrap the menu in a span instead of a div, or make the background color transparent instead of white.

ie6 float causes background image to dissapear

I have a div with a background image which is aligned bottom right. Then I have another div floated inside that div to the left and to the bottom. In IE6, it looks like the bottom inner div is overlapping and cutting out the middle of the background image which is set to bottom left.
Any ideas what might cause this? Is there a known issue with floats and background images?
Thanks
The solution was to add the CSS property Zoom:1; on the div with the background image. This sorts it out in IE6.

Resources