h1 Non-Rectangular header with inline SVG
.wrap-cards
.card
.wrap-image
img(src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/148703/dog-skateboard.jpg", alt="animals pictures")
svg(viewBox="0 0 100 100" preserveAspectRatio="none")
polygon(points="0,100 100,100 100,0")
.contents
h3 Lorem Ipsum Dolor sit amet
.text Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi.
.card
.wrap-image
img(src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/148703/dog-skateboard.jpg", alt="animals pictures")
svg(viewBox="0 0 100 100" preserveAspectRatio="none")
polygon(points="0,0 30,101 65,21 90,101 101,0 101,101 0,101")
.contents
h3 Lorem Ipsum Dolor sit amet
.text Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi.
.card
.wrap-image
img(src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/148703/dog-skateboard.jpg", alt="animals pictures")
svg(viewBox="0 0 100 100" preserveAspectRatio="none")
polygon(points="0,0 15,100 33,21 45,100 50,75 55,100 72,20 85,100 95,50 100,80 100,100 0,100")
.contents
h3 Lorem Ipsum Dolor sit amet
.text Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi.
.card
.wrap-image
img(src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/148703/dog-skateboard.jpg", alt="animals pictures")
svg(viewBox="-1.5 529.754 603 71.746" preserveAspectRatio="none")
path(d=" M 0 560 Q 66.018 533.115 153.816 571.235 C 241.613 609.355 293.526 571.416 310 560 C 346.774 534.516 402.903 510.645 450 560 Q 497.097 609.355 600 560 L 600 600 L 0 600 L 0 560 Z ")
.contents
h3 Lorem Ipsum Dolor sit amet
.text Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi.
.card
.wrap-image
img(src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/148703/dog-skateboard.jpg", alt="animals pictures")
svg(viewBox="-2.93 488.5 604.753 113.677" preserveAspectRatio="none")
path(d=" M 599.677 599.677 L -0.323 600.677 Q -2.12 578.16 -1 566 C 14.002 403.153 201.273 584.248 310 570 Q 415.249 556.208 600.323 490 L 599.677 599.677 Z ")
.contents
h3 Lorem Ipsum Dolor sit amet
.text Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi.
.card
.wrap-image
img(src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/148703/dog-skateboard.jpg", alt="animals pictures")
svg(viewBox="-2.93 488.5 604.753 113.677" preserveAspectRatio="none")
path(d=" M 0 560 Q 118.192 471.782 310 560 Q 495.161 645.161 600 520 L 600 600 L 0 600 L 0 560 Z ")
.contents
h3 Lorem Ipsum Dolor sit amet
.text Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi.
View Compiled
// TYPOGRAPHY
@import url("https://fonts.googleapis.com/css?family=Libre+Baskerville:400,700");
$main-font: 'Libre Baskerville', serif;
// COLORS
$white: #fff;
$black: #000;
$palette: #FFCDC4, #D5BEE8, #D1F1FF, #B2E8B3, #FFF7D1;
// FUNCTIONS
@function palette($col){
@return nth($palette, $col);
}
// MIXINS
@mixin pseudo-ready($position: absolute){
position: relative;
&::before, &::after{
content: '';
position: $position;
}
}
// GENERAL
*, *::before, *::after{
box-sizing: border-box;
}
body{
font-family: $main-font;
font-size: 16px;
padding: 3rem 1rem 0;
display: flex;
flex-direction: column;
align-items: center;
background: lighten(palette(2), 6%);
}
h1, h2, h3, h4, h5, h6{
margin-top: 0;
font-weight: normal;
}
h1{
margin: 0 0 4rem;
text-align: center;
font-size: 1.6em;
color: darken(palette(2), 10%);
}
.wrap-cards{
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}
// CARDS STYLES
.card{
width: 32%;
max-width: 100%;
margin: 0 0 4rem;
box-shadow: 0 15px 10px -10px rgba($black, .25);
background-color: palette(2);
.wrap-image{
position: relative;
img{
width: 100%;
height: auto;
}
svg {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
//set height to vh if you want angle to be same while screen width changes
//set height to pixels if you want angle to change with screen width
height: 30px;
polygon, path{
fill: palette(2);
stroke: palette(2);
}
}
}
&:nth-child(4){
.wrap-image{
svg{
path{
stroke-width: 3px;
}
}
}
}
&:nth-child(5){
.wrap-image{
svg{
path{
stroke-width: 4px;
}
}
}
}
&:nth-child(6){
.wrap-image{
svg{
path{
stroke-width: 6px;
}
}
}
}
.contents{
padding: 1rem;
h3{
margin: 0 0 .5rem;
font-size: 1.125em;
color: $white;
}
.text{
color: rgba($black, .5);
line-height: 1.6;
font-size: .9em;
}
}
}
// RESPONSIVE GRID
@media all and (max-width: 768px){
.card{
width: 49%;
margin-bottom: 3rem;
}
}
@media all and (max-width: 480px){
.card{
width: 100%;
margin-bottom: 3rem;
}
}
View Compiled
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.