Can't apply this CSS class to HTML image


#1

I’m trying to center and make this image smaller here is my CSS code:

.header-image {
display: block;
margin: 0 auto;
height: 50px;
width: 50px;

And here is the HTML code:

<.img class= “header-image” src=“https://yt3.ggpht.com/-a8bYN51UgSs/AAAAAAAAAAI/AAAAAAAAAAA/sd1uAVAwKRk/s900-c-k-no-mo-rj-c0xffffff/photo.jpg”>

(I put a period in front of the img element so you can see the code and not the picture.)
Thanks in advanced :slight_smile:


#2

If you copied directly from your HTML file, you have smart quotes around “header-image” and around the URL instead of normal quotes. Try replacing all of those.

This is unneccessary, since formatting a segment as code will prevent the forum from parsing it at all.


#3

I’m sorry but what do you mean by “smart quotes”?


#4

Just look at the quote characters. You can tell the difference between “” and "", and from the perspective of computer programs, they’re not the same thing at all. If you need an example of smart quotes not working like normal quotes, look here.


#5

In my code I have smart quotes for some reason when I pasted it into the thread it changed. I also entered my code into CodePen to see if it was my error but the code worked in CodePen so now it seems like there is an error in Atom.


#6

All I can go on is what you’ve posted here. You should screenshot your actual files so that I can see precisely what you’re working with.