×

CSS Word-spacing

Word-spacing

The work-spacing property of CSS is applied to manage the space among the words. We can decrease or increase the space among the words by the use of this property.

It can modify the space among the words. This property is the same as the property letter-spacing. Rather than describing the space among the single character, it depicts the space among the words within the text’s piece.

Any large negative or positive value of word-spacing will create any word unreadable. When we use any larger positive value, it can cause the word’s view like any series of individual and unconnected words. A larger negative value can overlap multiple words to one another, which enables any word unrecognizable.

Syntax:

word-spacing: normal | length | initial | inherit;  

Property Values

normal: This value is used as a default value. It depicts any normal space (2.5em) among the words. This value describes the space, i.e., specified by a browser.

length: It describes any extra space among various words in the context of length (cm, em, px, pt, etc.). This value allows negative values.

initial: The initial property value sets the word spacing property to the default value.

inherit: This value is used to acquire the value from the parent component.

Let’s understand the concept with the help of two examples.

Example:1

<!DOCTYPE html>
<html>
<head>
<title> The word-spacing Property </title>
<style>
body
{
text-align: center;
}
#space
{
word-spacing: 40px;
}
p
{
color: green;
font-weight: bold;
font-size: 20px;
}
</style>
</head>
<body>  
<h1> CSS word-spacing Property </h1>  
<div> 
<h2> word-spacing: normal; </h2>  
<p>  
Welcome to this Page </p>  
</div> 
<div> 
<h2> word-spacing: 40px; </h2>  
<p id= "space"> Welcome to this Page </p>  
</div> 
</body>  
</html>

Output:

CSS Word-spacing

Example:2

<!DOCTYPE html>
<html>
<head>
<title> The word-spacing Property </title>
<style>
body
{
text-align: center;
}
#space
{
word-spacing: 2cm;
}
#space1
{
word-spacing: -50px;
}
#space2
{
word-spacing: initial;
}
p
{
color: green;
font-weight: bold;
font-size: 20px;
}
</style>
</head>
<body>  
<h1> CSS word-spacing Property </h1>  
<div> 
<h2> word-spacing: 2cm; </h2>  
<p id= "space">  
Welcome to this Page
</p>  
</div> 
<div> 
<h2> word-spacing: -50px; </h2>  
<p id= "space1">
Welcome to this Page
</p> 
<div> 
<h2> word-spacing: initial; </h2>  
<p id= "space2">  
Welcome to this Page
</p>  
</div>  
</div> 
</body>  
</html>

Output:

CSS Word-spacing

Related Topics

CSS Vertical Align

Vertical Align The vertical align CSS property describes the cell box of the table and an inline alignment vertically. This property is a self-explanatory and an essential property in CSS. But,...

2 minutes read.

How to create blinking text using CSS

The blinking effect is used in HTML and CSS to take the attraction towards a particular word or section. If you need such a blinking effect, we need to take...

2 minutes read.

CSS Selector

CSS Selector: There are some selectors used in CSS, which allows us to choose the content we wish to style. Various selectors are considered as the separation of the set...

5 minutes read.

CSS Links

CSS Link is used to create styled link. There are various ways to implement it. Styling Links Link can be styled with CSS properties like color, font-family, background etc. Example: <!DOCTYPE html>   <html>   <head>   <style>   a {       color: red;   }   </style>   </head>   <body>   <p><b><a href="https://www.tutorialandexample.com"    target="_blank">This is a link</a></b></p>   </body>   </html> Try Now There are four...

2 minutes read.

CSS Float

CSS Float: The float property of CSS is the positioning property. This property is applied to elements to push them either to left or right. It permits for wrapping facility...

4 minutes read.

CSS Order

CSS Order CSS order property in CSS describes the flex item’s order inside the flex or any grid container. It is applied to order any flex item. Note: If any component is...

3 minutes read.

CSS Flex-Box

Introduction The flex-box property of CSS stands for Flexible Box Layout Module. It is specifically used to design a flexible responsive layout. Flex-box is a one dimensional layout model, i.e. it works...

6 minutes read.

Cascading Style Sheet

CSS refers to the Cascading Style Sheet. CSS is a form of a programming language. In other words, CSS is a language of the style sheet that is utilised for...

7 minutes read.

How To Use CSS

You can use CSS(Cascading Style Sheet) in four ways. These are given below: The given above CSS type, in which various technique will be used. These are different from each other and...

2 minutes read.

Css Text Orientation

Introduction: The text-orientation property of CSS is used to specify the orientation of the text characters in the line of content. This property applies only with the vertical writing-mode and not...

4 minutes read.

Css Box Model

Introduction The Box Model property of CSS is used for design and layout of an html page. In CSS, all the elements has a rectangular box around it, you have to...

5 minutes read.

How to make smooth bounce animation using CSS

The smooth bouncing animation project is done with the help of HTML and CSS. This project gives so much fun and excitement to the users. What is HTML? The HTML or HyperText...

2 minutes read.

How to edit CSS in WordPress

Developing a new website or blog is a difficult undertaking. We want to create something that the consumers will adore, but we might not want the setting to take months and...

7 minutes read.

CSS Inline

What is CSS? CSS is an acronym for Cascading Style Sheets. CSS is the language that we use to style an HTML document. It specifies how HTML components should appear. CSS...

4 minutes read.

What is CSS

CSS stands for Cascading Style Sheet. It gives an additional style to the HTML document. A cascading style sheet is a language that is designed to define the document formatting...

3 minutes read.

CSS Background-clip

CSS Background-clip: The background-clip property describes the background’s painting area. It limits an area where the image or color of the background appears by using any clipping box. Everything will...

2 minutes read.

Is CSS a programming language?

 A programming language is a set of grammatical rules and a vocabulary for commanding a machine to accomplish specified tasks. High-level languages like BASIC, C, C++, COBOL, Java, FORTRAN, Ada...

4 minutes read.

CSS Background Color

It is one of the CSS properties to apply styling to html elements.This property is used to apply the background color to any HTML element.The background of an element includes...

2 minutes read.

Difference between CSS Grid and CSS Flexbox

The way that information is arranged on a website reveals a lot about you or your company. Organizational abilities are just as important as having the right materials. The design...

3 minutes read.

CSS Letter-spacing

CSS Letter-spacing: Letter-spacing attribute is applied to manage the space among all letters within the block or element of the text. This property sets the behavior of the spacing between...

2 minutes read.