1. #1
    Ultimus's Avatar
    Registered
    27/04/06
    Location
    Lier
    Posts
    125
    iTrader
    0
    Mentioned
    0 Post(s)
    Reputation
    1/1

    Layers (z-index)

    hoi iederen,

    kan iemand mij helpen? ik zit met een probleem. Ik wil als basis voor een website twee layers op elkaar leggen. Echter lukt me dit niet in de simpelste vorm iemand wat tips?

    Code:
    @charset "utf-8";
    /* CSS Document */
    
    #layer1{
    	position:relative;
    	z-index:1;
    	border:5px solid red;
    	height:100px;
    	width: 100px;
    }
    
    #layer2{
    	position:relative;
    	z-index:2;
    	border:5px dashed black;
    	height:100px;
    	width:100px;
    }
    HTML Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    <link href="test.css" rel="stylesheet" type="text/css" />
    </head>
    
    <body>
    <div id='layer1'>layer1</div>
    <div id='layer2'>layer2</div>
    </body>
    </html>
    Dit is waarschijnlijk onsterfelijk simpel maar het lukt me niet

    thx!

    groetjes
    <----Death is just an other path in life, one that we all must take---->
    no votes   Reply With Quote Reply With Quote

  2. #2
    janlaureys9's Avatar
    Registered
    30/11/03
    Location
    Antwerpen
    Posts
    1,647
    iTrader
    0
    Mentioned
    0 Post(s)
    Reputation
    0/9
    Nu zelf nog niet echt met z-index enzo moeten werken maar volgens mij gaan deze twee divs gewoon onder elkaar komen te staan. Je bepaalt niet echt een positie he.
    En dan maakt het ook helemaal niet meer uit dat die ene nou "elmer" heet...
    ALT + 84; ALT + 104; ALT + 101; ALT + 32; ALT + 71; ALT + 97; ALT + 109; ALT + 101
    no votes   Reply With Quote Reply With Quote

  3. #3
    Ultimus's Avatar
    Registered
    27/04/06
    Location
    Lier
    Posts
    125
    iTrader
    0
    Mentioned
    0 Post(s)
    Reputation
    1/1
    Code:
    #layer1{
    	position:relative;
    	z-index:1;
    	border:5px solid red;
    	height:100px;
    	width: 100px;
    	top:-50;
    	left:5;
    }
    
    #layer2{
    	position:relative;
    	z-index:2;
    	border:5px dashed black;
    	height:100px;
    	width:100px;
    	top:-30;
    	left:10;
    }
    heb eens willekeurig wat toegevoegd maar zonder verschil
    <----Death is just an other path in life, one that we all must take---->
    no votes   Reply With Quote Reply With Quote

  4. #4

    Registered
    21/04/09
    Location
    zwevegem
    Posts
    367
    iTrader
    7 (89%)
    Mentioned
    0 Post(s)
    Reputation
    0/2
    zet beide eens op position: absolute
    en top, left:0

    is maar wilde gok ze
    no votes   Reply With Quote Reply With Quote

  5. #5
    profound's Avatar
    Registered
    13/12/08
    Location
    Dendermonde
    Posts
    3,899
    iTrader
    5 (100%)
    Mentioned
    0 Post(s)
    Gewoon je position op absolute zetten, zal de 2 layers idd over elkaar zetten.
    Z-index is hier zelfs niet nodig.
    no votes   Reply With Quote Reply With Quote

  6. #6
    Ultimus's Avatar
    Registered
    27/04/06
    Location
    Lier
    Posts
    125
    iTrader
    0
    Mentioned
    0 Post(s)
    Reputation
    1/1
    geweldig het is gelukt.

    dankzij jullie ben ik Hier al geraakt. Als eerste keer met CSS en dergerlijken vind ik dit al best ok. Jullie reacties zijn welkom natuurlijk, elke tip is handig

    ik heb wel gezien dat ik dringend die oude sites eens moet updaten naar een deftige css layout

    groetjes
    Last edited by Ultimus; 13-01-2010 at 09:50.
    <----Death is just an other path in life, one that we all must take---->
    no votes   Reply With Quote Reply With Quote

Posting Permissions

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

Log in

Log in