• Resolved gsef

    (@gsef)


    Hey,

    I have a little problem that has been bugging me for days. What I want is a title, with a pattern as a background underneath it. I have a small pattern that can be repeated for this:

    .diagonaal{
        background: transparent url(https://www.exampleurl.nl/wp-content/uploads/2018/12/diagonal-lines.png) left 70% repeat-x;
    }

    and as html:

    <h2 class="diagonaal">Voorbeeld</h2>

    The problem is that at this point, the background is displayed as wide as the content area, while I want it to be the width of the H2.

    Ideas?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    Please provide a link to a page on your site where we can see this. Thanks.

    Moderator Mel Choyce-Dwan

    (@melchoyce)

    Are you trying to do something like this?

    View post on imgur.com

    If so, I changed it by adding inline-block to your header class:

    .diagonaal {
        display: inline-block;
        background: transparent url(https://www.exampleurl.nl/wp-content/uploads/2018/12/diagonal-lines.png) left 70% repeat-x;
    }
    • This reply was modified 5 years, 11 months ago by Mel Choyce-Dwan. Reason: Fixed some formatting issues
    Thread Starter gsef

    (@gsef)

    Hmmm I already tried that, but might have forgot to clear cache. Worked, tnx!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘max-width background-element’ is closed to new replies.