Hello. How to do text in center, center. I mean this text-align: center; is centering in width page. How to center the text in height page? BTW if the page is height: 100%, min-height: 100%, max-height: 100%
So how to do? I don’t understand there. -.- I mean not working.
This works for me. Just for single line, use `line-height`:
text-align:center; /* center horizontally */
line-height:200px; /* same with height (center vertically) */
I was saying that height is 100% with line-height: 200px deosn’t centering.
Why not working? http://jsfiddle.net/chriscoyier/hJtpF/
It is working.
Look, put whatever code you are using into Codepen or jsFiddle or provide us with a live link.
Here it is ⇒ http://jsfiddle.net/tovic/hJtpF/3162/
var $el = $('#message-activate'),
el_w = $el.outerWidth(),
el_h = $el.outerHeight();
'margin-left': '-' + (el_w / 2) + 'px',
'margin-top': '-' + (el_h / 2) + 'px'
I also have a script someone made for me. Although it’s specifically for an image, you can change the jQuery a bit to fit your needs. http://christopherburton.net/includes/center.js
Why not working like this?
P.S. Thanks for ChristopherBurton and Hompimpa. BTW why not working?
Seriously, just make a JSFiddle…
@nuodas159 Do you mean like this? http://jsfiddle.net/hJtpF/3166/
Nope I need this #message-activate to be vertical center
You must be logged in to reply to this topic.