Difference between revisions of "Centering & Formatting Text on Your Web Page"

From TheBestLinux.com
Jump to navigation Jump to search
Line 1: Line 1:
 
This is how you can format text on your web page, making it centered, changing the font size and color, and other options.  Here is an example of how I change font alignment, size and color on the fly, without having  to manage a separate CSS file:
 
This is how you can format text on your web page, making it centered, changing the font size and color, and other options.  Here is an example of how I change font alignment, size and color on the fly, without having  to manage a separate CSS file:
 
<pre style="color:blue">
 
<pre style="color:blue">
<p style="text-align: center; font-size: 42px; fg-color: green;">
+
<p style="text-align:center; font-size:42px; fg-color:red;">
 
Here is the text which will be now be centered with a font size of 42 pixels and green in color.
 
Here is the text which will be now be centered with a font size of 42 pixels and green in color.
 
</pre>
 
</pre>

Revision as of 05:08, 15 December 2022

This is how you can format text on your web page, making it centered, changing the font size and color, and other options. Here is an example of how I change font alignment, size and color on the fly, without having to manage a separate CSS file:

<p style="text-align:center; font-size:42px; fg-color:red;">
Here is the text which will be now be centered with a font size of 42 pixels and green in color.

And here is the resulting line with the style modified with our example:

Here is the text which will be now be centered with a font size of 42 pixels and RED in color.