Skip to main content

Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Forum Replies Created

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • in reply to: CSS Centre and Left align #267799
    tobiq
    Participant

    I was joking… Terrible solution

    in reply to: CSS Centre and Left align #267793
    tobiq
    Participant

    No problem, I’ll just set 100 media queries for every interval of width so that it works for every screen width up to 100000px;

    in reply to: CSS Centre and Left align #267704
    tobiq
    Participant

    I don’t know how further to explain this..

    I only want the green box centred, and the red box left aligned inside.
    setting a width of 80vw is not a solution because the green container is no longer wrapping tightly around the red boxes.

    When the red boxes are not overflowing inside the green box, it works fine, because the left align becomes redundant — as the box wraps around all elements on the line. In short, it just looks like the red boxes are centre aligned within the blue body, with a green border.

    When they start overflowing, instead of the green box staying centred, while the red boxes overflow in a left-aligned fashion, the green container simply takes up 100% width, and it looks like the green boxes are just left aligned within the blue body, when you ignore the colour of the container.

    in reply to: CSS Centre and Left align #267667
    tobiq
    Participant

    Beverley, using width / max-width is something I did before you suggested it, but it’s not the intended outcome, because obviously I won’t have the resolution of every page viewer.

    I want the green box to wrap around the red boxes, and not expand to the full-width, Automatically.

    Do you know how to do this?

    If the worst comes to the worst, I can set the width using javascript, but this is overkill, there must be a css solution.

    in reply to: CSS Centre and Left align #267662
    tobiq
    Participant

    Beverlyh, look at this screenshot, you may understand what I’m explaining:

    http://prntscr.com/ilv5u6

    As you can see, the green box is full-width even though there is a massive gap on its right, it’s no longer wrapping around it’s contents, but behaving like a block element.

    What I want is this: (edited image)

    http://prntscr.com/ilv7zz

    See how the green box is centred, but it’s contents is left-aligned. This works because the box is wrapping it’s contents, but in my jsbin example the box is just taking the full width, maxing the centre align useless.

    in reply to: CSS Centre and Left align #267661
    tobiq
    Participant

    Beverlyh, look at this screenshot, you may understand what I’m explaining:

    http://prntscr.com/ilv5u6

    As you can see, the green box is full-width even though there is a massive gap on its right, it’s no longer wrapping around it’s contents, but behaving like a block element.

    What I want is this: (edited image)

    http://prntscr.com/ilv7zz

    See how the green box is centred, but it’s contents is left-aligned. This works because the box is wrapping it’s contents, but in my jsbin example the box is just taking the full width, maxing the centre align useless.

Viewing 6 posts - 1 through 6 (of 6 total)