css - How can I center the block of text without the next line being centered relative to the top line? -


i need center text. used text-align center next line gets centered. need aligned line on top.

<div class="box"> <div class="text">some text.some text.some text.some text.some text.some text.some text.     text.some text.some text.some text.some text.</div> </div> 

how can center block of text without next line being centered relative top line?

http://jsfiddle.net/heq9h/

one cheap way wrap text inside element you've did, nearest width, text ends perfect instead of wrapping other line leaving large space on right, , use margin: auto;

demo

.text {     width: 490px;     margin: 0 auto; } 

Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -