HTML/CSS HTML Font Tag: How to Change Text Size and Style for Your Webpage

  • Thread starter Thread starter biferi
  • Start date Start date
  • Tags Tags
    Font Html Tag
AI Thread Summary
Using the <font> tag for styling text is outdated and not recommended. Instead, CSS should be utilized for all styling purposes. The correct way to set font size in CSS is by using a style rule like "a { font-size: 6 }". It's also important to use lowercase letters for HTML tags to maintain standards. For XHTML compliance, self-closing tags like <br /> should be used. While inline styles can be applied, they are not maintainable; an external stylesheet is preferred for better organization. To center text and set font size, consider using a <div> or <span> with appropriate CSS styles. Resources like W3Schools can help ensure code validity and provide learning materials on CSS.
biferi
Messages
191
Reaction score
0
When I make a webpage and I want my Text in my Link to be say Font Size 6 am I right I would do this

<font size="6">
<A HREF="form.html" TARGET="B">
<img src="mailbox.gif" width="16%">
<BR>
E-MAIL THE ARTIST
</A>
</font>

Thanks
 
Technology news on Phys.org
This is not a good way to do this. You should use CSS to style links.

a { font-size: 6 }

You should also use lowercase letters for your tags.
 
I think the simplistic thing that you may be looking for is something like:

<font size="6">E-MAIL THE ARTIST</font>
 
The font tag has been deprecated. All styling should be done via CSS.
 
<br> should also be <br />, to conform to XHTML.
 
StevieTNZ said:
<br> should also be <br />, to conform to XHTML.

Only if you are using the XHTML doc type. HTML5 is gaining speed. :)
 
So if I want to make my text in my Link a Font size I do this

<DIV ALIGN="center">
<p style="font-family:Times New Roman;
font-size:16;">

<A HREF="form.html" TARGET="B">
<img src="mailbox.gif" width="16%">
<BR>
E-MAIL THE ARTIST
</A>
</p>
 
Having inline styles on individual tags is not easily maintainable. It is highly suggested that you use an external stylesheet and learn CSS.
 
  • #10
You need to end your DIV tag and align center is not valid.
 
  • #11
<span style="font-size:6">some text in here</span>

OR

<div style="font-size:6">some text in here</div>
 

Similar threads

Replies
14
Views
3K
Replies
1
Views
2K
Replies
5
Views
2K
Replies
3
Views
2K
Replies
2
Views
1K
Replies
3
Views
2K
Replies
11
Views
2K
Replies
8
Views
2K
Back
Top