Imagine a scenario where there is a div
wrapper containing multiple elements set as inline
. As the width of the div decreases, the elements automatically move to new lines. Everything seems fine so far.
Now the challenge is to add a CSS :before
content to the child elements, except the ones that are at the beginning of each line...
Is it possible to use only CSS to determine if an element is the first one after a line break?
UPDATE
Consider this example... http://jsfiddle.net/kagfqt9j/
When the div's width is such that the children break into three lines, a "|" divider is applied using :before
. However, we want to avoid having the :before
attached to the beginning of each line.
Therefore, is there a way to detect the first element after a line break?
Note: Switching to :after
won't work because it would just shift the issue to the end of the lines. That's not a viable solution either.