Tools, FAQ, Tutorials:
Changing Fonts a Paragraph with HTML 'span'
How To Change Text Fonts for Some Parts of a Paragraph?
✍: FYIcenter.com
If you want to change text fonts or colors for some parts of a paragraph,
you can use "span" element with "style" attributes to specify font and color information
as CSS properties. Here is a tutorial example of using "span" elements to change text fonts:
<?xml version="1.0" ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <title>Changing Fonts with SPAN Elements</title> </head> <body> <h4>SPAN Elements?</h4> <p><span style="font-family: 'time roman'; font-size: 18pt; font-weight: bold; color: red">I</span> don't <span style="font-size: 16pt; font-weight: bold; font-style: italic; color: red">see</span> any <span style="font-family: courier; font-size: 14pt; font-weight: bold; color: blue">SPAN elements</span> in this paragraph. Do you <span style="font-size: 16pt; font-weight: bold; font-style: italic; color: red">see</span> any <span style="font-family: courier; font-size: 14pt; font-weight: bold; color: blue">SPAN elements</span> here? What is a SPAN element anyway?</p> </body> </html>
If you save the above document as changing_fonts.html and view it with Internet Explorer, you will see that different parts of the paragraph are having different fonts and colors as shown below:
2017-03-07, 3633🔥, 0💬
Popular Posts:
How to create a new API on the Publisher Dashboard of an Azure API Management Service? If you are ne...
How to use the "find-and-replace" Policy Statement for an Azure API service operation? The "find-and...
How To Use an Array as a Queue in PHP? A queue is a simple data structure that manages data elements...
How to use the XML to JSON Conversion Tool at freeformatter.com? If you want to try the XML to JSON ...
How To Read a File in Binary Mode in PHP? If you have a file that stores binary data, like an execut...