Ezhno Ezhno - 12 days ago 6
Javascript Question

Text-align: right; keep a margin no matter what I try

I've got this simple code that displays the Day of the week, the time and the date. The text should be aligned on right, as specified in the css, but I don't know why it doesn't fix itself on the right side of the screen (excluding the margin) it always keep a big space between the side of the window and itself.

https://jsfiddle.net/czh9cam6/

<div class="droite" id="time" >
</div>

#time{
text-align: right;
display:table-cell;
}

.droite{
width: 73%;
display:table-cell;
vertical-align:middle;
}

Answer

Remove display: table; in #aszone and add float: left and float: right to .gauche and .droite respectively.

https://jsfiddle.net/qsdtfztf/

Comments