Skip to content
This repository has been archived by the owner on Dec 22, 2023. It is now read-only.

CSS Flex Masonery layout #55

Answered by c-smile
martinlombana asked this question in Q&A
Discussion options

You must be logged in to vote

If you know upfront how columns are split then you can use {clear:after | before;} to force column wrapping:

<html>
    <head>
        <title>Test</title>
        <style>

body {
  flow:vertical-wrap;
  overflow-x:scroll-indicator;  
  border-spacing:1em;
}

body > div {
  width:64px;
  background:gold;
}

body > div:nth-child(4) {clear:after;} 
body > div:nth-child(8) {clear:after;} 

        </style>
    </head>
    <body>
      <div style="height:64px" />
      <div style="height:48px" />
      <div style="height:64px" />
      <div style="height:64px" />
      <div style="height:48px" />
      <div style="height:64px" />
      <div style="height:48px" />
      <div style="height:64px"…

Replies: 4 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@martinlombana
Comment options

Comment options

You must be logged in to vote
1 reply
@martinlombana
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by martinlombana
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #54 on March 26, 2021 21:40.