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:
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?
To change the font size in HTML, use the style attribute. The style attribute specifies an inline style for an element. The attribute is used with the HTML <p> tag, with the CSS property font-size.
To change font size in HTML, use the CSS font-size property. Set it to the value you want and place it inside a style attribute. Then add this style attribute to an HTML element, like a paragraph, heading, button, or span tag.
Here's how: Click the cell with the hyperlink. On the Home tab, right-click the Hyperlink style and pick Modify. If you don't see the Hyperlink style, click the arrow to expand the style gallery. In the Style box, click Format. Click Font, choose your formatting options and click OK. Click OK to close the Style box.
The selector can either be our HTML tag or maybe a class or an ID. For example: // HTML <p> Any text whose font we want to change </p> // CSS p { font-size: 14px; }
Always use the proper HTML tags, like <h1> - <h6> for headings and <p> for paragraphs. The font-size value can be an absolute, or relative size. Note: If you do not specify a font size, the default size for normal text, like paragraphs, is 16px (16px=1em). Tip: If you use pixels, you can still use the zoom tool to resize the entire page.
But that was before HTML5. Then we added text using the <font> tag, which can take in an attribute of size as seen below: This size attribute can take in value from 1-7 in which the text size increases from 1 to 7. But like I said, this has long been depreciated, and most people don't even know it existed.
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.
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; }
increase the padding size of font and then try to increase font size:-
style="padding-bottom:40px; font-size: 50px;"
you can add class in anchor tag also like below
.a_class {font-size: 100px}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With