Forums

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

Home Forums CSS Simple layout question

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #252829
    nsharony
    Participant

    Hi,

    I am new to CSS and hope you will be about to assist me.

    I need to render the following layout:

    A single row that has div A that is centered horizontally in relation to the full width of the row.

    In addition, this row has div B that is floating to the left and div C that is floating to the right.
    The width of B and C might be different, but this should not affect the centering of A in relation to the entire row.

    In my failed attempts, div A always ends being centered in relation to the space left after B and C were rendered. This does not work well if B and C have different content widths as A is not centered in relation to the entire row.

    I hope this is clear.

    Any sample HTML layout + CSS would be greatly appreciated.

    Thank your

    #252831
    Shikkediel
    Participant

    Any sample HTML layout + CSS would be greatly appreciated.

    Adding the code of your attempt (preferably shown in a pen) would make it a lot easier to do some debugging and understand what you’re after exactly…

    #252835
    nsharony
    Participant

    You are right Shikkediel.

    I was however able to solve this by positioning the A div absolutely like so:
    http://codepen.io/anon/pen/zZEbzV

    #252861
    Shikkediel
    Participant

    Cool, thanks for adding the example nonetheless.

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘CSS’ is closed to new topics and replies.