Jump to content

Recommended Posts

  • Moderators

This post is about using the css-grid for responsive content.

It happens often that the contents of a container need to re-arrange itself depending on the size (width) of the container, as in



Using a css-grid for that purpose, the code is pretty minimal at just 5 lines :

//container (w3panel)
  cards.handle.style.display := 'grid';
  cards.handle.style['grid-template-columns'] := 'repeat(auto-fill, minmax(180px, 1fr))';  
  //set minmax to just a bit bigger than the card-width
  cards.handle.style['grid-gap'] := '50px';
  cards.handle.style['justify-items'] := 'center';

//container item (w3panel)
  card.handle.style.position := 'relative';



Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...