HOME | PHP Tutorial | CSS
facebook icon
AgerNic.com
WEB DEVELOPER SITE, HTML, CSS, PHP
PHP Tutorial

PHP forms
HTML Tutorial

CSS Tutorial

HTML Text Color Style


HTML Tutorial » HTML Text Color Style

We can add color to a text as:
Inline - by using the style attribute in HTML elements
Internal - by using a <style> element in the section
External - by using an external CSS file
In HTML5, configuring web page fonts is using cascading style sheets.
The HTML style attribute has the following syntax:
Note: The old method, when using inline style or a font label, is outdated and should not be used anymore.

Syntax:
<tagname style="property:value;">

Adding HTML Text Color Style using CSS inline - examples


Example:
Example 1 HTML Text Color Style using CSS inline:

<!DOCTYPE html>
<html>
<head>
<title>HTML Text Color Style using CSS inline</title>
</head>
<body>
<h1>HTML Text Color Style using CSS inline</h1>
<span style="color:#0033FF">Here add your text color style in line #0033FF (blue)</span>
<p style="color:#FF0000">example - Here add your text color style in line red #FF0000</p>
<p style="color:red">Example - This is my text color style red</p>

</body>
</html>
Note: You will learn more about CSS Styleunder css-tutorial.html in this tutorial.


Adding HTML Text Color Style using CSS internal - examples


Example:
Example 1 HTML Text Color Style:

<!DOCTYPE html>
<html>
<head>
<title>Adding HTML Text Color Style using CSS internal - examples</title> <style>
span {
color: #0033FF;
}
p {
color: #FF0000;
}
</style>
</head>
<body>
<h1>Types of adding Adding HTML Text Color Style using CSS internal - examples using CSS inline</h1>
<span>This is my text color #0033FF (blue) using internal CSS style</span>
<p>This is my text color red #FF0000 using internal CSS style</p>
</body>
</html>


For external CSS style just make a file as style.css and replace
<style>
span {
color: #0033FF;
}
p {
color: #FF0000C;
}
</style>

with <link rel="stylesheet" href="style.css" type="text/css"/>

HTML Text Color Style HTML Text Color Style - html tutorial

3207. HTML link open in new tab or window - how to create link, html tutorial
HTML link open in new tab or window - how to create link html tutorial
https://www.agernic.com/html-tutorial/html-link-open-in-new-tab-or-window-how-to-create-link.html

2613. Backgrounds : Fixed Image - HTML tutorial
HTML backgrounds - HTML tutorial
http://www.echoecho.com/htmlbackgrounds03.htm

2124. HTML Tutorial - Elements: body, head, title
What are the elementes of a web page. and how can you create them
https://tutorialehtml.com/en/html-tutorial-elements-body-head-title/

2605. HTML Tutorial
HTML tutorial
http://www.echoecho.com/html.htm

2627. Forms : Password Field - HTML Tutorial
HTML forms - HTML tutorial
http://www.echoecho.com/htmlforms06.htm

2624. Forms : The Form Tag - HTML Tutorial
HTML forms - HTML tutorial
http://www.echoecho.com/htmlforms03.htm

Your add here
PHP substr() function

PHP str_replace() function

PHP define() function

PHP rtrim() function

PHP str_split() function

PHP strstr() function

PHP lcfirst() function

PHP ucwords() function

PHP explode() function

PHP implode() function

PHP trim() function

PHP html_entity_decode() function

PHP empty() Function

PHP ltrim() function

PHP strip_tags() function

PHP str_repeat() function

HTML form action - radio HTML form - how to create
CSS align content Property - CSS align text - how to create
PHP Install
CSS align image center - how to create
HTML Table Style
How do I get PHP errors to display - PHP error_reporting()