[Resolved] Underline H2 but just the text not block?

Home Forums Support [Resolved] Underline H2 but just the text not block?

Home Forums Support Underline H2 but just the text not block?

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #2348160
    Andy

    Hey folks

    As per the title – I want to apply an underline effect to the H2s BUT just to the text rather than the entire block.

    This is the code I’m using currently. I’m not sure what to replace the width 100% with?
    appreciate your help, thanks!

    ETA: I’m using border rather than text decoration as I want that curved/swoosh effect

    `h2{
    position: relative;
    margin-right: 1rem;}
    h2:after {
    content: “”;
    position: absolute;
    bottom: -10px;
    left: 0;
    height: 7px;
    width: 100%;
    border: solid 3px #D7CB83;
    border-color: #D7CB83 transparent transparent transparent;
    border-radius: 30%;
    }

    #2348168
    Fernando
    Customer Support

    Hi Andy,

    Can you provide the link to a page where you’re trying to apply this?

    You may use the Private Information field for this: https://docs.generatepress.com/article/using-the-premium-support-forum/#private-information

    #2348175
    Andy

    Hey Fernando 🙂
    Thanks, see in PI field

    #2348183
    Fernando
    Customer Support

    Try adding width: fit-content to your H2.

    So this code:

    h2{
    position: relative;
    margin-right: 1rem;}

    Becomes:

    h2{
    position: relative;
    margin-right: 1rem;
    width:fit-content;}
    #2348193
    Andy

    Brilliant thanks so much for the solution and also mega quick response. much appreciated:)

    #2348205
    Fernando
    Customer Support

    You’re welcome Andy!

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.