Streaming live at 10am (PST)

In-Page Linking Position


#1

Hi all,

Does anyone know how to adjust in-page linking so that the linked page section is in the middle of the screen, rather than at the top?

So, it currently looks like this:

And I'd like it to look like this:

Thank you! :grinning:


#2

I am not sure if you can without custom code @bart is the master of the JS that does that so maybe he has an idea.


#3

@DFink: Thanks! I'm not really interested in using custom code. (I'm not a fan of how custom code only shows on published sites – goes against the whole reason I use Webflow.) I was hoping there might be a way to do it via interactions.

Thanks for the help, though! :grinning:


#4

Try to put a absolute positioned div (height, width 0px) into your section which should be position: relative. Than give this div an ID. Now, because it's absolute, you can lift this anchor div up with your position top property and target it with your link.

Hope you understand what I am trying to say in my german english. Feel free to ask if you have questions.


#5

You really should be testing all your sites on your subdomain anyway. There are lots of things in the editor that may look very different in your browser and you will definitely be met with sites that do not load as expected if you only use the webflow preview. I stopped even using the preview mode on webflow in favor of pushing it to the subdomain and having another window open ready to refresh. This is how developers also work because browsers will always render a site differently.

That being said, @zackete_de's idea is a good one. You would have to use an absolute positioned div or element placed above the area you want to be centered and link to that element instead. The issue is that if your browser changes height or width from the one you test it on, it will be off by a certain amount. Custom code really seems the only way to do this so it works across all media queries.


#6

Hey guys :slightly_smiling:

I am sure you'll enjoy Vlad's post here:


#7

@bart

Brilliant! Thank you! :grinning::grinning:


#8

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.