...

View Full Version : alignment of inlin-block box



joonstar
08-15-2005, 05:37 PM
<style>

a.box{
display:inline-block;
border: 1px solid #000;
padding:15px;
float:left;
}

.center {text-align: center;}
.right {text-align: right;}

</style>

<table>
<tr>
<td width='200' bgcolor='pink'><a href='' class='box center'>box</a></td>
<td width='200' bgcolor='yellow'><a href='' class='box right'>box</a></td>
</tr>
</table>

I want to put the first link box on the center of the pink table cell, and the second link box on the right of the yellow table cell.

But the above code doesn' work correctly.

How can I make the above code correctly?

Spudhead
08-15-2005, 05:55 PM
Probably not the answer you're looking for but I'd have done it like this:



<style>

a.box{
display:inline-block;
border: 1px solid #000;
padding:15px;
}

</style>

<table>
<tr>
<td width="200" bgcolor="pink" align="center"><a href="" class="box">box</a></td>
<td width="200" bgcolor="yellow" align="right"><a href="" class="box">box</a></td>
</tr>
</table>

mlse
08-15-2005, 06:03 PM
<html>
<head>
<style>
a.box{
display:inline-block;
border: 1px solid #000;
padding:15px;
}

td.wide {width:200px}

td.center {text-align:center}
td.right {text-align:right}
</style>
</head>

<body>
<table>
<tr>
<td bgcolor='pink' class='wide center'><a href='' class='box'>box</a></td>
<td bgcolor='yellow' class='wide right'><a href='' class='box'>box</a></td>
</tr>
</table>
</body>
</html>


:D



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum