0

I want to format a webpage to show a set of workouts but group them together in a set like the screenshot below.

Grouping of Workouts

I know that the right-hand side could be a simple list like ul but I'm trying to figure out how to get it formatted like this without using tables. Any HTML or JS methods that I may not know of?

4
  • this can be achieved with a lot of different strats, you can do it with ul/ol/tables/paragraph/span, even with css and so on, just pick one and do it! :) Commented Aug 3, 2018 at 6:24
  • One step towards your goal could be to try using initial-letter in CSS. 1. initial-letter on CSS-tricks 2. initial-letter on MDN Commented Aug 3, 2018 at 6:33
  • 2
    The browser support for initial-letter seems to be very poor though. See this article for instance. Commented Aug 3, 2018 at 6:41
  • 1
    Flexbox helps to easily center the content in the vertical. To “stretch” the { to the appropriate height, you could implement it as a (background) image, SVG, border-image. Commented Aug 3, 2018 at 7:13

1 Answer 1

1

This is an approach based on flexbox.

HTML

<div class="container"> <div class="counter">3x</div> <div class="collection">{</div> <div class="items"> <ul> <li>20 x pushups</li> <li>30 x KB swings</li> <li>10 x pullups</li> </ul> </div> </div> 

CSS

.container { display: flex; flex-direction: colum; align-items: center; height: 10em; width: 25em; } .counter { font-size: 5em; } .collection { font-size: 9em; } ul { list-style: none; -webkit-margin-before: 0; -webkit-margin-after: 0; -webkit-padding-start: 0; } .items { font-size: 2em; } 

Snippet

.container { display: flex; flex-direction: colum; align-items: center; height: 10em; width: 25em; } .counter { font-size: 5em; } .collection { font-size: 9em; } ul { list-style: none; -webkit-margin-before: 0; -webkit-margin-after: 0; -webkit-padding-start: 0; } .items { font-size: 2em; }
 <div class="container"> <div class="counter">3x</div> <div class="collection">{</div> <div class="items"> <ul> <li>20 x pushups</li> <li>30 x KB swings</li> <li>10 x pullups</li> </ul> </div> </div>

Codepen here: https://codepen.io/programmerper/pen/PBaZyp

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.