SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Sep 2006
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Help with sidebar layout

    Hello,

    I'm in the process of creating a website (you can view it here: www.superhomedecor.com). I've added some news and blog related RSS feeds to the right hand column. The problem is that sometimes the RSS feed contains a long piece of text which widens my right column and messes up the look of the entire site. Is there any way to make the text wrap around to the next line (even if it's one long word) or simply cut off at the edge instead of pushing the table out?

    Thanks and be well.

    All the best,

    Moshe

  2. #2
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Not using standard HTML or CSS. User agents are only allowed to break a line at whitespace characters (space, tab, carriage return, line feed). IE and Opera incorrectly break lines at some other characters as well (hyphens, brackets, etc.) but that's incorrect behaviour.

    You can either use the overflow CSS property to clip the content or get a scroll bar. Another option is to shorten those long words using server-side scripting (e.g., by replacing everything after N characters with a horizontal ellipsis, '…').

    A good start would be to use semantic markup and CSS to handle the layout, rather than the archaic and unsemantic reliance on tables.

    You may try CSS properties like table-layout:fixed to 'lock' the 'column' widths, but it is fraught with problems and browser support seems to be a bit iffy.
    Birnam wood is come to Dunsinane

  3. #3
    whagwan? silver trophybronze trophy akritic's Avatar
    Join Date
    Nov 2006
    Posts
    2,780
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    bit dissapointing to hear there's not a reliable CSS workaround for this.
    I would have thought the overflow property would have been the one
    to kick this into shape.

    I guess until it's resolved I would figure placing the feed somewhere
    where it has enough room to spill.

  4. #4
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's the way tables behave: the way they are expected to behave and the way we wish them to behave.

    If you do not want table behaviour (adapting to content), then use more appropriate HTML element types.
    Birnam wood is come to Dunsinane


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •