C.Ronaldo C.Ronaldo - 1 year ago 63
HTML Question

Keeping space after top gets fixed

I have created a function where menu gets fixed when I scroll down.
But when that happens, it takes a lot of space with it, as you can see in my demo:
https://jsfiddle.net/h65x3hyb/ all the text goes behind the fixed bar instead.

Is there a way to keep a little bit more space between

which gets fixed and

Answer Source

You must to play with the padding-top of the content when the top is fixed. So the whole solution is:

.top.fixed + .content {
    padding-top: 155px;

Your edited fiddle:


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download