HomeОбразованиеRelated VideosMore From: LearnWebCode

How to Center an Image Horizontally (CSS & HTML Tutorial)

507 ratings | 76800 views
In this video we look at two of the most popular techniques to center images. Check out my "Get a Developer Job" course: https://www.udemy.com/git-a-web-developer-job-mastering-the-modern-workflow/?couponCode=YOUTUBE-HALF-OFF Have you created amazing pages with HTML & CSS and want to move them from your computer’s hard drive to online so the world can see them? The next step is to move your files to a web host. Learn about web hosts, my favorite hosting company, and how to save $40 on the only hosting plan you’ll need: http://learnwebcode.com/web-hosting/ Sign up for my newsletter to receive periodic webDev tips, tricks, resources and coupons. Join the list at http://learnwebcode.com/ Follow LearnWebCode on Twitter for resources and updates: https://twitter.com/learnwebcode
Html code for embedding videos on your blog
Text Comments (62)
Dragonite (5 days ago)
Thank you!
Moon Lovely (7 days ago)
Thank you so much! You helped me with my project! :D
Brenda Motta (29 days ago)
o único que me ajudou mesmo, obrigada
Deron Sobers II (2 months ago)
great video ! very helpful!
王景儀 (3 months ago)
thx!
David Anthony Batten (3 months ago)
But why use such a long way around method?
Wylted 1 (3 months ago)
Literally none of those options worked for me
Paul Elksnis (4 months ago)
This has bugged me for AGES and you have explained it perfectly in less than 5 minutes!!!!! THANK YOU!!! :)
Critical Hacker (4 months ago)
Thank you it really helped me! I didn't know you could use "text-align: center" on an element that is not a paragraph/text.
Just Saiyan (5 months ago)
You're my hero
One Bad Hombre (6 months ago)
You're a great teacher!!
Harry Blackwood (7 months ago)
Thanks dude, this really helped :)
Sinner 02 (8 months ago)
Thanks!! I was looking for this problem for a loooong time then i saw your video... It really helped
GunRhymes Media (8 months ago)
Thaaaaaank youuuuuuuu!!!!!!!!
Osman Halifa (8 months ago)
Thanks man, this really helped
Patrícia Ribeiro (1 year ago)
Dude, your videos are awesome. They're helping me alot. Thanks! and congrats for the great content;
Nicholas Gomez (1 year ago)
Thank you
Tyson Johnson (1 year ago)
Mine still won't center... I have to use an inline-block.. does that change things?
Danny BRITZMAN (1 year ago)
For some reason first method does not work (maybe its different in newer versions?) But the first one works perfectly. Thanks! gotta remember this for next time now.
Petrit Salihu (1 year ago)
thankyou so much !
Rohan Singh (1 year ago)
Thank you so much
SPY4ER (1 year ago)
I love your videos. Thank you very much!
Kenjibaby (1 year ago)
OMG YOU SAVED MY LIFE!!!
FUT Mentor (1 year ago)
Awesome man thanks
Rupesh Vaingankar (1 year ago)
Thanks :)
Code-Grammar (1 year ago)
Thanks dude!
mrhockeypro97 (1 year ago)
Thank You!
Salty Shotgun (1 year ago)
thankyou this helped a lot
WattsUpStudios (1 year ago)
THANK YOU SO FUCKING MUCH
Munchkin (2 years ago)
Thank you so much
Daniel Mannawarajan (2 years ago)
THANKS!!!!
Jad Sayegh (2 years ago)
Great videos. Bite sized and gives just the right amount of detail.
BlackKnight_007 (2 years ago)
thx bro nice video you saved me!
Jebediah's Lab (2 years ago)
I need the picture to be in the center with text flowing around it.. Help!
majed wabbi (10 months ago)
I know I'm late but set the position to absolute.
Lauren Shepherd (1 year ago)
Jebediah's Lab same :(
felly fell (2 years ago)
will this work in the figure tag?
Renzo Beronilla (2 years ago)
great tutorial. thanks
TheSecondAntagoniser (3 years ago)
Nice tutorial and very informative.
FIRE PRINCE (3 years ago)
thank you! i can set iamge in the center finally :)
Robert Chhangte (3 years ago)
simple and clear..thanks
Ernest Watson (3 years ago)
WOW, YOU ARE THE MAN, I LOVE YOU BRO.  Sway voice.
NAT T (3 years ago)
Thank you so much, you make explain it so clearly. :D
Ben Dover (3 years ago)
great video, thanks so much!!
Spoky (4 years ago)
Anyone know what program he's using for this? I'd rather not use notepad.
Calvin Pedersen (3 years ago)
+Hylan143 U should use sublime, it is an awesome program!
Chaib Ahmed (4 years ago)
thank's that's was helpful i use it for my website
Jonathan Bell (4 years ago)
Thanks, I've used this for my websites. You've now earned a new subscriber :)
Brendan Campbell (4 years ago)
Anyone tell me why you would use one option over the other? Is the block element one just better if you want to have the image in a very particular area of the page? 
george0700 (5 years ago)
maaaan this man is GUNIUS I learn a lot from this his my teacher 
Lil Huck (5 years ago)
Thanks. Very nice vid
Ken Olson (5 years ago)
Awesome bro thanks(: just started learning HTML today and got so many other options offered of which none of them worked. Thanks again
roroleeeen (5 years ago)
simple and easy! thnx for the toturial
Nathan Burtenshaw (5 years ago)
Thank you so much you saved my ICT assessment
biteTHEretard (5 years ago)
Thank you! You're a GOD!!!!!
Jeremy K. (5 years ago)
Bless your heart for making this so clear!
Cutty Flam (5 years ago)
thank you very much for sharing this
Prasanna Tilakaratna (5 years ago)
i have looked every where for this basic advice, yet amazingly, it was only your video that made things crystal clear. thank you.
Hussam Sibai (5 years ago)
was helpful ..thankyou ;
Andrius St (5 years ago)
aaand How to Center an Image Verticaly?
Paul Elksnis (5 years ago)
and mine!!!!
MickJnr7 (5 years ago)
My favorite channel on youtube

Would you like to comment?

Join YouTube for a free account, or sign in if you are already a member.