Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to put a Div on another Div with transparent background? [duplicate]

Tags:

html

css

I want to put a div(1) with transparent background on the top of another Div(2). Because I want to make all the element that div(2) contains disable. so, If i will put div(1) on top of div(2) then elements that are inside the div(2) will not be clicker anymore.

like image 359
Mahesh Thumar Avatar asked Sep 10 '11 19:09

Mahesh Thumar


2 Answers

make use of Z-index property thats it.

//inner div 
    .div1
    {
     z-index : 1;
    }

//outer div

    .div2
    {
     z-index : 10;
    }

div2 over lay div1.

Also check existing question answer : How to overlay one div over another div

like image 62
Pranay Rana Avatar answered Oct 04 '22 04:10

Pranay Rana


Use z-index for both div DIV

http://www.w3schools.com/cssref/pr_pos_z-index.asp

use

opacity:0.5

for the DIV 1. unfortunately all IE couldn't support opacity

like image 20
Mo. Avatar answered Oct 04 '22 04:10

Mo.