[Resolved] header widget or shortcode outside contained header

Home Forums Support [Resolved] header widget or shortcode outside contained header

Home Forums Support header widget or shortcode outside contained header

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #263726
    Jasper

    I have a contained header, but i would like to place the header widget outside the contained area on the rightside of the header. Is that possible?

    #263787
    Tom
    Lead Developer
    Lead Developer

    Any examples of what you’re wanting to do?

    #263797
    Jasper

    Here is an image of what i want to create

    example

    #263801
    Tom
    Lead Developer
    Lead Developer

    If you use the header widget, you could try something like this:

    @media (min-width: 769px) {
        .header-widget {
            position: absolute;
            left: calc(100% + 20px);
        }
    }
    #263860
    Jasper

    thanks that works
    I’m trying to finetune it a little and i wonder if it is possible to calculate a position with reference to the right side of the screen? Or calculate screenwidth-containerwidth. Divide it by 2 and use that to center the widget in the middle of the space between end of container and rightside of the screen?

    #263920
    Tom
    Lead Developer
    Lead Developer

    You would have to use javascript for that I’m afraid. I also don’t know how well that would perform on really large screens or smaller screens.

    I think you’re better off keeping it relative to the site header and then placing it outside the area using the code above.

    #263947
    Jasper

    ok, I’ll keep it that way then, i can always add some more @media queries

    #264055
    Tom
    Lead Developer
    Lead Developer

    That would definitely be the best way to do it 🙂

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