Skip to main content

CSS Text Properties | Font Properties - Text Color and Background - Text Alignment and Decoration - Some common CSS text properties

CSS Text Properties:

CSS provides a variety of text-related properties that allow you to control the appearance and layout of text within an HTML document. 

Here are some common CSS text properties:

1. Font Properties:

   - `font-family`: Specifies the font family for the text.
   - `font-size`: Sets the size of the text.
   - `font-weight`: Defines the thickness of the characters (e.g., bold or normal).
   - `font-style`: Specifies the style of the font (e.g., italic or normal).

   css
   p {
     font-family: 'Arial', sans-serif;
     font-size: 16px;
     font-weight: bold;
     font-style: italic;
   }
   

Font Properties - Text Color and Background - Text Alignment and Decoration - Some common CSS text properties
CSS Text Properties

2. Text Color and Background:

   - `color`: Sets the color of the text.
   - `background-color`: Defines the background color behind the text.

   css
   p {
     color: #333;
     background-color: #f5f5f5;
   }

3. Text Alignment:

   - `text-align`: Specifies the horizontal alignment of text (left, right, center, justify).

   css
   p {
     text-align: center;
   }

4. Text Decoration:

   - `text-decoration`: Adds decoration to text (underline, overline, line-through, none).
   - `text-decoration-line`: Specifies the type of text decoration.

   css
   a {
     text-decoration: underline;
   }

5. Text Transformation:

   - `text-transform`: Changes the capitalization of text (uppercase, lowercase, capitalize).

   css
   h2 {
     text-transform: uppercase;
   }

6. Line Height:

   - `line-height`: Sets the height of a line of text. It can be a number, percentage, or a specific length.

   css
   p {
     line-height: 1.5;
   }

7. Letter Spacing:

   - `letter-spacing`: Defines the spacing between characters.

   css
   p {
     letter-spacing: 1px;
   }

8. Word Spacing:

   - `word-spacing`: Sets the spacing between words.

   css
   p {
     word-spacing: 2px;
   }
   

Font Properties - Text Color and Background - Text Alignment and Decoration - Some common CSS text properties
text-align

9. Text Shadow:

   - `text-shadow`: Adds a shadow to the text.

   css
   h1 {
     text-shadow: 2px 2px 4px #333;
   }

10. Overflow and White Space:

    - `white-space`: Defines how white space inside an element is handled.
    - `overflow`: Specifies how content should behave when it overflows the box.

    css
    p {
      white-space: nowrap;
      overflow: hidden;
    }

These are just a few examples of CSS text properties. By using these properties, you can customize the appearance and layout of text in your web pages.

Comments

Popular posts from this blog

Best Money Earning Apps in India 2026 – Online Jobs & Income Guide

Best Apps to Earn Money Online in India (2026 Guide) Introduction With the rapid growth of Technology and digital platforms, earning Money online in India has become easier than ever. From students to professionals, everyone is exploring online Jobs and Business opportunities using mobile apps. In this blog, we will explore the Best Apps to Earn Money Online in India , along with selection process, benefits, earning power, and latest developments. Why Choose Money Earning Apps? Online earning apps are becoming popular due to: Flexible working hours No high investment required Easy to start with basic skills Opportunity to build a scalable Business Increasing demand due to Latest Development in digital economy Best Apps to Earn Money Online in India 1. Meesho Category: Reselling Business Earn by selling products without investment Share products via WhatsApp & social media Profit margin depends on pricing Best For: Housewives, beginners, side income seekers 2. Upwork Category...

New Technology Trends That Will Change India Jobs

New Technology Trends That Will Change India: Jobs, Money, Business & Future Opportunities: India is rapidly transforming into a technology-driven economy. With the rise of AI, automation, and digital platforms, new Technology trends are not only shaping industries but also creating new Jobs , boosting Business , and opening multiple ways to earn Money . In this blog, we will explore the latest developments, future job roles, selection process, benefits, and the power these technologies hold in shaping India’s future. Introduction: Why Technology Trends Matter in India India’s digital growth is fueled by government initiatives, startups, and global investments. The integration of Technology in sectors like agriculture, healthcare, education, and finance is creating massive opportunities. These trends are directly impacting: Job creation Business growth Income opportunities Skill demand Top New Technology Trends That Will Change India 1. Artificial Intelligence (AI) & Automati...

Biography of Manohar Joshi

Biography of Manohar Joshi: Manohar Gajanan Joshi is an Indian politician who has played a significant role in Maharashtra state politics. Born on December 2, 1937, in a middle-class family in a village called Ganeshpeth in Ratnagiri district, Maharashtra, Joshi's journey into politics was marked by his association with the Shiv Sena, a right-wing regional political party in India. Joshi's political career began in the late 1960s when he joined the Shiv Sena, which was then led by its founder, Bal Thackeray. He quickly rose through the ranks of the party due to his organizational skills, dedication, and ideological alignment with the party's principles, which advocated for the interests of the Marathi-speaking population of Maharashtra. In 1972, Manohar Joshi won his first election to the Brihanmumbai Municipal Corporation (BMC), marking the beginning of his electoral career. He served as a corporator in the BMC and later became the Mayor of Mumbai in 1976. Joshi's tenu...