HTML Fonts
1.font tag
2.font attributes
3.controlling fonts with styles
Note: the <font> tag in HTML is deprecated. It is supposed to be removed in a future versions of HTML.
font Tag
<p>
<font size="2" face="verdana">
This is a paragraph
</font>
</p>
<p>
<font size="3" face="Time">
This is another paragraph.
</font>
</p>
Font Attributes
Attribute Example Purpose
size="number" size="2" Defines the font size
size="+number" size="+1" Increases the font size
size="-number" size="-1" Decreases the font size
face="face-name" face="Times" Defines the font name
color="color-value" color="#eeff00" Defines the font color
color="color-name" color="red" Defines the font color
Controlling font's with styles
stylesheets(CSS) will be used to define the layout and display proparties of HTML elements.
Font
<html>
<body>
<h1 style="font-family:verdana">A Heading</h1>
<p style="font-family:courier">A Paragraph</p>
</body>
</html>
Font Size
<html>
<body>
<h1 style="font-size:150%">A heading</h1>
<p style="font-size:80%">A paragraph</p>
</body>
</html>
Font Color
<html>
<body>
<h1 style="color:blue">A blue heading</h1>
<p style="color:red">A red paragraph</p>
</body>
</html>
Font,Font Size,Font Color
<html>
<body>
<p style="font-family:verdana; font-size:80%;color:green">
This is a paragraph with some green text in it.This is a paragraph with some green text in it.
This is a paragraph with some green text in it.This is a paragraph with some green text in it.
This is a paragraph with some green text in it.This is a paragraph with some green text in it.
</p>
</body>
</html>
1.font tag
2.font attributes
3.controlling fonts with styles
Note: the <font> tag in HTML is deprecated. It is supposed to be removed in a future versions of HTML.
font Tag
<p>
<font size="2" face="verdana">
This is a paragraph
</font>
</p>
<p>
<font size="3" face="Time">
This is another paragraph.
</font>
</p>
Font Attributes
Attribute Example Purpose
size="number" size="2" Defines the font size
size="+number" size="+1" Increases the font size
size="-number" size="-1" Decreases the font size
face="face-name" face="Times" Defines the font name
color="color-value" color="#eeff00" Defines the font color
color="color-name" color="red" Defines the font color
Controlling font's with styles
stylesheets(CSS) will be used to define the layout and display proparties of HTML elements.
Font
<html>
<body>
<h1 style="font-family:verdana">A Heading</h1>
<p style="font-family:courier">A Paragraph</p>
</body>
</html>
Font Size
<html>
<body>
<h1 style="font-size:150%">A heading</h1>
<p style="font-size:80%">A paragraph</p>
</body>
</html>
Font Color
<html>
<body>
<h1 style="color:blue">A blue heading</h1>
<p style="color:red">A red paragraph</p>
</body>
</html>
Font,Font Size,Font Color
<html>
<body>
<p style="font-family:verdana; font-size:80%;color:green">
This is a paragraph with some green text in it.This is a paragraph with some green text in it.
This is a paragraph with some green text in it.This is a paragraph with some green text in it.
This is a paragraph with some green text in it.This is a paragraph with some green text in it.
</p>
</body>
</html>
No comments:
Post a Comment