5 Comments
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
by
Radio2, Sep 24, 2019, 4:47 AM
- Report
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Hi levans,
The pleasure is all mine.
Since we're limited to what we can do with blog CSS, my solution isn't perfect, but it's good enough.
I'll let you in on one secret: At narrow screen widths the sidebar content isn't really hidden. But it's lower on the page than all of the posts. With infinite scroll, it keeps moving further and further down. You'd end up seeing it again if you scroll all the way to the last post in the blog.
The next part of the CSS relies on ensuring that #main has a background color of white and that it is above the gray background of whatever the surrounding div is -- I forget if that's #content or #wrapper or something else. But #main needs to be able to cover it up at all widths.
Finally -- and this is the important part -- I used calc to change the width of #main dynamically since we can't use media queries.
Putting it all together, I have:
I tried using calc to give the sidebar content a width of 0 when the screen is narrow, but it wouldn't go away entirely. It could be that this content is getting a non-zero min-width further down the cascade? I dunno. But at that point I had decided that things were good enough for now and that I can try again in the future.
The pleasure is all mine.
Since we're limited to what we can do with blog CSS, my solution isn't perfect, but it's good enough.
I'll let you in on one secret: At narrow screen widths the sidebar content isn't really hidden. But it's lower on the page than all of the posts. With infinite scroll, it keeps moving further and further down. You'd end up seeing it again if you scroll all the way to the last post in the blog.
The next part of the CSS relies on ensuring that #main has a background color of white and that it is above the gray background of whatever the surrounding div is -- I forget if that's #content or #wrapper or something else. But #main needs to be able to cover it up at all widths.
Finally -- and this is the important part -- I used calc to change the width of #main dynamically since we can't use media queries.
Putting it all together, I have:
#main {
min-width: calc(100% - 260px);
width: calc((786px - 100%) * 1000);
max-width: 100%;
background-color: white;
border: none;
z-index: 5;
}
I tried using calc to give the sidebar content a width of 0 when the screen is narrow, but it wouldn't go away entirely. It could be that this content is getting a non-zero min-width further down the cascade? I dunno. But at that point I had decided that things were good enough for now and that I can try again in the future.
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Archives




















































Shouts
Submit
302 shouts
About Owner
- Posts: 5190
- Joined: Apr 27, 2007
Blog Stats
- Blog created: Jul 27, 2011
- Total entries: 105
- Total visits: 107928
- Total comments: 616
Search Blog