• Resolved Lesley

    (@cornucopia-design)


    I look after a site for a client. I didn’t build myself and can’t get help from the original builder. I know a little about css but not enough to see where this problem is.

    On this sample page http://ernestcooktrust.org.uk/test-spacing/ I have set up three paras of text, all with lines separated with breaks (the format actually used for contact addresses in the site itself). The first para does what I would expect and is spaced correctly. Subsequent paras seem to be spaced out more than they should for all lines (the last one in each para is slightly closer but still not close enough). The spacing should be consistent throughout. The fourth para shows how continuous text is spaced (same as first block).

    I have been testing out the css all afternoon but just can’t see what’s wrong. it’s probably something really simple but I just can’t see it myself. Can anyone out there help please? I really don’t know what to do.

    Many thanks.

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

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Here is the HTML of the 3 paragraphs:

    <p class="lead"><strong>1st item with spacing as expected</strong><br> This is the first line<br> This is a second line<br> Third line</p>
    <p><strong>2nd item which seems to be spaced out</strong><br> This is the first line<br> This is a second line<br> Except for the third line which is spaced as expected</p>
    
    <p><strong>3rd item</strong><br> This is the first line<br> This is a second line<br> Third line</p>
    
    <p>All three paragraphs above have been set up identically. I can’t see why subsequent paras have all lines spaced out except for the last one. This para shows how normal text is spaced. All the three blocks above are separate paras but the individual lines are just breaks.</p>

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    As you can see, the difference is that one of the paragraphs is styled with the class of ‘lead’.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    If you look at the CSS for the ‘lead’ class, you will find this:

    .lead {
        ...
        font-size: 21px;
        font-weight: 200;
        line-height: 30px;
    }
    .lead {
        font-family: 'ArsenalRegular';
        font-size: 14px !important;
        line-height: 20px !important;
        color: #61726C !important;
        font-weight: normal !important;
    }

    Thread Starter Lesley

    (@cornucopia-design)

    Andrew, thanks so much for responding SO quickly. I could see what you are saying about the lead class. I have now put exactly the same text in the sidebar and there it behaves as I would expect, with spacing correct throughout. The first para in the main content area is also correct. So I could see that it’s the breaks on para 2 and para 3 which are wrong but I couldn’t see how to put them right.

    However, I think you have pointed me in the right direction as I’ve now worked out that it’s the break style which is at fault .main-content-home br and if I make the line style there 20px it appears to resolve it (tested with firebug only at this stage). I’ve just got to check that there’s no knock-on effect elsewhere before applying it.

    So, thank you so much for pointing me in the right direction. Hopefully tomorrow I’ll be able to mark this as resolved… but not quite yet!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Spacing irregularity probably css clash’ is closed to new replies.