I do not think that this can be done exclusively with CSS. Elements with position: fixed
are derived from the normal page flow, so they are not used when calculating the position of other elements on the page.
I assume that you could display two headers, one with position: fixed
and the other without such an ad (and possibly with "active" page elements such as links, input fields or buttons replaced with static text) that are only used to move other page elements down. That would be a terrible hack, though.
source share