Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Semi-fluid layout?

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Page: 1
Go to End
Author Topic: 1116 Views
  • saimo
    Avatar
    Community Member
    67 Posts

    Semi-fluid layout? Link to this post

    Is it possible to make a div resize according to the browser window, but only within sertain limits? using only css that is.

    Also, is it possible to tell a table to never get any wider than its parent width so that it will never get outside that box?

    Edit: joomla.org is a good example of what I mean with semi-fluid layout, and it works with js disabled, so css should probably be enough.

  • KatB
    Avatar
    Community Member
    94 Posts

    Re: Semi-fluid layout? Link to this post

    Is it possible to make a div resize according to the browser window, but only within sertain limits?

    Depending upon your needs, you could set the div a width in percentage, and then put min-width and max-width to your certain limits, eg. ems.

    However, take note that IE 6 and former do not respect min-width and max-width.

    Is this the kind of thing you were after?

    Also, is it possible to tell a table to never get any wider than its parent width so that it will never get outside that box?

    OK I am no table expert, but surely that should be standard unless it cannot (the content of the table cannot wrap smaller)? What are you experiencing?

    NB. Use tables only for tabulated data, not for layout.

  • saimo
    Avatar
    Community Member
    67 Posts

    Re: Semi-fluid layout? Link to this post

    Is this the kind of thing you were after?
    It probably is, though I haven't tested it yet.

    About tables, it is possible to make tables in the cms, and its also possible to make the width wider than the avaliable content area. This could get a big problem, when for example changing themes to a less wide theme.

    This leads to another question: maybe silverstripe should support xhtml/html fragments? That would be located in the themes as a fragments subfolder and would be ss templates, for example table.ss. This would allow a great deal of customizeability of the markup itself.

  • saimo
    Avatar
    Community Member
    67 Posts

    Re: Semi-fluid layout? Link to this post

    Just wanted to inform anyone intersted that I solved the table issue by adding

    table {
       max-width:100%;
    }

    to layout.css.
    I have also confirmed that the "joomla-style" page width is possible using the css posted above, so thanks for the help!

    1116 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.