我想设计这样的东西。
我努力为我的代码设置样式,但我仍然无法在我的 html 中做到这一点我有这个:
<div id="main">
<div class="box1">
<div class='up'><a href="" class="vote" id="<?php echo $id; ?>" name="up">
<?php echo $up; ?></a></div>
<div class='down'><a href="" class="vote" id="<?php echo $id; ?>" name="down"><?php echo $down; ?></a></div>
</div>
<div class='box2' >
<table cellspacing="10">
<tr>
<td>
artist:<?php echo $artist; ?>
</td>
<td>
Song:<?php echo $title; ?>
</td>
</tr>
<tr>
<td>
album:<?php echo $album; ?>
</td>
<td>
genre:<?php echo $genre; ?>
</td>
<td>
<button type = "button" name = "Download" onClick = <?php echo $filename;?>>
Download
</button>
</div>
</td>
</tr>
</table>
</div>
</div>
在风格上我有这个:
#main
{
height:80px; border:1px dashed #29ABE2;margin-bottom:7px;
width:600px;
}
a
{
color:#DF3D82;
text-decoration:none;
}
a:hover
{
color:#DF3D82;
text-decoration:underline;
}
.up
{
height:40px; font-size:24px; text-align:center; background-color:#009900; margin-bottom:2px;
-moz-border-radius: 6px;-webkit-border-radius: 6px;
}
.up a
{
color:#FFFFFF;
text-decoration:none;
}
.up a:hover
{
color:#FFFFFF;
text-decoration:none;
}
.down
{
height:40px; font-size:24px; text-align:center; background-color:#cc0000; margin-top:2px;
-moz-border-radius: 6px;-webkit-border-radius: 6px;
}
.down a
{
color:#FFFFFF;
text-decoration:none;
}
.down a:hover
{
color:#FFFFFF;
text-decoration:none;
}
.box1
{
float:left; height:80px; width:50px;
}
.box2
{
float:left; width:500px; text-align:left;
margin-left:10px;height:60px;margin-top:5px;
font-size:15px;
}
.box3
{
float:right; height:80px; width:60px;
}
img
{
border:none;
padding-top:7px;
}
我的结果如下所示: