|
HTML Home
Create a Website HTML TutorialHTML Tutorial HomeAbout HTML Getting Started HTML Elements HTML Formatting HTML Attributes HTML Colors HTML Links HTML Images HTML Meta Tags HTML Comments HTML Forms HTML Tables HTML Image Maps HTML Frames HTML Entities HTML Layouts HTML Styles HTML Scripts HTML Website Templates Website Hosting Summary HTML Code GeneratorsHTML Code GeneratorHTML Table Generator Marquee Generator Music Code Generator HTML Text Generator Text Box Generator Free HTML CodesHTML Background CodeHTML Color HTML Comment Box HTML Scroll Box HTML Text Codes HTML Image Codes HTML Marquee HTML Templates More Codes... HTML ReferenceHTML ExamplesComplete HTML Tag List Complete HTML 5 Tag List HTML Special Characters Hex Color Codes HTML Help
Sponsored Links
$1.99 Domain Names
With every new non-domain purchase thru ZappyHost, you get a domain name for only $1.99.
Create a website for free - uCoz
Build a website quickly and easily Customizable templates and graphics |
HTML Font Size CodeIn HTML, font size is specified using CSS (Cascading Style Sheets). Font size is specified using the font-size property. The actual value of the font-size property can be specified in different ways. You can specify font size in any of the following ways:
This page includes examples of these different methods. You can use the following HTML code to specify font size within your HTML documents. All you need to do is select your preferred option, then change the values to suit. Option 1: Absolute SizeAbsolute size refers to an entry in a table of font sizes that is calculated, and kept by the browser (or other user agent). Because of this, the text will always be displayed at the same size regardless of its surrounding elements. This is because the sizes are pre-calculated by the browser/user agent. Copy and paste this code: This code results in: Absolute size - xx-small Absolute size - x-small Absolute size - small Absolute size - medium Absolute size - large Absolute size - x-large Absolute size - xx-large Option 2: Relative SizeRelative size allows you to set the font size relative to the parent element. This means that different text with the same (relative) value could actually appear in many different sizes - even on the same page. It all depends on the text's parent element. There are two possible values: 'smaller' and 'larger'. Copy and paste this code: This code results in: Font size specified using relative values - smaller Font size specified using relative values - larger Option 3: Length ValueA length value allows you to specify an absolute font size, regardless of the surrounding elements. There are eight possible values. Relative Values:
Absolute Values:
Examples of Relative ValuesCopy and paste this code: This code results in: Font size specified at 1.2em Font size specified at 1.4em Font size specified at 1.8em Font size specified 2ex Font size specified at 3ex Font size specified at 4ex Font size specified at 12px Font size specified at 14px Font size specified at 18px Examples of Absolute ValuesCopy and paste this code: This code results in: Font size specified at 0.12in Font size specified at 0.18in Font size specified at 0.25in Font size specified at 0.35cm Font size specified at 0.45cm Font size specified at 0.6cm Font size specified at 3.5mm Font size specified at 4.5mm Font size specified at 6mm Font size specified at 10pt Font size specified at 12pt Font size specified at 16pt Font size specified at 0.8pc Font size specified at 1pc Font size specified at 1.2pc Option 4: Percentage ValuesPercentage values specify an absolute font size relative to the parent element's font size. Copy and paste this code: This code results in: Smaller font size specified using percentage values - 90% Larger font size specified using percentage values - 150% More Font PropertiesHere are more CSS font properties you can use on your text:
|
Sponsored Links
Need Website Content?
Get unique, quality digital content for your website.
|