![]() |
Cross-browser: Non-breaking space
Hey guys,
I have a breadcrumbs list that shows users what page they are browsing relative to the main page. The list is made using an ul and after each link in every list item (except for the last one) I am using the below to inset an arrow + an extra space: Code:
#breadCrumbs a:after {Code:
Code:
 Code:
*+html #breadCrumbs a:after { |
Why not use
white-space: nowrap on the list? |
Dear VIPSpethan,
I'm not sure we're talking about the same. As far as I can read, the white-space:nowrap; collapses whitespace into a single space. What I want to is preserve the extra whitespace after the arrow. I tried to do that with the above formats of the non-breaking space but that turns out to either work in some browsers while displaying the code as text instead of a whitespace in others (and vice versa). So, I'm still looking for an universal solution to preserve the extra space. |
Well, then use the CSS
margin property to adjust space with pixel precision. You shouldn’t use HTML to achieve a certain look (and a non-breaking space is basically that), that’s what CSS is there for. You can add a margin to the generated content (the :after rule), too. |
Quote:
However white-space : nowrap is the solution to your problem of not having a particular space break. Simply wrap the content either side of the space inside a span and apply the style to that. |
Margin did the trick - I did not even consider that posibility!
Thank you both for your answers! |
| All times are GMT +1. The time now is 12:14 PM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.