increase font size of hyperlink text html

219,848

Solution 1

You can do like this:

a {font-size: 100px}

Try avoid using font tag because it's deprecated. Use CSS like above instead. You can give your anchors specific class and apply any style for them.

Solution 2

Your font tag is not correct, so it won't work in some browsers. The px unit is used with CSS, not HTML attributes. The font tag should look like this:

<font size="100">

Well, actually it shouldn't be there at all. The font tag is deprecated, you should use CSS to style the content, like you do already with the text-decoration:

<a href="selectTopic?html" style="font-size: 100px; text-decoration: none">HTML 5</a>

To separate the content from the styling, you should of course work towards putting the CSS in a style sheet rather than as inline style attributes. That way you can apply one style to several elements without having to put the same style attribute in all of them.

Example:

<a href="selectTopic?html" class="topic">HTML 5</a>

CSS:

.topic { font-size: 100px; text-decoration: none; }

Solution 3

increase the padding size of font and then try to increase font size:-

style="padding-bottom:40px; font-size: 50px;"

Solution 4

you can add class in anchor tag also like below

.a_class {font-size: 100px} 
Share:
219,848
Aniket
Author by

Aniket

Hi I am Java and Android Developer. "It's not how you fall, but how you pick yourself up again"

Updated on September 24, 2020

Comments

  • Aniket
    Aniket almost 4 years

    I am working on web application where I have taken href. But the default font of it is too small when comparing to the page. So I want to increase the size of the font.

    My output page look like below:

    enter image description here

    I have tried by font size for anchor tag but it doesn't show any effect after the font tag.

    Code I have tried is:

    <font size="100px"><a href="selectTopic?html" style="text-decoration: none">HTML 5</a></font>
    

    So how can I change the font size?

    • hjpotter92
      hjpotter92 over 11 years
      style="text-decoration: none; font-size: 1.5em;"
  • Mr. Alien
    Mr. Alien over 11 years
    this will change all a font-size so better tell hi to use a class or use a child selector instead like ul.class li a
  • ASGM
    ASGM over 11 years
    This answer could be clearer. While it should be obvious to those who know HTML and CSS, you should specify that the best way to adjust the font would be via CSS rather than a font tag. It would also help to note that the poster would need to add class="a_class" to his HTML.