[Solved] Type spacing issue on All Categories page in default installation
I've noticed an odd spacing issue when you press the 'Categories' link, as you'll see at the link to my page there is no space before 'Most recent' nor before the time, like this:
3 discussions 179 commentsMost recent: Suggest a category by name8:23PM
Excuse my messy style.css. I still haven't moved out my new styling to a custom.css. But the above seems to be a problem with the default installation. Any ideas how to correct it most welcome. Or even how to disable the 'Categories' link on the sidebar, as it doesn't seem of much use.
Thanks.
Best Answer
-
hgtonight MVP
That is nefarious!
This is actually due to a lack of whitespace in the source, not a CSS issue. Open up
/applications/vanilla/views/categories/all.php
and add a space right after the first single quote'
on lines 67 and 72.This was fixed in 2.1 by giving all the meta spans a specific class and setting up the margins explicitly.
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
1
Answers
That is nefarious!
This is actually due to a lack of whitespace in the source, not a CSS issue. Open up
/applications/vanilla/views/categories/all.php
and add a space right after the first single quote'
on lines 67 and 72.This was fixed in 2.1 by giving all the meta spans a specific class and setting up the margins explicitly.
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
Brilliant! Solved that. Thanks very much @hgtonight. Can't beat highly specific know-how.
Out of interest, how would you add more than a single space at line 67, so the spacing is the same as on All Discussions? I see just typing in spaces doesn't work.
Browsers treat white space between elements as a boolean. There either is whitespace, or there isn't. You could force extra whitespace with an html entity like
but that is a terrible practice.It would be better to just use some CSS to fix any margins you have. Add this declaration to your custom theme's CSS file.
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
I tried your CSS. I can see that it should work fine, but for some reason it doesn't. It's not important, a single space is fine.
Ignore that last comment. It work's great, I was uploading to the wrong directory...
You could also add this declaration to preserve all spaces:
white-space: pre;
Add Pages to Vanilla with the Basic Pages app