You get a bonus - 1 coin for daily activity. Now you have 1 coin

How to center an invisible element or find the width and height of an invisible element?

Practice




how to align an invisible element to the center or how to find out the width and height of an invisible element?


var $top=($(window).height() - $('.main').outerHeight())/2;
var $left = ($(window).width() - $('.main').outerWidth())/2;
if ($top<0)$top=0;
$('.main ').css({
position:'absolute',
left: $left,
top: $top
});

but for invisible elements there is no height before rendering.....(((

so use

visibility: hidden

Comments

To leave a comment

If you have any suggestion, idea, thanks or comment, feel free to write. We really value feedback and are glad to hear your opinion.
To reply

Lectures and tutorial on "Running server side scripts using PHP as an example (LAMP)"

Terms: Running server side scripts using PHP as an example (LAMP)