Question: How can I align text to the right with uniform dot spacing using simple CSS, as seen in this example?
Drug 1 ............ 10ml Another drug ...... 50ml Third ............. 100ml
Answer: To achieve this justification, a technique utilizing the :after pseudo-element is commonly employed:
CSS:
dl { width: 400px } dt { float: left; width: 300px; overflow: hidden; white-space: nowrap } dd { float: left; width: 100px; overflow: hidden } dt:after { content: " .................................................................................." }
HTML:
Limitations:
Disclaimer: All resources provided are partly from the Internet. If there is any infringement of your copyright or other rights and interests, please explain the detailed reasons and provide proof of copyright or rights and interests and then send it to the email: [email protected] We will handle it for you as soon as possible.
Copyright© 2022 湘ICP备2022001581号-3