How to center an image img in HTML using CSS
Questions
Student Gallery
Course info
Overview
- a simple but elegant restaurant website.
- a bike repair website.
- a responsive portfolio website.
- a Bootstrap website.
You will...
- Learn how to work with responsive images and icons. and stunning full screen background images and probably one too many gradients.
- Learn how to create forms and to choose great fonts for your website.
- Learn how to work with Bootstrap 4 to easily add carousels, cards and complex looking menus.
- Setup a domain name with hosting so that your website is live on the internet for others to see.
There are fun class projects for you to work on which will enable you to practice what you learn. By the end of this course you’ll have a great understanding of important web design topics like HTML5, CSS3, Flex box, Responsive design and Bootstrap.
Course duration 16 hours 42 mins
Daniel Scott
Founder of Bring Your Own Laptop & Chief Instructor
I discovered the world of design as an art student when I stumbled upon a lab full of green & blue iMac G3’s. My initial curiosity around using the computer to create ‘art’ developed into a full-blown passion, eventually leading me to become a digital designer and founder of Bring Your Own Laptop.
Sharing and teaching are a huge part of who I am. As a certified Adobe instructor, I've had the honor of winning multiple Adobe teaching awards at their annual MAX conference. I see Bring Your Own Laptop as the supportive community I wished for when I was first starting out and intimidated by design. Through teaching, I hope to bring others along for the ride and empower my students to bring their stories, labors of love, and art into the world.
True to my Kiwi roots, I've lived in many places, and currently, I reside in Ireland with my wife and kids.
Certificates
We’re awarding certificates for this course!
Check out the How to earn your certificate video for instructions on how to earn yours and click the available certificate levels below for more information.
Downloads & Exercise files
Transcript
So we want to center this image inside the Header. The easiest way to do it in this case is, the Header, let's have a look at our design. We'll center everything that's inside of it, because that's the only thing in this Header, there's nothing in this-- the Navigation's outside of the Header box, it's just an image, so it's nice and easy. So let's find the Header, Style, over here. Let's align it to the center, and we'll use Text Align, and you're like, "Hey, why are you using Text Align, Center." That's just the way it is.
Text Align Center works really good for, horizontally? I get this wrong all the time, horizontal, vertical, you know what I mean, in the middle, that way. Text Align Center works really well. Let's test it, preview in the browser. And inside of my Header everything is Text Align:Center.
All right, that is how to get our little image in the middle. Let's move on to the-- let's start working with some of the text in this document. Next video, please.