SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: css positioning

  1. #1
    SitePoint Zealot
    Join Date
    Aug 2006
    Posts
    108
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    css positioning

    Hello,

    Not sure if this is possible using just css, or whether I have to use javascript as well.

    I have a website, that I want to add a css file for viewing in mobile devices. The structure is as follows: Header, content, footer. The content section has three divs: as follows: floated left, floated right, and the other div stays in the center. For mobile viewing, I want all divs to flow below each other, floated left stays at the top, the center div comes next, then the div floated right comes at the bottom. However, it doesn't work out right, as it flows as left, right and then center. Absolute positioning does not work as the right div comes on top the center div. I cannot use specific margin attributes as both width and height of divs are variable.

    Any ideas, for css only, to get it to flow as left, center and then right?

    Thanks

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,167
    Mentioned
    453 Post(s)
    Tagged
    8 Thread(s)
    You can specify a stylesheet for mobile deviced, but sadly a lot of those devices ignore this style sheet. Here is one way to set it up:

    Code:
    <link type="text/css" media="screen" rel="stylesheet" href="screen.css">
    <link type="text/css" media="handheld" rel="stylesheet" href="mobile.css">
    You can also experiment with handheld views in Opera, which has a nice view for that.

    Perhaps the best thing would be to post your code / page and we can look at what behavior it is getting up to.

  3. #3
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,343
    Mentioned
    179 Post(s)
    Tagged
    6 Thread(s)
    Hi,

    Sounds like the quiz I set for the iphone a couple of months ago.

    Goes something like this.


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
  •