Site logo

Archived topic

header widget or shortcode outside contained header

7 replies · Started by Jasper on January 13, 2017

Viewing posts 1–8 of 8

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?

Any examples of what you're wanting to do?

Here is an image of what i want to create

example

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

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

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?

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.

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

That would definitely be the best way to do it :)

This archived topic is closed to new replies.