Cover Image for HTML basefont Tag
61 views

HTML basefont Tag

The <basefont> tag was an old HTML tag used to specify a base font size and color for a web page. However, it has been deprecated in HTML5 and is no longer recommended for use.

Instead of the <basefont> tag, it is now recommended to use CSS (Cascading Style Sheets) to control the font styles and sizes on a web page. CSS provides more flexibility and control over the appearance of text and allows for better separation of content and presentation.

Here’s an example of how you can use CSS to set the base font size for a web page:

HTML
<html>
     <head>
          <style>
              body {
                 font-size: 16px;
              }
          </style>
     </head>
     <body>
          <h1>Hello, World!</h1>
          <p>This is an example paragraph.</p>
     </body>
</html>

In the example above, the CSS rule body { font-size: 16px; } sets the base font size for the entire web page to 16 pixels.

Remember to include the CSS styles either inline within the <style> tags in the <head> section of your HTML document or in an external CSS file that you link to your HTML document using the <link> tag.

YOU MAY ALSO LIKE...

The Tech Thunder

The Tech Thunder

The Tech Thunder


COMMENTS