Markus
Markus

Reputation: 1485

General offset for all anchors in HTML?

I have some anchor elements, but they are in absolute position div and the content of the div is so large that it scrolls inside (overflow:auto).

All entries in the div have an anchor on top, but if I go to this anchor I have the element I wanted to directly on top of the side, but I want it in the center. I need something like an offset so I can jump higher than normal.

Upvotes: 6

Views: 20025

Answers (2)

Mikey
Mikey

Reputation: 2951

you could always add another div to wrap around it, and then do something like

.wrapperdiv{
   position:relative;
   top:-10px;
}

Upvotes: 8

Jeremy Stein
Jeremy Stein

Reputation: 19661

You could try a Javascript scroll to correct the position.

Upvotes: -1

Related Questions