The following article, HTML Fonts Styles, provides an outline of the most commonly used font styles in HTML. HTML, popularly known as HyperText Markup Language, is one of the most essential and critical languages or scripts that is essential in creating web applications and websites. This is like the backbone of web app development, as all the tags and other features form the underlying component of it.
All the front-end development is also based on HTML scripting. This can just be used to provide markup tags, and in order to enhance the look and feel of these tags, we have another library that is very popular, CSS, which stands for Cascading Style Sheets. This can be used to implement all kinds of styles that are required by the HTML. The font and styles form the major part of the website, and in this article, we are going to provide you with a list of the majority of the HTML font styles.
Fonts play a major role in making a website more user-friendly and attract more traffic apart from increasing content readability. The font color and the font face also depend on the computer and the browser which is making its use, and the HTML tag is also used to add the style, color, size to the text on your website.
The
The tag is the most commonly used and one of the most important tags which can be used to build a good look and feel for your webpage. The text which will follow the opened tag will remain in the same manner unless and until closed by tag.
There are some basic features and characteristics associated with HTML font styles, and they are:
The content font size can be set by making use of size attributes. The accepted value of the range lies from 1, which is the smallest number, and it goes till 7, which is the largest number. The default size of any font type is 3.
Example,
<!DOCTYPE html> <html> <head> <title>Setting Basic Font Size</title> </head> <body> <font size = "1">Font size = "1"</font><br /> <font size = "2">Font size = "2"</font><br /> <font size = "3">Font size = "3"</font><br /> <font size = "4">Font size = "4"</font><br /> <font size = "5">Font size = "5"</font><br /> <font size = "6">Font size = "6"</font><br /> <font size = "7">Font size = "7"</font> </body> </html>
The relative font size is used to determine and specify how many sizes are larger and how many sizes are smaller than the current font size which is actually present. This can be specified like :
<font size = "+f"> or by writing <font size = "−f">
Example,
<!DOCTYPE html> <html> <head> <title>Relative Font Size</title> </head> <body> <font size = "-1">Font size = "-1"</font><br /> <font size = "+1">Font size = "+1"</font><br /> <font size = "+2">Font size = "+2"</font><br /> <font size = "+3">Font size = "+3"</font><br /> <font size = "+4">Font size = "+4"</font> </body> </html>
The other category after the setting of font size and relative font size is that of the setting up of font face. This forms a critical part of the attributes listed above. This can be set by using the face attribute, but it should always be kept in mind that if the user who is designated to use this font value doesn’t have this font installed in their system, they will not be able to see it. Instead, only the default font face applicable to that particular user’s computer will be visible.
Example,
<!DOCTYPE html> <html> <head> <title>Font Face</title> </head> <body> <font face = "Times New Roman" size = "5">Times New Roman</font><br /> <font face = "Verdana" size = "5">Verdana</font><br /> <font face = "Comic sans MS" size =" 5">Comic Sans MS</font><br /> <font face = "WildWest" size = "5">WildWest</font><br /> <font face = "Bedrock" size = "5">Bedrock</font><br /> </body> </html>
Example,
<font face = "arial,helvetica"> <font face = "Lucida Calligraphy,Comic Sans MS,Lucida Console">
This is another attribute that forms the critical part and component of the HTML font and styles list. In this font, color is set up by making use of any color attribute; the color which is required could be required by making use of hexadecimal code and color name for the specified color.
Example,
<!DOCTYPE html> <html> <head> <title>Setting Font Color</title> </head> <body> <font color = "#FF00FF">This text is in pink</font><br /> <font color = "red">This text is red</font> </body> </html> <basefont>
Example,
<!DOCTYPE html> <html> <head> <title>Setting Basefont Color</title> </head> <body> <basefont face = "arial, verdana, sans-serif" size = "2" color = "#ff0000"> <p>This is the page's default font.</p> <h2>Example of the <basefont> Element</h2> </body> </html>
HTML font and styles are among the most critical components and features that cannot be overlooked and can give a very good shape and design to your website. When we talk about the latest javascript libraries available in the market, they contain all these and several other font and styles. For the basic HTML, this still needs to be done manually. I hope you liked our article. Stay tuned to our blog for more articles like these.
The above is the detailed content of HTML Fonts Styles. For more information, please follow other related articles on the PHP Chinese website!