我只能在第一行获得超链接。当遇到换行符时,进一步的超链接不起作用,它只是纯文本!
黑色文字周围的红色框是工作超链接,绿色无效,因为有链接中断。
HTML:
<div class='data_block'>
<img src='data:image/jpeg;base64,".base64_encode( $row['ar_image'] )."' class='data_image'/>
<div class='data_title'>
<a href='article.php?no=".$row['ar_id']."'><p>"
19 hours ago by Sachin Bhandary Alarming Video From Manipur Shows Armed Forces"</p></a>
</div>
<div class='data_desc'>
<p>".$row['ar_desc']."</p>
</div>
</div>";
CSS:
.data_title a
{
font-size: 15px;
font-family: "Century Gothic";
font-weight: 600;
vertical-align: top;
float: right;
margin-top:-25%;
width:450px;
margin-right: auto;
margin-left:auto;
text-align: center;
text-decoration:none;
color:#2E84C2;
}
.data_title:hover a
{
color: #272727;
}
答案 0 :(得分:3)
即使它可能被认为是有效的,但将<p>
标记嵌套在锚标记中并不是一个好主意。尝试格式化HTML,如下所示:
<p>
<a href='article.php?no=".$row['ar_id']."'>
"19 hours ago by Sachin Bhandary Alarming Video From Manipur Shows Armed Forces"
</a>
</p>