Let HTML tag inherit its parent's style i.e. set child tag style to parent tag style

Sometimes you want to make paragraphs clickable but when putting the text in <a> tag it usually changes the color and weight of the tag. However if you want the text to same as the paragraph you set it to inherit like this

property: inherit;

So the same color and font would become like this

<p><a href="www.mysite.com" style="color:inherit; font-family:inherit;">Lorem ipsum.....</a></p>

Reply

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.

More information about formatting options

urchinTracker(); // -->