• 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="https://www.marketingoutloud.com">
    <img src="https://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="https://www.marketingoutloud.com"> <br>
    <img src="https://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: https://www.marketingoutloud.com/test-page/

    Thanks much!!

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

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

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

    Thread Starter skippywp

    (@skippywp)

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

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Try wrapping your anchor tag in a <div>.

    Thread Starter skippywp

    (@skippywp)

    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.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

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

    Thread Starter skippywp

    (@skippywp)

    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.