I have the following code
<html> <head> <title>Test</title> <style type='text/css'> <!-- body,td,th { color: #FFFFFF; } body { background-color: #000000; } #Pictures { position:absolute; width:591px; height:214px; z-index:1; left: 17%; top: 30%; text-align:center; } #Links { width:600px; height:30px; z-index:2; top: 184px; font-family: 'Broadway', Broadway, monospace; font-size: 14px; color: #FFFFFF; text-align: center; } .links2 { font-family: Broadway; color: #FFFFFF; text-decoration: none; } a:links2, a:visited { color: #ffffff; } a:hover, a:active { color: #333333; } #Main { position:absolute; width:800px; height:600px; z-index:2; left: 15%; top: 10%; right: 15%; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; } #Logo { position:absolute; float: left; width:104px; height:100px; z-index:2; } </style> </head> <body> <div id='Main'> <div id='Pictures'> <div> <a href='1.html' ><img src='1.gif' alt='x' width='181' height='173' border='0' /></a> <a href='1.html' class='links2'>1</a> </div> <div> <a href='2.html' class='links2'><img src='2.gif' alt='x' width='181' height='173' border='0' align='top' /></a> <a href='2.html' class='links2'>2</a> </div> <div> <a href='3.html' class='links2'><img src='3.gif' alt='3' width='181' height='173' border='0' /></a> <a href='3.html' class='links2'>3</a> </div> </div> </div> <div id='Logo'><img src='logo.gif' alt='x' width='104' height='100' border='0'/></div> </div> </body> </html>
Which is displaying the picture layers vertically.
I am trying to make it o the 3 images are aligned horizontally with the text centered underneath them. Why are they defaulting to vertical, and can I change this behavior?
I think a
display: block;on yourlinks2class should put the links under the images correctly.Also, to get the images to line up horizontally, use
<span>s instead of<div>s inside the ‘Pictures’ div, and float them left.