Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can a URL fragment affect a CSS layout?

Compare these 3 URLs (look at the top navigation bar in each case):

  1. http://fast.kirkdesigns.co.uk/blog
  2. as above but with the url fragment #navigation
  3. as above but with the url fragment #node-2655

Note, that the only difference is the URL fragment on the end.

The first two pages display absolutely fine (in Firefox at least). It's the third one where the problem lies. The fragment #node-2655 pushes the top navbar off the top of the screen. When you then scroll back up to the top of the page, the navbar has been cut in half. This happens when using any URL fragment that causes the navbar to be out of the initial viewport when the page is first loaded.

So, how can using a url fragment affect the css layout like this?!

THE SOLUTION: as suggested below, removing the overflow: hidden on the container element that held the navbar fixed the problem. I'd love to understand why though!

like image 450
user148908 Avatar asked Dec 10 '22 19:12

user148908


2 Answers

Remove the overflow:hidden on #main in css_75afd7072eaf4096aaebf60674218e31.css

like image 90
Emily Avatar answered Jan 03 '23 04:01

Emily


I'd say it's a rendering bug in FireFox as it's fine in Opera. There shouldn't be anyway an anchor would change the CSS like you say (unless you are using jQuery or something).

like image 24
Dan Diplo Avatar answered Jan 03 '23 04:01

Dan Diplo