Reputation: 159
I am trying to show message in <h5>
<h5>S e n t i m e n t a n a l y s i s</h5>
Codepan : CODEPAN
css:
h5
{
margin-left: 36%;
color:#C0C0C0;
text-decoration:underline;
}
It should show space between each character and two space between word. but it shows all character continuously without space.
Upvotes: 2
Views: 570
Reputation: 12743
Change the html to normal word.
HTML
<h5>Sentiment analysis</h5>
CSS
letter-spacing is for space between letter. And word-spacing is for space between word.
h5
{
margin-left: 36%;
color:#C0C0C0;
text-decoration:underline;
letter-spacing:4px;
word-spacing : 5px;
}
DEMO : http://cdpn.io/EvFsD
Upvotes: 1
Reputation: 93
For spacing between letters use "letter-spacing" and likewise for word spacing use "word-spacing"
h5{
letter-spacing : 3px;
word-spacing : 5px;
}
You can change the px value as per your requirement.
Upvotes: 1
Reputation: 21130
You must use the property white-space
, specifically pre-wrap
.
h5 {
margin-left: 36%;
color: #C0C0C0;
text-decoration: underline;
white-space: pre-wrap;
}
You can find more information about this property here.
Upvotes: 1
Reputation: 17366
Use letter-spacing
css rule
h5
{
margin-left: 36%;
color:#C0C0C0;
text-decoration:underline;
letter-spacing: .5em;
}
Upvotes: 1
Reputation: 15699
Use letter-spacing
property.
HTML:
<h5>Sentiment analysis</h5>
CSS:
h5{
margin-left: 36%;
color:#C0C0C0;
text-decoration:underline;
letter-spacing:10px;
}
Upvotes: 3
Reputation: 780869
Use the white-space: pre
style to preserve white space.
h5
{
margin-left: 36%;
color:#C0C0C0;
text-decoration:underline;
white-space: pre;
}
Upvotes: 4