Forum Moderators: not2easy
<ul>
<li><a href="/article1.htm">Article 1</a> by <a href="/author1.htm">Author 1</a></li>
<li><a href="/article2.htm">Article 2</a> by <a href="/author2.htm">Author 2</a></li>
</ul>
Is there a way through CSS to make "by Author" appear on a new line right under "Article"? Or would I have to go into the html and put a <br> before every "by"?
There is a CSS way to do what you want, but it isn't very well supported cross-browser. Be aware that only the most compliant of browsers (FF and perhaps Opera) are going to implement it.
What you need is the pseudoclass :after (there's also it's sibling, :before) that can insert content into the code at a selector location. Using this pseudoclass, you can apply it to the <a>nchor tags in your list and use it to insert a line break...
ul a:after {
content: "\A";
white-space: pre;
}
The content property inserts a quoted string. In this case, we've got a backslashed capital A, which is string-speak for a line break. The white-space:pre is needed to force the element to apply the line break.
Again, you might want to look into exactly which browsers support the pseudoclass before deciding to use it. I can only say for certain that it works in FF and doesn't work in IE.
cEM