0

I want to create an opening page like shown on the picture. On my body i want to place a picture in the center. But i am not able to center the picture vertically. I don't want to use a fixed height because it need to work on any screen.

<body>
    <div id="picture>
         <a id="link" href="...">Link</a>
    </div>
</body>

enter image description here

2 Answers2

0

can you try this :

<html>
<head>
<style>
#picture{
position:absolute;
width:300px;
height:200px;
z-index:15;
top:50%;
left:50%;
margin:-100px 0 0 -150px;
background:green;
}
</style>
</head>
<body>
<div id="picture">
<a id="link" href="...">Link</a>
</div>
</body>
</html>
0

use this in your picture container

#cont{
    margin:0 auto; 
    text-align:center;
}    
    

#cont div{
   display:inline-block;
}
<div id=cont>
    <a href=http://windesk.com.tr><img class="w3cLogo" src="http://windesk.com.tr/views/web/signum/img/windesk.png"></a>
</div>
do it better
  • 4,627
  • 6
  • 25
  • 41