Browser is replacing Multiple space between words to the single space in html page. for e.g if my text is \'AB-DC 3\'
in Browser its showing \'AB-DC 3\'<
On the Op scenario:
Use white-space:pre;
(no wrap except at
) or white-space:pre-wrap;
(wrap when needed).
Example:
body{
margin: 0;
}
div {
width: 200px;
height: 100px;
}
#a {
white-space:pre;
background: gold;
}
#b {
white-space:pre-wrap;
background: skyblue;
}
This is some Text writen on here as example.
Here's a second sentence after the line-break .
This is some Text writen on here as example.
Here's a second sentence after the line-break .
Single White spaces:
Sometimes you need to use single spaces, like at the start of a sentence (when it is ignored). In situations like this, the best choice is to use
instead.
Example:
p:nth-of-type(1) {
font-size: 2em;
background: tomato;
}
p:nth-of-type(2) {
font-size: 2em;
background: greenyellow;
}
content
content