Itsik Mauyhas Itsik Mauyhas - 19 days ago 8
CSS Question

Add constant size to border-style:dotted(CSS)

I have a

span
that has with
border-style:dotted
and I want to add fixed size for this element, example, if I add text to this span the size auto incearsed, is there a CSS proprety to add fixed size(creating a empty dotted element)?

code without fixed size:

<span style="border-width:1px;border-style:dotted;font-size:11pt"> <font face="David" class="ng-binding">
&nbsp;</font></span>

Answer

You need to add the display: block; CSS property with a width.

Try this:

<span style="display:block; width: 100px; border-width: 1px; border-style: dotted; font-size: 11pt">
    <font face="David" class="ng-binding">
        &nbsp;
    </font>
</span>

Where the width value can be whatever desired width you want. I just used 100px as an example.

Comments