WordPress.org

Ready to get started?Download WordPress

Forums

How to remove breaks in entry-content for an anchor image (7 posts)

  1. skippywp
    Member
    Posted 1 year ago #

    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!!

  2. Andrew
    Forum Moderator
    Posted 1 year ago #

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

  3. skippywp
    Member
    Posted 1 year ago #

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

  4. Andrew
    Forum Moderator
    Posted 1 year ago #

    Try wrapping your anchor tag in a <div>.

  5. skippywp
    Member
    Posted 1 year ago #

    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.

  6. Andrew
    Forum Moderator
    Posted 1 year ago #

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

  7. skippywp
    Member
    Posted 1 year ago #

    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).

Topic Closed

This topic has been closed to new replies.

About this Topic