Welcome to TalkGraphics.com
Results 1 to 4 of 4

Thread: div's and stuff

  1. #1
    Join Date
    Nov 2008
    Location
    Manchester, UK
    Posts
    25

    Default div's and stuff

    I notice that a website written with DP (and presumably WD6 and other Xara programs) uses absolute positioning for all div elements. Fair enough - relative positioning can be a pain when an element pushes an element below down or need aligning properly. etc etc.

    My question is - is the order of the elements still retained in all cases left to right within top to bottom? Or would the order be different if something was dragged to a different position?

    I want to construct a mobile version of a site by redoing the style sheets. Am I daft to try and do it this way? It would ensure that content maintenance was simplified.

  2. #2
    Join Date
    Aug 2004
    Location
    The Netherlands
    Posts
    724

    Default Re: div's and stuff

    That depends on the source. As long as div1 is above div2 in the source, the order will always be that. If you would position div2 high up the page and div1 low, then I think the order will still be div1 - div2.
    Mind you, I haven't tested all this, but it should be correct.
    Also note that divs are block elements. So the left-to-right part shouldn't play a role, only the top-to-bottom layout. That is unless you set its CSS display property to inline or something. Writing something like
    <div>fsdfs</div> text <div>blah</div>
    ...will place each part on a new line, which produces the following result:
    fsdfs
    text
    blah

  3. #3
    Join Date
    Nov 2008
    Location
    Manchester, UK
    Posts
    25

    Default Re: div's and stuff

    As I thought really.

    The real problem comes if you want to embed any dynamic coding within a div element. It's OK as long as the maximum size (particularly height) is known because the block can be set to that size. But if, for example reading entries from a database, the length is unknown at the start this will produce some problems I suspect.

    Is there any way round this? ie can we set container set to be further down the page to be relative?

  4. #4
    Join Date
    Sep 2000
    Location
    Bracknell, UK
    Posts
    8,659

    Default Re: div's and stuff

    Don't waste your time with this. If you want a mobile website design it for the size required and use a redirect. Developers target the mobile size(s) and will provide graphical assets that are lightweight and scaled down for the mobile platform. People with mobile phones use websites in completely differrent ways to using full blown sites.

 

 

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
  •