This lesson, I'll show you how you can vertically center elements or images by using just a bit of jQuery (javascript library). For more tips and tutorials, please visit www.detachedesigns.com/blog
Nice trick Jeffrey Jordan Way but will this work on a scrolling page? i.e. will the image remain vertically centered even if we scroll up n down the page ?
On my channel i've got a tutorial on how to do this with just HTML and CSS
NewProjectDesigns 11 months ago
@selecto16 You can't do that dude everyone doesn't have the same pixel aspect ratio
watchmyshoes22 11 months ago
Thanks!
masterbip 1 year ago
@selecto16
you meant: margin-top: -200px ;)
vidast 2 years ago
You dont neen jQuery to vertically position an element; you can do it with CSS, this way:
position:absolute;
width:500px;
height:400px;
margin-left:-250px;
margin-top:200px;
top:50%;
left:50%
There you go. The margin is halp of the width/height, in negative ;-)
selecto16 2 years ago
if you want me to give you proper JQuery Tutorials (easy to follow and suitable for any one) Message me with a subject: JQuery and message: yes
tholithemba 2 years ago
nice video's very usefull! but please make sure your next vids are of better quality
nickoooname 2 years ago
Nice trick Jeffrey Jordan Way but will this work on a scrolling page? i.e. will the image remain vertically centered even if we scroll up n down the page ?
thug0rule 3 years ago
Nice! I like how everything is so easy with jQuery.
ReFreezed 3 years ago