To change the font size of text content in a Web page coded in HTML, apply the CSS "font-size" style property to the HTML element holding it. The "font-size" property accepts named sizes (small, medium, large, etc.), fixed sizes (in px, cm, em, etc.) and percentages as values.
- Identify the HTML element to modify
In your HTML code, identify the HTML element that holds the text you want to modify. If you only want to modify the font size of a portion of a larger element (a "p" or "div," for example), you can elect to enclose the length of it in a "span" element.
- Add the "style" attribute to the element
If the HTML element does not already have a "style" attribute, add it to the opening HTML tag by inserting ' style="" ' between the its name and the greater-than symbol. Set your cursor between the double quotation marks. Otherwise, if the HTML element already has a "style" attribute, set your cursor directly after the first double quotation mark of the existing "style" attribute.
- Add the "font-size" property
Type "font-size: " and then add the desired font size value after it. Terminate the CSS property by adding a semicolon after the value. The inserted style attribute should resemble ' style="font-size: 12px;" '.
- Save your code and test the changes
Save your code. If your page was already open when you made the modification, you must reload it to see any meaningful changes.