{"id":75,"date":"2023-06-28T10:22:02","date_gmt":"2023-06-28T10:22:02","guid":{"rendered":"https:\/\/staging.brightwhiz.com\/?post_type=topic&p=75"},"modified":"2023-06-28T10:32:37","modified_gmt":"2023-06-28T10:32:37","slug":"html-fonts-reference","status":"publish","type":"topic","link":"http:\/\/local.tutorials\/topic\/html-fonts-reference\/","title":{"rendered":"HTML – Fonts Reference"},"content":{"rendered":"\n
Fonts play a crucial role in web design, allowing developers to create visually appealing and engaging websites. With HTML, you have a range of options to customize the appearance of your text using different font families, sizes, styles, and more. In this reference guide, we’ll explore various HTML font-related tags and attributes to help you enhance your web typography skills.<\/p>\n\n\n\n
HTML provides a set of font families that you can use to style your text. Here are a few examples:<\/p>\n\n\n\n
To specify the font family for an HTML element, use the font-family<\/strong> CSS property or the face attribute within the deprecated You can control the size of your text using different units of measurement. Some commonly used units include pixels ( HTML allows you to apply different styles to your text, such as bold, italic, and underline. Here’s how you can use them:<\/p>\n\n\n\n In addition to the standard fonts, you can utilize Google Fonts to expand your font choices. Google Fonts provides a wide selection of free, open-source fonts that you can easily integrate into your web projects. To use Google Fonts, include the following code in the <head> section of your HTML file.<\/p>\n\n\n\n Replace Remember to replace By using these HTML font-related tags and attributes, along with external font libraries like Google Fonts, you can greatly enhance the visual appeal of your web pages. Experiment with different combinations and find the typography that best suits your design and content.<\/p>\n","protected":false},"excerpt":{"rendered":" Fonts play a crucial role in web design, allowing developers to create visually appealing and engaging websites. With HTML, you have a range of options to customize the appearance of your text using different font families, sizes, styles, and more. In this reference guide, we’ll explore various HTML font-related tags and attributes to help you […]<\/p>\n","protected":false},"featured_media":43,"comment_status":"open","ping_status":"closed","template":"","meta":[],"categories":[2],"tags":[],"subject":[7,9],"yoast_head":"\nfont<\/code> tag.<\/p>\n\n\n\n
Font Sizes<\/h2>\n\n\n\n
<strong>px<\/strong><\/code>), ems (
<strong>em<\/strong><\/code>), and percentages (
<strong>%<\/strong><\/code>). For example:<\/p>\n\n\n\n
<p style="font-size: 16px;">This text has a font size of 16 pixels.<\/p>\n<p style="font-size: 1.2em;">This text has a font size of 1.2 times the parent element's font size.<\/p>\n<p style="font-size: 80%;">This text has a font size of 80% of the parent element's font size.<\/p><\/code><\/pre>\n\n\n\n
Font Styles<\/h2>\n\n\n\n
\n
<p>This is <strong>bold<\/strong> text.<\/p>\n<p>This is <em>italic<\/em> text.<\/p>\n<p>This is <u>underlined<\/u> text.<\/p><\/code><\/pre>\n\n\n\n
Google Fonts<\/h2>\n\n\n\n
<link rel="stylesheet" href="https:\/\/fonts.googleapis.com\/css?family=Font1|Font2|Font3"><\/code><\/pre>\n\n\n\n
Font1<\/code>,
Font2<\/code>, and
Font3<\/code> with the names of the desired fonts from the Google Fonts library. Then, you can use these fonts by specifying the font family in your CSS or HTML code.<\/p>\n\n\n\n
<link rel="stylesheet" href="https:\/\/fonts.googleapis.com\/css?family=Open+Sans|Roboto">\n\n<style>\n p {\n font-family: 'Open Sans', sans-serif;\n font-size: 18px;\n font-weight: bold;\n }\n\n h1 {\n font-family: 'Roboto', sans-serif;\n font-size: 24px;\n font-style: italic;\n }\n<\/style>\n\n<p>This paragraph uses the Open Sans font.<\/p>\n<h1>This heading uses the Roboto font.<\/h1><\/code><\/pre>\n\n\n\n
Font1<\/code> and
Font2<\/code> with the names of the desired Google Fonts.<\/p>\n\n\n\n