Motivated by the length of the recent title "Why are other popular languages very different from Perl when installing libraries, e.g. no testing needed and no compilation of C/C++ code done" I did some experimenting and came up with the following CSS which cuts off long node titles at a predefined width in the Recent Threads view  (my issue here is that with titles wrapping, the layout looks somewhat "messed up" (for my taste), which makes it unnecessarily hard to tell signal from noise...).

a.nnt-link { max-width: 50em; display: block; float: left; margin-right: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

The float:left kind of "undoes" the display:block, which is only required because max-width wouldn't work with "inline"-layouted elements.  The text-overflow: ellipsis - which is supposed to put "..." at the end to indicate the text has been cut off - doesn't seem to work with Firefox, but IIRC it should work with some other browsers (can't test at the moment).

The hack has the "works for me" status, which means I haven't tested it with any other browsers/themes/window widths etc. than what matters for me (using FF / the "Perl-Blue" theme).  In other words, it might not work for you.

Anyhow, just wanted to share it as a starting point for others — just in case I'm not the only one feeling mildly annoyed by people putting half of their node content in the title ;)

Improvements or alternatives welcome.  Cheers


In reply to CSS to trim overly long node titles by Eliya

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.