Forums

  • # January 11, 2017 at 3:23 am

    In CSS is there a way to keep width always wide enough to keep its child elements?

    I would like something like this

    |— container —|

    |- box -||- box -|

    |

    container

    |

    |- box -||- box -||- box -||- box -|

    # January 11, 2017 at 4:41 am

    Without knowing details, you could use the ‘width’ or ‘min-width’ CSS properties with a fixed unit value on the container. This should stop the container from shrinking/shrinking past a certain point, BUT, there’s a chance that this will break the layout higher up the DOM and/or generate horizontal scrollbars, which might not be what you want.

    To offer more specific help, we’d need to see examples of code in something like codepen.io

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

You must be logged in to reply to this topic.

icon-closeicon-emailicon-linkicon-logo-staricon-menuicon-searchicon-staricon-tag