• Welcome, guest!
Reply to Thread
Results 1 to 4 of 4
 
  1. #1
    Junior Member superfly is on a distinguished road superfly's Avatar
    Join Date
    May 2010
    Posts
    7
    Itrader:
    0

    Default Overlay not showing in CSS

    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>
    The two colors should overlay. instead it is showing one and second in series, but it doesn't.

  2. #2
    Junior Member Yakoob is on a distinguished road
    Join Date
    Jul 2010
    Posts
    1
    Itrader:
    0

    Default Re: Overlay not showing in CSS

    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>
    If I understand what u want to display i would do it like this, by manipulation of top, left tag.

  3. #3
    Junior Member Graeme is on a distinguished road Graeme's Avatar
    Join Date
    Aug 2010
    Location
    Netherlands
    Posts
    3
    Itrader:
    0

    Default 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.

  4. #4
    Junior Member superfly is on a distinguished road superfly's Avatar
    Join Date
    May 2010
    Posts
    7
    Itrader:
    0

    Default 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)

     

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts