Jump to content

anchor tag


phpmady

Recommended Posts

Hi,

 

<span class="other_items">

<p>

<a href="">asdfdsafdsaf dsafsdaf sdafds</a>

</p>

</span>

 

 

how to write the css for above content, i tried this below css style but it fails for anchor tag inside the paragraph

Note: i dont want to  write <a href="" class="other_items">asdfdsafdsaf dsafsdaf sdafds</a>  in the above.

 

 

<style type="text/css">

p a.other_items:link {text-decoration: none; color:red;}

p a.other_items:visited {text-decoration: none; color:red;}

p a.other_items:active {text-decoration: none; color:red;}

p a.other_items:hover {text-decoration: none; color:red;}

</style>

 

 

Please give me some solution

 

Thanks guys,

 

 

Link to comment
https://forums.phpfreaks.com/topic/220726-anchor-tag/
Share on other sites

<span class="other_items">
<p>
<a href="">asdfdsafdsaf dsafsdaf sdafds</a>
</p>
</span>

 

This should work:

<style type="text/css">
.other_items p a:link {text-decoration: none; color:red;}
.other_items p a:visited {text-decoration: none; color:red;}
.other_items p a:active {text-decoration: none; color:red;}
.other_items p a:hover {text-decoration: none; color:red;}
</style>

 

It was a basic syntax error.

 

Hope this helped.

 

E

Link to comment
https://forums.phpfreaks.com/topic/220726-anchor-tag/#findComment-1143269
Share on other sites

The Letter E was mostly correct, with one tiny little problem. It should be this:

 

<style type="text/css">
.other_items p a:link {text-decoration: none; color:red;}
.other_items p a:visited {text-decoration: none; color:red;}
.other_items p a:hover {text-decoration: none; color:red;}
.other_items p a:active {text-decoration: none; color:red;}
</style>

 

The order of pseudo selectors needs to be link -> visited -> hover -> active. This is easy to remember with LoVeHAte: LinkVisitedHoverActive. If you don't do it in this order, you will find strange things happening in some browsers, and it can be really difficult to debug.

Link to comment
https://forums.phpfreaks.com/topic/220726-anchor-tag/#findComment-1143464
Share on other sites

The Letter E was mostly correct, with one tiny little problem. It should be this:

 

<style type="text/css">
.other_items p a:link {text-decoration: none; color:red;}
.other_items p a:visited {text-decoration: none; color:red;}
.other_items p a:hover {text-decoration: none; color:red;}
.other_items p a:active {text-decoration: none; color:red;}
</style>

 

The order of pseudo selectors needs to be link -> visited -> hover -> active. This is easy to remember with LoVeHAte: LinkVisitedHoverActive. If you don't do it in this order, you will find strange things happening in some browsers, and it can be really difficult to debug.

 

Thanks for the correction. I was unaware of that order. :)

Link to comment
https://forums.phpfreaks.com/topic/220726-anchor-tag/#findComment-1143510
Share on other sites

<span class="other_items">
<p>
<a href="">asdfdsafdsaf dsafsdaf sdafds</a>
</p>
</span>

 

This should work:

<style type="text/css">
.other_items p a:link {text-decoration: none; color:red;}
.other_items p a:visited {text-decoration: none; color:red;}
.other_items p a:active {text-decoration: none; color:red;}
.other_items p a:hover {text-decoration: none; color:red;}
</style>

 

It was a basic syntax error.

 

Hope this helped.

 

E

 

Thanks Letter E, really embarassing  for me,

 

 

Link to comment
https://forums.phpfreaks.com/topic/220726-anchor-tag/#findComment-1143518
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.