Can't apply this CSS class to HTML image


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=“”>

(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:


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.


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


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.


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.


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.