CSS
CSS Texts - Color, Alignment, Decoration, transformation, Spacing - letter-spacing, text-indent, line-height
- Text Color:
- Text Alignment:
- Text Decoration:
- Text Transformation:
- Spacing:
- Text Indent:
- Line Height:
Text formatting in HTML and CSS allows you to control the color, alignment, decoration, transformation, and spacing of text on a web page. Here are some examples of how you can apply these text styles:
¶Text Color:
You can set the color of your text using the CSS color
property.
<style>
.red-text {
color: red;
}
</style>
<p class="red-text">This is red text.</p>
¶Text Alignment:
You can align text within an element using the text-align
property in CSS.
<style>
.center-align {
text-align: center;
}
</style>
<p class="center-align">This text is centered.</p>
¶Text Decoration:
Text decoration includes properties like text-decoration: underline
for underlining text, text-decoration: overline
for adding a line above text, and text-decoration: line-through
for striking through text.
<style>
.underlined {
text-decoration: underline;
}
</style>
<p class="underlined">This text is underlined.</p>
¶Text Transformation:
You can transform text to uppercase, lowercase, or capitalize using the text-transform
property.
<style>
.uppercase {
text-transform: uppercase;
}
</style>
<p class="uppercase">This text is in uppercase.</p>
¶Spacing:
Letter Spacing:
You can control the spacing between letters using the letter-spacing
property.
<style>
.spaced-text {
letter-spacing: 2px;
}
</style>
<p class="spaced-text">Letter spacing increased.</p>
¶Text Indent:
You can set the indentation of the first line of text in a paragraph using the text-indent
property.
<style>
.indented-text {
text-indent: 20px;
}
</style>
<p class="indented-text">This text has an indentation of 20px for the first line.</p>
¶Line Height:
You can adjust the spacing between lines of text using the line-height
property.
<style>
.spaced-lines {
line-height: 1.5;
}
</style>
<p class="spaced-lines">This text has increased line height.</p>
These are just a few examples of how you can style text using CSS
CSS Colors - Valid Color text,Keyword Colors, Hexadecimal, RGB, HSL,HSLA Colors
How To Work CSS Backgrounds - background-color,
All Tutorials in this playlist
Popular Tutorials
Categories
-
Artificial Intelligence (AI)
11
-
Bash Scripting
1
-
Bootstrap CSS
0
-
C Programming
14
-
C#
0
-
ChatGPT
1
-
Code Editor
2
-
Computer Engineering
3
-
CSS
28
-
Data Structure and Algorithm
18
-
Design Pattern in PHP
2
-
Design Patterns - Clean Code
1
-
E-Book
1
-
Git Commands
1
-
HTML
19
-
Interview Prepration
2
-
Java Programming
0
-
JavaScript
12
-
Laravel PHP Framework
37
-
Mysql
1
-
Node JS
1
-
Online Business
0
-
PHP
28
-
Programming
8
-
Python
12
-
React Js
19
-
React Native
1
-
Redux
2
-
Rust Programming
15
-
SEO - Search Engine Optimization
1
-
Tailwind CSS
1
-
Typescript
10
-
Uncategorized
0
-
Vue JS
1
-
Windows Operating system
1
-
Woocommerce
1
-
WordPress Development
2
Tags
- Artificial Intelligence (AI)
- Bash Scripting
- Business
- C
- C Programming
- C-sharp programming
- C++
- Code Editor
- Computer Engineering
- CSS
- Data Structure and Algorithm
- Database
- Design pattern
- Express JS
- git
- Git Commands
- github
- HTML
- Java
- JavaScript
- Laravel
- Mathematics
- MongoDB
- Mysql
- Node JS
- PHP
- Programming
- Python
- React Js
- Redux
- Rust Programming Language
- SEO
- TypeScript
- Vue JS
- Windows terminal
- Woocommerce
- WordPress
- WordPress Plugin Development