【发布时间】:2016-01-29 09:39:54
【问题描述】:
我目前正在 php 中显示用户的个人资料图片,如果他们点击它,则会将他们带到他们自己的个人资料。图像正确显示并且链接有效,但链接区域超出图片和附近的链接。我将如何减少锚的面积?
<?php } if ($searchuser == $username)
{ ?>
<a href="profile.php">
<?php } ?>
<div style="background-image: url('<?php echo $profilepic; ?> ')" class="user-pic"></div>
<?php if ($searchuser == $username)
{?>
</a>
div.user-pic {
margin: 0 auto;
width: 125px;
height: 125px;
border-radius: 50%;
background-repeat: no-repeat;
background-position: center center;
background-size: cover;
border: 0.09em solid white;
position: relative;
top: -60px;
padding: 0px;
z-index: -100;
}
【问题讨论】:
标签: css image background anchor