• cbiweb

    (@cbiweb)


    This works…

    CSS:

    #myimage {
     background: url(images/foo.png) no-repeat 0 0;
     width:978px;
     height:277px;
     margin:auto;
     }

    HTML:
    <div id="myimage"></div>

    This does not work…

    CSS:

    #myimage {
     margin:auto;
    }

    HTML:
    <div id="myimage"><img src="images/foo.png" alt="foo" title="foo" width="978" height=277" /></div>

    Can someone explain why? (Not concerned about it being a background image or not, just need to know why the image does NOT show up when it’s coded inline)

Viewing 3 replies - 1 through 3 (of 3 total)
  • Evan Herman

    (@eherman24)

    Can you provide us with a link, so we can play around with it and figure out why?

    It’s most likely because you haven’t specified a style tag:

    <img style="height:277px; width:978px;" >

    Also if you look at your height and width, your missing a ” in the height:

    width="978" height=277"
    Thread Starter cbiweb

    (@cbiweb)

    It’s on my local dev machine, so no link is possible at this point.

    The missing ” is a typo (couldn’t edit my post even when I clicked the ‘Edit’ link :-/ ).

    I wasn’t aware I needed to specify a style tag when the height & width is already specified in the HTML. So I did it anyway, but still no go.

    Another thing I tried was to make the image an empty link like this:
    <a href=""><img src="yada yada" /></a>
    but when I go right-click > view image, the path to it is
    http://localhost/sitename/images/foo.png
    but I expect to see something more like
    http://localhost/sitename/themename/images/foo.png

    It’s been a long time since I worked with WordPress, so I’m obviously missing something or not aware of any new methods that WP is using for images.

    Thread Starter cbiweb

    (@cbiweb)

    Please, I seriously need to resolve this. Where else can I get direct WordPress help but here??

    I do not understand why this does not work:

    <img src="images/myimage.png" alt="foo" style="max-width:100%; height:auto;" />

    The image is not showing up on the page.
    I do see the alt text on the page. When I right-click it, and click View Image, I’m getting a 404, and the browser’s address bar is showing a path like this:

    http://localhost/sitename/images/myimage.png/

    I have no way of knowing what’s wrong, and this is the WordPress support forum. Is there any answer to this?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Inline image not showing up’ is closed to new replies.