- Last post
- 13 Responses
I have a div set to :
I want text to be vertically centered and horizontally.
What's in the element? If it's just a single line of text without linebreaks, you can vertically center it by setting line-height to the same as height.
Otherwise, you'll need to use one of the techniques described here: https://css-tricks.com/centering…
This is why I hate css.
@chow.. i can't manage to make it work..
Can you take a look at my page here http://goo.gl/qJxFUe and tell me exactly what i need to do? The word needs to be centered on splash image.
You either need a bunch of nested divs and fake a table cell within a table layout to make vertical-align: middle work, or I believe you can do it with flexbox.
geezus... how can something so simple be so complicated? ...
no shit, I can't believe it's 2015 and there's still no simple way of doing this
You have a div and spans nesting the text. Can you just have one span and set the line height to 100vh?
Flexbox would be easy if you didn't need full browser support.
line-height: 100px; /* same as height */
margin-top: -50px; /* half of height */
Please tell me where to send the invoice.
- Sure it does. Try replacing the selector with .splash-header > .splouche1-text-boxchow
- Otherwise send me a link to the broken page with my CSS snippetchow
- check the updated page with yourcode here: http://goo.gl/qJxFUe… dont render the same on the server VS Dreamweaver in-Chrome previewbenfal99
- 1. I don't see my code anywhere on that page. 2. Don't use Dreamweaver.chow
- always easy to blame Dreamweaver - why? Its a code editor like anything else - just avoid the WYSIWYGfadein11
background-position: center top;
THANK YOU vwsung18t !!!!1! it work!!
thanks a lot too chow!!