- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to add a base font in a HTML page?
The HTML <basefont> tag specifies the standard font-family, font-size, and colour for the text in the HTML document. It is advised that you format the text in the document using CSS attributes like font, font-family, font-size, and colour since this tag was deleted in HTML5.
Note − Not supported in HTML5
Syntax
<basefont color=”..” size=".." face="..">
Following are the examples…
Example: Instead using CSS (basefont is not supported by html5)
In the following example we are using css style to allow basefont as it was alternative of it.
<!DOCTYPE html> <html> <head> <style> body { text-align: center; } .varma { color: green; font-size: 45px; font-family: sans-serif; } .varma1 { font-family: arial; } </style> </head> <body> <div class="varma">TUTORIALSPOINT</div> <div class="varma1"> A Learning portal for Everyone. It contains well written,<br>well thought and well explained computer science and programming articles. </div> </body> </html>
Output
When the script gets executed, it will display text according to the font style which we mentioned inside the <style> tag of the above script.
Advertisements