Is hiding a <br />
tag with CSS a well defined way to make line breaks conditional on the definition of the tag's CSS style? Is it portable across browsers? When I want it to show, is "inline" the best display type to use?
Given the following CSS and HTML,
<style type="text/css">
.maybe-hidden {display:inline}
</style>
abra<br class='maybe-hidden' />
ca<br class='maybe-hidden' />
dabra<br class='maybe-hidden' />
I expect to see:
abra
ca
dabra
Changing the maybe-hidden to be maybe-hidden {display:hidden}
, I expect to see
abracadabra
EDIT:
I appreciate the answers about how better to do this. What I perhaps failed to say is that this would be in generated HTML, and changing the CSS class of the actual element, as some suggested, would not be feasible.
But changing the style's definition is feasible, as is changing the class of the parent/enclosing/containing HTML element.
That's why I needed to know if this was well-defined. While I'm going to accept an answer that answered that question, that in no way means that I think the answers suggesting changing the class are "wrong"; they're just not feasible in my situation.