Две трапеции
Вариант из двух трапеций, на которые накладывается текст. Блок имеет заданную ширину и высоту, поэтому стоит вписывать вначале текст, а затем выставлять размеры блока, чтобы все умещалось.
Несмотря на такие ограничения, блок можно приспособить и под большой объем текста, увеличив высоту и ширину, и даже под кнопку, соотв. уменьшив.
Заголовок
Текстовая информация, ограниченная размерами блока
1 2 3 4 5 6 7 8 |
<div class="block-figure-1"> <div class="trapeze"></div> <div class="trapeze"></div> <div class="trapeze-txt"> <h3>Заголовок</h3> <p>Текстовая информация, ограниченная размерами блока</p> </div> </div> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
.block-figure-1 { margin: 20px auto; padding: 0; position: relative; max-width: 600px; width: 100%; height: 260px; } .block-figure-1 .trapeze, .block-figure-1 .trapeze:after { position: absolute; top: 0; right: 0; bottom: 0; left: 0; } .block-figure-1 .trapeze, .block-figure-1 .trapeze:nth-child(2) { filter: drop-shadow(2px 12px 15px rgba(0, 0, 0, 0.4)); } .block-figure-1 .trapeze:after{ background: #337AB7; clip-path: polygon(100% 0, 91% 91%, 13% 100%, 0 35%); content: ""; transition: all .3s; } .block-figure-1 .trapeze:nth-child(2):after { clip-path: polygon(3% 15%, 85% 15%, 70% 88%, 14% 87%); background: #BFE2FF; } .block-figure-1:hover .trapeze:nth-child(1):after { transform: rotate(3deg); } .block-figure-1 .trapeze-txt { position: relative; display: flex; flex-direction: column; justify-content: center; text-align: center; height: 100%; z-index: 1; margin: 0 160px 0 80px; } .block-figure-1 .trapeze-txt h3 { text-transform: uppercase; color: #337AB7; font-weight: bold; font-family: Verdana, sans-serif; font-size: 20px; margin: 6px 0; } .block-figure-1 .trapeze-txt p { font-family: Verdana, sans-serif; font-size: 16px; margin: 6px 0; } @media (max-width: 540px) { .block-figure-1 .trapeze-txt { margin: 0 140px 0 70px; } .block-figure-1 .trapeze-txt h3 { font-size: 18px; } .block-figure-1 .trapeze-txt p { font-size: 14px; } } @media (max-width: 400px) { .block-figure-1 .trapeze-txt { margin: 0 110px 0 50px; } .block-figure-1 .trapeze-txt h3 { font-size: 16px; } .block-figure-1 .trapeze-txt p { font-size: 13px; } } |
Шестиугольник с бордюрами
Данный вариант, в отличии от предыдущего не ограничен по высоте и может вместить любое кол-во текста.
Заголовок
Текстовая информация, неограниченная размерами блока
1 2 3 4 5 6 7 8 |
<div class="block-figure-2"> <div class="figure-1"></div> <div class="figure-2"></div> <div class="figure-txt"> <h3>Заголовок</h3> <p>Текстовая информация, неограниченная размерами блока</p> </div> </div> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
.block-figure-2 { margin: 40px auto; padding: 0; position: relative; max-width: 600px; width: 100%; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.4)); transition: all .3s; } .block-figure-2:after { content: ""; transition: all .3s; clip-path: polygon(calc(100% - 100px) 0, 100% 50px, 100% 100%, 50px 100%, 0 calc(100% - 100px), 0 0); background: #FFF; position: absolute; top: 0; right: 0; bottom: 0; left: 0; border-top: 8px solid #BFE2FF; border-bottom: 8px solid #BFE2FF; } .block-figure-2 .figure-1{ position: absolute; bottom: -22px; left: -22px; width: 300px; height: 180px; background: #337AB7; clip-path: polygon(100% 0, 100% 100%, 56px 100%, 0 70px, 0 0); transition: all .3s; } .block-figure-2 .figure-2{ position: absolute; top: -22px; right: -22px; width: 230px; height: 130px; background: #337AB7; clip-path: polygon(100% 60px, 100% 100%, 0 100%, 0 0, 110px 0); transition: all .3s; } .block-figure-2:hover { filter: drop-shadow(0 16px 20px rgba(0, 0, 0, 0.5)); } .block-figure-2:hover .figure-1 { transform: translate(25px, -25px); } .block-figure-2:hover .figure-2 { transform: translate(-25px, 25px); } .block-figure-2 .figure-txt { position: relative; display: flex; flex-direction: column; justify-content: center; text-align: center; z-index: 1; padding: 20px 40px; min-height: 190px; } .block-figure-2 .figure-txt h3 { text-transform: uppercase; color: #337AB7; font-weight: bold; font-family: Verdana, sans-serif; font-size: 20px; margin: 6px 0; } .block-figure-2 .figure-txt p { font-family: Verdana, sans-serif; font-size: 16px; margin: 6px 0; } @media (max-width: 660px) { .block-figure-2 { width: calc(100% - 50px); } .block-figure-2 .figure-txt h3 { font-size: 18px; } } @media (max-width: 420px) { .block-figure-2 .figure-txt h3 { font-size: 16px; } .block-figure-2 .figure-txt p { font-size: 13px; } .block-figure-2, .block-figure-2:hover{ filter: none; border: 4px solid #BFE2FF; } .block-figure-2 .figure-txt { padding: 10px; } .block-figure-2:after, .block-figure-2 .figure-1, .block-figure-2 .figure-2 { display: none; } } |
Круг с поворотом:
Вариант с картинкой и кнопкой "подробнее" для превью новостей или других записей.
Блок имеет минимальную высоту, но не ограничен по максимальной.
Заголовок
Текстовая информация, неограниченная размерами блока
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
<div class="block-figure-3"> <div class="figure-txt"> <h3>Заголовок</h3> <p>Текстовая информация, неограниченная размерами блока</p> </div> <div class="image-wrap"> <div class="image-lay"></div> <div class="image"> <div class="front" style="background-image: url(image.jpg)"></div> <div class="back"> <div class="inner"> <a href="#more">Подробнее</a> </div> </div> </div> </div> </div> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 |
.block-figure-3 * { box-sizing: border-box; } .block-figure-3 { margin: 20px auto; padding: 0; position: relative; max-width: 600px; width: 100%; overflow: hidden; } .block-figure-3 .figure-txt { border: 6px solid #BFE2FF; } .block-figure-3 .image-wrap { border: 6px solid #BFE2FF; border-radius: 100%; width: 200px; height: 200px; position: absolute; top: 30px; background: #FFF; z-index: 1; right: 0; } .block-figure-3 .image-lay { width: 100px; height: 200px; position: absolute; top: -6px; background: #FFF; z-index: 2; right: -6px; } .block-figure-3 .image { transform-style: preserve-3d; perspective: 1000px; border-radius: 50%; position: absolute; z-index: 3; height: 176px; width: 176px; top: 6px; right: 6px; } .block-figure-3 .front, .block-figure-3 .back { background-size: cover; background-position: center; transition: transform .7s cubic-bezier(0.4, 0.2, 0.2, 1); backface-visibility: hidden; text-align: center; border-radius: 50%; color: #fff; height: 176px; width: 176px; border: 6px solid #BFE2FF; position: absolute; } .block-figure-3 .inner { transform: translateY(-50%) translateZ(60px); top: 50%; position: absolute; margin: auto; z-index: 4; width: 100%; } .block-figure-3 .image .back{ transform: rotateY(180deg); transform-style: preserve-3d; } .block-figure-3:hover .back{ transform: rotateY(0deg); transform-style: preserve-3d; } .block-figure-3:hover .front{ transform: rotateY(-180deg); transform-style: preserve-3d; } .block-figure-3 .inner a { font-weight: bold; font-family: Verdana, sans-serif; text-transform: uppercase; text-decoration: none; color: #337AB7; text-align: center; margin: auto; display:block; font-size: 14px; line-height: 130px; height: 142px; width: 142px; border:6px solid #BFE2FF; border-radius: 50%; transition:all .6s ease-in-out; overflow:hidden; } .block-figure-3 .inner a::before{ content:''; position:absolute; top:-12px; margin:auto; display:block; border-radius:50%; width:166px; height:166px; left:-1px; transition:box-shadow .6s ease-in-out; z-index:-1; } .block-figure-3 .inner a:hover{ color:#fff; } .block-figure-3 .inner a:hover::before{ box-shadow: inset 0 0 0 166px #337AB7; } .block-figure-3 .figure-txt { position: relative; z-index: 1; padding: 10px 20px; margin-right: 100px; min-height: 260px; } .block-figure-3 .figure-txt h3 { text-transform: uppercase; color: #337AB7; font-weight: bold; font-family: Verdana, sans-serif; font-size: 20px; margin: 6px 100px 12px 0; } .block-figure-3 .figure-txt p { font-family: Verdana, sans-serif; font-size: 16px; margin: 10px 100px 10px 0; } @media (max-width: 560px) { .block-figure-3 .figure-txt, .block-figure-3 .figure-txt h3, .block-figure-3 .figure-txt p { margin-right: 0; } .block-figure-3 .figure-txt { min-height: auto; border-bottom: none; } .block-figure-3 .image-lay { display: none; } .block-figure-3 .image-wrap { border: 6px solid #BFE2FF; border-top: none; border-radius: 0; width: 100%; height: 160px; position: static; } .block-figure-3 .image { border-radius: 0; position: static; height: 160px; width: 100%; } .block-figure-3 .front, .block-figure-3 .back { height: 154px; width: 100%; position: static; border-radius: 0; border: none; } .block-figure-3 .inner { transform: translateY(-100%) translateZ(60px); top: -6px; } .block-figure-3 .inner a::before{ display: none; } .block-figure-3 .inner a:hover{ color:#000; } } |
Два треугольника:
Вариант с двумя треугольниками, которые превращаются в трапеции при наведении.
Высота данного блока неограничена, но нужно учитывать размеры появляющихся фотографий.
Заголовок
Текстовая информация, неограниченная размерами блока
1 2 3 4 5 6 7 8 |
<div class="block-figure-4"> <div class="triangle-1"></div> <div class="triangle-2"></div> <div class="triangle-txt"> <h3>Заголовок</h3> <p>Текстовая информация, неограниченная размерами блока</p> </div> </div> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
.block-figure-4 { margin: 20px auto; padding: 50px 0; position: relative; max-width: 640px; } .block-figure-4 .triangle-1, .block-figure-4 .triangle-2, .block-figure-4 .triangle-1:after, .block-figure-4 .triangle-2:after, .block-figure-4 .triangle-1:before, .block-figure-4 .triangle-2:before { position: absolute; top: 0; right: 0; bottom: 0; left: 0; } .block-figure-4 .triangle-1, .block-figure-4 .triangle-2 { filter: drop-shadow(2px 6px 6px rgba(0, 0, 0, 0.4)); } .block-figure-4 .triangle-1:after, .block-figure-4 .triangle-1:before { clip-path: polygon(0 0, 40% 0, 20% 100%, 20% 100%); content: ""; transition: all .5s ease-in-out; background-size: cover; background-position: center center; background-image: url(image-1.jpg); } .block-figure-4 .triangle-1:before { background: rgba(51, 122, 183, 1); z-index: 2; } .block-figure-4:hover .triangle-1:after, .block-figure-4:hover .triangle-1:before { clip-path: polygon(0 0, 60% 0, 40% 100%, 0 100%); } .block-figure-4:hover .triangle-1:before { background-color: rgba(51, 122, 183, 0); } .block-figure-4 .triangle-2:after, .block-figure-4 .triangle-2:before { clip-path: polygon(80% 0, 100% 100%, 60% 100%, 80% 0); content: ""; transition: all .5s ease-in-out; background-size: cover; background-position: center center; background-image: url(image-2.jpg); } .block-figure-4 .triangle-2:before { background: rgba(191, 226, 255, 1); z-index: 2; } .block-figure-4:hover .triangle-2:after, .block-figure-4:hover .triangle-2:before { clip-path: polygon(100% 0, 100% 100%, 40% 100%, 60% 0); } .block-figure-4:hover .triangle-2:before { background-color: rgba(191, 226, 255, 0); } .block-figure-4 .triangle-txt { position: relative; text-align: center; z-index: 1; padding: 20px; margin: 0 50px; left: 0; background: #FFF; box-shadow: 2px 12px 15px rgba(0, 0, 0, 0.4); transition: all .5s ease-in-out; } .block-figure-4:hover .triangle-txt { left: 100%; } .block-figure-4 .triangle-txt h3 { text-transform: uppercase; color: #337AB7; font-weight: bold; font-family: Verdana, sans-serif; font-size: 20px; margin: 6px 0; } .block-figure-4 .triangle-txt p { font-family: Verdana, sans-serif; font-size: 16px; margin: 6px 0; } @media (max-width: 540px) { .block-figure-4 .triangle-txt h3 { font-size: 18px; } .block-figure-4 .triangle-txt p { font-size: 14px; } } @media (max-width: 400px) { .block-figure-4 .triangle-txt h3 { font-size: 16px; } .block-figure-4 .triangle-txt p { font-size: 13px; } } |
Если нет необходимости использовать фото, ниже представлен более простой вариант без них.
Заголовок
Текстовая информация, неограниченная размерами блока
1 2 3 4 5 6 7 8 |
<div class="block-figure-5"> <div class="triangle-1"></div> <div class="triangle-2"></div> <div class="triangle-txt"> <h3>Заголовок</h3> <p>Текстовая информация, неограниченная размерами блока</p> </div> </div> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
.block-figure-5 { margin: 20px auto; padding: 50px 0; position: relative; max-width: 640px; } .block-figure-5 .triangle-1, .block-figure-5 .triangle-2, .block-figure-5 .triangle-1:after, .block-figure-5 .triangle-2:after { position: absolute; top: 0; right: 0; bottom: 0; left: 0; } .block-figure-5 .triangle-1, .block-figure-5 .triangle-2 { filter: drop-shadow(2px 6px 6px rgba(0, 0, 0, 0.4)); } .block-figure-5 .triangle-1:after { clip-path: polygon(0 0, 40% 0, 20% 100%, 20% 100%); content: ""; transition: all .5s ease-in-out; background: #337AB7; } .block-figure-5:hover .triangle-1:after { clip-path: polygon(0 0, 60% 0, 40% 100%, 0 100%); } .block-figure-5 .triangle-2:after { clip-path: polygon(80% 0, 100% 100%, 60% 100%, 80% 0); content: ""; transition: all .5s ease-in-out; background: #BFE2FF; } .block-figure-5:hover .triangle-2:after { clip-path: polygon(100% 0, 100% 100%, 40% 100%, 60% 0); } .block-figure-5 .triangle-txt { position: relative; text-align: center; z-index: 1; padding: 20px; margin: 0 50px; left: 0; background: #FFF; box-shadow: 2px 12px 15px rgba(0, 0, 0, 0.4); transition: all .5s ease-in-out; } .block-figure-5 .triangle-txt h3 { text-transform: uppercase; color: #337AB7; font-weight: bold; font-family: Verdana, sans-serif; font-size: 20px; margin: 6px 0; } .block-figure-5 .triangle-txt p { font-family: Verdana, sans-serif; font-size: 16px; margin: 6px 0; } @media (max-width: 540px) { .block-figure-5 .triangle-txt h3 { font-size: 18px; } .block-figure-5 .triangle-txt p { font-size: 14px; } } @media (max-width: 400px) { .block-figure-5 .triangle-txt h3 { font-size: 16px; } .block-figure-5 .triangle-txt p { font-size: 13px; } } |
Добрый день! Подскажите, а как реализовать переход по ссылке в эффекте с 2 треугольниками во втором варианте, где без фото?)
А тут куда мы будем переходить? 🙂
Просто поставить ссылку в тело или как то так.
Или вы не правильно описываете "переход по ссылке", это что то другое 🙂