• Resolved afmarcom

    (@afmarcom)


    Our company has a “microsite” — a section of the home office’s main website. The website is built on the WordPress platform. I am very familiar with WordPress, but this is a different experience for me because I have very limited access to our microsite’s controls. I have to style our pages with html and inline CSS, because I have no access to any CSS or PHP stylesheets.

    Here is some code that works fine in my code tester and on my own personal WordPress.org website, but is giving me grief on the microsite. What’s happening on the microsite is that there’s a line break immediately before the span tag, so that the last line of the paragraph (the red text) starts on a new line.

    Why might this be happening, and what can I do to prevent it?

    <div style="text-align: justify; width: 85%; line-height: 165%; font-weight: bold;">
    <p style="color: #1d3f75;">Your business needs our awesome product. Our awesome product works quickly and efficiently -- every time you use it. Our awesome products works 'round the clock. When you have concerns, you can reach us, fast! <span style="color:#b2142a;">That's why you need our awesome product.</span></p></div>

    [ No bumping please. ]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi there! It sounds like there may be some conflicting CSS in your theme. If you can send us a link to the site you’re working on, that would make it easier to debug. 🙂

    The first thing I’d try is ensure that your span is an inline element, like so:

    <span style="color:#b2142a; display:inline;">

    Thread Starter afmarcom

    (@afmarcom)

    Thank you! I haven’t been using display:inline, but in this case it’s definitely needed.

    Sound like there may be some CSS code in the main stylesheet for your site that’s setting spans to display: block. Generally the default behaviour for spans in to display inline.

    Happy to hear that fixed your issue! 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Line is breaking after span tag’ is closed to new replies.