Using the :after
will solve the problem of keeping the °C unit identifier at the end of each temperature. To create the yellow box, just use a span
element set to display:inline-block
and add a fixed width, like so:
(FIDDLE)
HTML
<div><span>-129.4</span></div>
CSS
div {
width:120px;
}
div:after {
content:" °C"
}
span {
text-align:right;
width:80px;
display:inline-block;
background-color:yellow;
}
Note: Edit the CSS to use classes for each element instead of tag names.
solved How to make characters to be written from right to left in HTML [closed]