r/csshelp • • Feb 07 '21

Request Any tutorial course for creating pages with complex magazine layouts?

https://www.pinterest.ca/pin/37295503143203701/

I was asked to replicate a template like the one above in html, but I have no idea how that's remotely possible. Most landing page on the Internet are very bootstrappy and just requires you to center images and text, but some layouts are way too difficult to reproduce in html.

7 Upvotes

3 comments sorted by

1

u/Kthulu666 Feb 07 '21

Break it down into individual parts, e.g., image with a curved edge, text in columns, etc.

There are a few things going on here but they're all fairly simple concepts on their own, so learn them one at a time.

1

u/pawanrvora Feb 07 '21

This one is going to be difficult to pull off, but some of the elements are possible. Here's what I believe can be achieved:

  1. Image with the wavy section. You can use the clip-path property with an SVG to create the wavy shape. There are many blog posts and videos online and here's one: https://jamesauble.medium.com/create-wave-border-with-svg-and-css-clip-path-aa2ee11cff39

  2. Multi-column layout is possible using column-count and column-gap. See https://www.w3schools.com/cssref/css3_pr_column-count.asp

What's problematic is making it responsive.

  1. There was a proposal for CSS regions, which would have allowed to have text flow from one column to another when the browser was resized, but it's not supported and it seems browser developers are not pursuing it. See https://caniuse.com/?search=css%20regions

  2. Floating the "quote" between two columns is also problematic. There was a proposal for CSS exclusions, but it's not supported by the browsers and it seems they are no longer pursuing it. You can see the information about what it was supposed to accomplish here: https://webdesign.tutsplus.com/tutorials/css-exclusions--cms-28087

  3. Finally, adjusting letter-spacing for the title and author name would require using javascript. I don't know of any support in CSS to do so dynamically.

There are many other magazine like layouts possible and you may want to look at https://css-tricks.com/responsive-grid-magazine-layout-in-just-20-lines-of-css/ and https://csshint.com/css-magazine-layouts/ for inspiration.

Good luck!

1

u/HaikusfromBuddha Feb 08 '21

Go to other sites that have similar or parts of the design you want and then inspect element to check out how they laid out the HTML and CSS. You can start with big sites like the LA times or NY Times and then move on to others.