0

I can only get hyperlink working on the first line. When a line break is encountered the further hyperlink is not working it is only plain text!

The red box around the black text is the working hyperlink and green is not working as there is a link break.

Output

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;
}
Celt
  • 2,469
  • 2
  • 26
  • 43
Wocugon
  • 566
  • 2
  • 7
  • 22

1 Answers1

3

Even though it may be considere valid, it's not a good idea to nest the <p> tag inside an anchor tag. Try formatting your HTML like this:

<p>
    <a href='article.php?no=".$row['ar_id']."'>
        "19 hours ago by Sachin Bhandary Alarming Video From Manipur Shows Armed Forces"
    </a>
</p>
Celt
  • 2,469
  • 2
  • 26
  • 43