Page 1 of 1

Can hyperlink text in H2 be different font from rest of h2?

Posted: Tue May 31, 2016 10:03 am
by simonmlewis
I have a H2 tag. It's styled with translucent background and a font size.
But I've been asked to put text below it, that is small. ie "click here for full range".

I tried this:

Code: Select all

 <div class='home-column-inner'>
  <a href='/link-here'>
  <h2>Title here<br/><a href='/link-here'>Click for full range</a></h2>
</div>
But I don't see a way of saying:

h2 { this font size }
h2 a { a smaller font size}.

Can it be done??

Re: Can hyperlink text in H2 be different font from rest of

Posted: Tue May 31, 2016 10:06 am
by simonmlewis
Scratch that, it was becuase had two <a> tags in there, so it was all using that <a> reference.
Been one of those days!

Re: Can hyperlink text in H2 be different font from rest of

Posted: Sat Jun 18, 2016 5:51 am
by harman87
Yes, hyperlink text in H2 can be different from rest of non-linked H2s.

The reason is when you put anchor text in h2 tag, it overwrite the h2 style. So to keep hyperlink text same as normal h2 text you need to style the <a> tag with same font properties.