About Lesson
1. Inline Styling
You can directly specify font styles within an HTML tag using the style
attribute.
<p style=”font-family: Arial; font-size: 16px; color: blue;”>This is a styled paragraph.</p>
- font-family: Sets the font type (e.g., Arial, Times New Roman, etc.).
- font-size: Adjusts the font size.
- color: Changes the text color.
2. Using
<font>
TagThe
<font>
tag was used in older versions of HTML to change the font style but is now deprecated. It’s better to use CSS.<font face=”Verdana” size=”4″ color=”red”>Deprecated font styling</font>
3. Internal CSS
Define a
<style>
block inside the<head>
section of your HTML document.