Support » Fixing WordPress » How to remove breaks in entry-content for an anchor image

  • For some reason there are breaks getting generated with div class=”entry-content”. This is putting an empty line above my image. Is there a workaround to eliminate the breaks so I can get rid of the empty line above the image?

    Here is the original code:

    <a href="http://www.marketingoutloud.com">
    <img src="http://www.marketingoutloud.com/wp-content/uploads/2012/03/MOL-logo1-e1331494734582.jpg" alt="" height="110" width="100"><br>
    </a>

    Here is the generated code from Firefox:

    <div class="entry-content">
    <p>Trying to figure out how to eliminate the breaks in entry-content for just this anchor. <br>
    <a href="http://www.marketingoutloud.com"> <br>
    <img src="http://www.marketingoutloud.com/wp-content/uploads/2012/03/MOL-logo1-e1331494734582.jpg" alt="" height="110" width="100"> <br>
    </a></p>
    </div>

    Using FF to inspect element – img, the dashed border display is around the image which is good. When inspecting the element “a” (anchor), the dashed border is around the image plus space above the image. I want the anchor and the image to be the same size or at least to eliminate the empty line above the image. I’ve tried display:inline and border=”0″ with no luck. I think the only solution is to take out the generated breaks but I don’t know how to do this. Any suggestions are welcomed.

    For reference: http://www.marketingoutloud.com/test-page/

    Thanks much!!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Moderator Andrew Nevins

    (@anevins)

    Can you provide a working example of this problem, “‘s“. I really don’t know what that means.

    Andrew, Breaks is what I meant. I was using the html for break and it got wiped out. 🙂

    Moderator Andrew Nevins

    (@anevins)

    Try wrapping your anchor tag in a <div>.

    Unfortunately, the div did not work. I am still a newbie, so maybe I didn’t do it right. I did find this

    Note: By default, browsers always place a line break before and after the <div> element. However, this can be changed with CSS.

    I could try this but not sure how to change it with CSS or inline and this may be going in the wrong direction to take out the breaks.

    Moderator Andrew Nevins

    (@anevins)

    Does this line-break issue only occur with an anchor tag wrapping the image?

    I used the same code in 2 different themes on 2 different host servers and I get the same result. I am using the WordPress editor to create the html code. Not sure if this problem exists with other code (I haven’t noticed this in other areas).

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘How to remove breaks in entry-content for an anchor image’ is closed to new replies.