I would like to have it the same as the example in Advanced Styling.
I added the example code in “screen.css” ( is that correct, or should I add it somewhere else? Also tried global.css)
However, I think .post-content changed to .gh-content
But can’t find what .post-full-content changed to. (Now tried both .article and .post).
The navigation menu is still below my image, and not on the side.
Do you have any advice on what to do?
(Context: I have no developing experience at all haha, just downloaded visual studio code to create this fixed side navigation menu. So probably it’s a very stupid question, but thank you so much in advance for helping me out!)
So, the TOC is now sharing space with your content, so there’s just less room, which is why your content has become so narrow. Unfortunately, to give the page more space to work it would require some serious reworking of your CSS.
Another approach would be to always have the TOC appear in the same column as your content. That way, your content won’t have to fight for space with the TOC.
Unfortunately, that tutorial doesn’t apply to your theme.
You could try adding the following to your Site Header in Settings > Code Injection. Because this change could affect lots of different pages on your site, you’ll want to test other pages to make sure nothing looks askew.
In the example below, I’ve increased the width by 200 px. However, you can change the 920 value below up or down to suit your needs.
The errors I have run into include ToC showing up on top of content, ToC overlapping on top of Header and/or Footer (see here), or ToC not showing up at all.
I would love to have the ToC show up as sticky on the left side of the post. Feel free to let me know if you find another workaround
Hi, @RyanF thanks so much for replying, yes I’ll have no problem moving some HTML around in the theme, I just have no idea about modern CSS, I only did a bit of CSS many years ago.
Thanks very much for the idea @denvergeeks, I did try that already by drag-drop in Chrome tools, but I did not try the additional:
.c-sidebar {
position: absolute;
}
…that you suggested (the other CSS is there already as per Ryan’s guide), but I tried that now and it makes everything else in the sidebar bleed to the right.
Happy to wait until next week for further suggestions from @RyanF (or others), have a great weekend.
I find it quite surprising that the development team is recommending the Table of Contents for the tutorial without thoroughly testing its impact on mobile devices. The excessive Content Layout Shifts (CLS) it causes could have been avoided with the guidance of an SEO specialist.