Image height and width not working?

On this post I have set the image height and width and it’s clearly seen in the HTML..

[url removed]

Read More

But the browser or WordPress is causing the image to stay same size.

I want it to be smaller?

Related posts

Leave a Reply

4 comments

  1. You must write

    <img src="theSource" style="width:30px;height:auto;" />
    

    Inline styling will always take precedence over CSS styling. The width and height attributes are being overridden by your stylesheet, so you need to switch to this format.

  2. You have a class on your CSS that is overwriting your width and height, the class reads as such:

    .postItem img {
        height: auto;
        width: 450px;
    }
    

    Remove that and your width/height properties on the img tag should work.

  3. http://www.markrafferty.com/wp-content/w3tc/min/7415c412.e68ae1.css

    Line 11:

    .postItem img {
        height: auto;
        width: 450px;
    }
    

    You can either edit your CSS, or you can listen to Mageek and use INLINE STYLING to override the CSS styling that’s happening:

    <img src="theSource" style="width:30px;" />
    

    Avoid setting both width and height, as the image itself might not be scaled proportionally. But you can set the dimensions to whatever you want, as per Mageek’s example.

  4. First of all check if you have the link tag that points towards the .css file like below cuz what happened to me is that i didn’t use the link tag to specify the .css file that i wanted to use because of that i wasn’t able to use it and like an idiot i kept refreshing the page wondering what was wrong with the file. so if you don’t want to embarrass yourself then check that first then try the answers above. Hopefully it was helpful.

     <link rel="stylesheet" href="ProjectStyle.css">