• Resolved editorialteam

    (@editorialteam)


    Hi,

    I’m using a separator to separate two sections on a page but the line is quite thick. There doesn’t seem to be any way to change the line thickness? I’m working in the Twenty Twenty Three theme.

    Many thanks.

Viewing 15 replies - 1 through 15 (of 18 total)
  • Hi @editorialteam you can change the width of the line using CSS code, you can adjust 1px to 2px or any other number you would prefer. You can access the CSS editor by adding this after your URL /wp-admin/customize.php and visiting the Additional CSS panel.

     .wp-block-separator {
    border: 3px solid;
    }
    Thread Starter editorialteam

    (@editorialteam)

    Hi @thelmachido,

    Thank you for the heads-up. It doesn’t seem possible though to reduce the line thickness to below 1px. I was hoping to get a very thin line.

    Moderator Kathryn Presner

    (@zoonini)

    Hi @editorialteam – 1px is the lowest possible pixel value when creating a CSS border. That’s because digital screens can either display a pixel, or no pixel, but not a partial pixel.

    More about border values: https://developer.mozilla.org/en-US/docs/Web/CSS/border-width

    That said, you could try using a different unit like em instead of px to try creating the illusion of a thinner line. So something like:

    .wp-block-separator {
      border-width: 0.01em;
    }

    Let me know how it goes!

    • This reply was modified 3 years, 3 months ago by Kathryn Presner. Reason: fixed typo
    Thread Starter editorialteam

    (@editorialteam)

    Hi Kathryn,

    Thanks for the suggestion. Is the syntax “border-width” or “border” for the thickness (not width) of the separator line?

    Many thanks.

    Moderator Kathryn Presner

    (@zoonini)

    Is the syntax “border-width” or “border” for the thickness (not width) of the separator line?

    Hi @editorialteam – you should be able use either. border is the shorthand property, which allows you to add optional properties like color or style to the CSS declaration.

    Moderator Kathryn Presner

    (@zoonini)

    p.s. width is the same as “thickness” in the border context. (It does not refer to the length of the border.)

    Thread Starter editorialteam

    (@editorialteam)

    Thank you for letting me know. Unfortunately, thicknesses below 1px don’t seem to work nor do low values in em.

    Thank you for letting me know. Unfortunately, thicknesses below 1px don’t seem to work nor do low values in em.

    On a test site I can see the difference between using 1px and 0.01em how thin do you want the line to be?

    Screenshot 2023 03 09 at 19 51 10
    This is the default thickness for the separator 👆🏽
    Screenshot 2023 03 09 at 19 49 45
    This is a thinner line after adding 0.01em on the CSS code 👆🏽
    Thread Starter editorialteam

    (@editorialteam)

    Hi,

    Thanks for the advice. As you say, the screenshots clearly show the differences in line thicknesses but this still doesn’t seem to work for me. I’ll have a closer look in due course.

    Many thanks again.

    Moderator Kathryn Presner

    (@zoonini)

    @editorialteam I’d be glad to take a look at this directly to try to see why it doesn’t seem to be working for you. Feel free to provide a link to the page or post on your site. Thanks!

    Thread Starter editorialteam

    (@editorialteam)

    That’s kind of you but I’m working on a staging site at the moment which is not public facing. Presumably the CSS code (copy and paste) is inserted in the ‘Additional CSS’ panel in ‘Customising’? If so, that’s what I have been doing. I’ll have another look in the next day or so. Thank you anyway.

    Moderator Kathryn Presner

    (@zoonini)

    Presumably the CSS code (copy and paste) is inserted in the ‘Additional CSS’ panel in ‘Customising’?

    Yes, that’s exactly where it goes.

    I’ve seen code glitches before (extra unintended characters when copy-pasting, accidentally nested code, dropped curly brackets, etc.) that prevent CSS from rendering correctly, so those are the types of things I was going to look for. You’re also welcome to paste the entire contents of your CSS editor (that Additional CSS panel) here in a Code block so I can have a look and do some testing.

    Thread Starter editorialteam

    (@editorialteam)

    Thank you. This is the code:

    .wp-block-separator {
      border-width: 0.01em;
    }
    Moderator Kathryn Presner

    (@zoonini)

    Thanks – that looks fine.

    What browser and version are you using?
    What operating system?

    Thread Starter editorialteam

    (@editorialteam)

    Using Google Chrome (111.0.5563.64 (Official Build) (64-bit)) and Windows 10 22H2. I’ll try another browser in the meantime. Many thanks.

Viewing 15 replies - 1 through 15 (of 18 total)

The topic ‘Separators’ is closed to new replies.