enter image description here

The question is how to position it at all, using SVG to make such blocks is not an option, because then the text cannot be changed in the cases of what (Actually, it is very difficult). If you do the background, how to make the animation of the opening of these blocks?

Then another question, where the 'hovered' needs to be done somehow so that both the line and this oblique block are highlighted. You have to draw with SVG , but how then to make it adaptive.

I don’t even have ideas at the moment, how to do it normally, so that everything would not hold on crutches, maybe there are already ready examples, what to see how it is implemented there?

  • You open one thing, you hide the rest, what is the difficulty then? - And

1 answer 1

 $(function() { $(".items").accordion({ collapsible: true }); }); 
 * { margin: 0; outline: none; border: none; } body { padding-top: 100px; } .items { width: 700px; margin: auto; position: relative; } h3 { position: relative; height: 40px; line-height: 40px; font-variant: small-caps; border:2px solid #fff; border-left:none; } .items h3 span { position: relative; background: lightblue; display: inline-block; padding: 0 10px; float: left; } .items h3:before { content: ""; display: inline-block; width: 30px; height: 40px; background: lightblue; transform: skew(20deg); margin-left: -10px; } .items div { background: lightblue; padding: 10px 20px; } 
 <script src="https://code.jquery.com/jquery-1.12.4.js"></script> <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script> <div class="items"> <h3><span>Section 1</span></h3> <div> <p>Mauris mauris ante, blandit et, ultrices a, suscipit eget, quam. Integer ut neque. Vivamus nisi metus, molestie vel, gravida in, condimentum sit amet, nunc. Nam a nibh. Donec suscipit eros. Nam mi. Proin viverra leo ut odio. Curabitur malesuada. Vestibulum a velit eu ante scelerisque vulputate.</p> </div> <h3><span>Section lorem ipsum 2</span></h3> <div> <p>Sed non urna. Donec et ante. Phasellus eu ligula. Vestibulum sit amet purus. Vivamus hendrerit, dolor at aliquet laoreet, mauris turpis porttitor velit, faucibus interdum tellus libero ac justo. Vivamus non quam. In suscipit faucibus urna. </p> </div> <h3><span>Section itemes 3</span></h3> <div> <p>Nam enim risus, molestie et, porta ac, aliquam ac, risus. Quisque lobortis. Phasellus pellentesque purus in massa. Aenean in pede. Phasellus ac libero ac tellus pellentesque semper. Sed ac felis. Sed commodo, magna quis lacinia ornare, quam ante aliquam nisi, eu iaculis leo purus venenatis dui. </p> <ul> <li>List item one</li> <li>List item two</li> <li>List item three</li> </ul> </div> <h3><span>section propper cordid feriums 4</span> </h3> <div> <p>Cras dictum. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aenean lacinia mauris vel est. </p> <p>Suspendisse eu nisl. Nullam ut libero. Integer dignissim consequat lectus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. </p> </div> </div>