Reply to Thread
Results 1 to 4 of 4
Thread: Overlay not showing in CSS
-
07-16-2010 12:29 AM #1
Overlay not showing in CSS
The two colors should overlay. instead it is showing one and second in series, but it doesn't.Code:<html> <title> css and html </title> <body> <div style=" background-color:red; height:100px;width:100px;postion:relative; top:10px; left:80px; z-index:1;"> </div> <div style="background-color:yellow; height:100px; width:100px; postion:relative; top:30px;left:35px; z-index:2;"> </div> </body> </html>
-
07-16-2010 06:15 PM #2Junior Member
- Join Date
- Jul 2010
- Posts
- 1
- Itrader:
- 0
Re: Overlay not showing in CSS
If I understand what u want to display i would do it like this, by manipulation of top, left tag.Code:<html> <head> <title>css and html </title> </head> <body> <div style="position: relative; background-color: yellow; height: 100px; width: 100px; top: 180px; left: 50px; z-index: 2;"> </div> <div style="position: relative; background-color: red; height: 100px; width: 100px; top: 0px; left: 0px; z-index: 1;"> </div> </body> </html>
-
08-05-2010 10:24 AM #3
Re: Overlay not showing in CSS
@Jakoob: that does not resolve the issue.
The problem persisted because you didn't use valid hex values for the 'background-color' properties, nor did you add a display:block;. Try changing your code to this, and adjust the left and top attributes accordingly.
HTML Code:<html> <head> <title> css and html </title> </head> <body> <div style="background-color:#FFFF00;width:100px;height:100px;position:relative;top:10px;left:25px;display:block;"></div> <div style="background-color:#cd0000;width:100px;height:100px;position:relative;top:-10px;left:0px;z-index:1;display:block;"></div> </body> </html>
Last edited by Graeme; 08-05-2010 at 10:27 AM.
-
08-05-2010 04:43 PM #4
Re: Overlay not showing in CSS
Already fixed but thanks for clarifying that Graeme!
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
LinkBack URL
About LinkBacks


Reply With Quote