HTML CSS examples for CSS Layout:Text
Align text to the middle of it's box border
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> .container {<!-- w ww. j a va 2 s .com--> margin:11px 51px; } </style> </head> <body> Problem: <div class="container" style="text-align: center;"> <div> Text </div> <div style="border-left: 1px solid #000; width: 1px; margin-left: auto; margin-right: auto;"> </div> <div> Longer text </div> </div> </body> </html>