How to make a div stick to its position when resizing? - css

Minimal example on codepen
I made a header for my website, and in mobile view I have a hamburger icon that shows the nav when clicked.
I positioned this icon to be aligned with the logo. When I click on the logo, the header resizes in order to show the nav, but I don't want my icon to move. Unfortunately, I set its position (absolute) to top: 50% ; transform: translateY(-50%); to center it and it follows the height change of its parent.
Is there any way to make it sticky to its position in pure CSS? With Js I can calculate the coordinates of the logo and set the top property with this value, but I don't really want to use Js for this.
$(document).ready(function() {
$('#hamburger').click(function(){
$('#hamburger').toggleClass('active');
$('#hamburger_icon').toggleClass('active');
$('#nav').toggleClass('active');
});
});
body {
padding: 0px;
margin: 0px;
}
a {
text-decoration: none;
color: inherit;
}
ul {
padding: 0px;
margin: 0px;
}
header {
position: relative;
padding-left: 0px;
padding-right: 0px;
width: 100%;
box-sizing: border-box;
background-color: white;
box-shadow: 0 3px 28px rgba(0, 0, 0, 0.15);
}
header div {
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
}
header div svg {
margin-top: 0.5em;
margin-bottom: 0.5em;
height: 50px;
position: relative;
}
header div ul {
list-style: none;
text-decoration: none;
display: flex;
font-size: 0.8em;
max-height: 0px;
overflow: hidden;
transition: all ease-out 0.2s;
}
header div ul.active {
max-height: 200px;
margin-top: 0.6em;
margin-bottom: 0.6em;
}
header div ul li {
margin-right: 1em;
margin-left: 1em;
position: relative;
}
header #hamburger {
top: 50%;
transform: translateY(-50%);
right: 2.5em;
position: absolute;
height: 1.6em;
width: 1.6em;
padding: 0.2em;
}
header #hamburger #hamburger_icon {
top: 50%;
transform: translateY(-50%);
position: relative;
display: block;
background-color: black;
height: 0.1em;
width: 100%;
border-radius: 1.5px;
transition: all ease-out 0.2s;
}
header #hamburger #hamburger_icon::before, header #hamburger #hamburger_icon::after {
content: "";
display: block;
background-color: black;
height: 0.1em;
width: 100%;
border-radius: 1.5px;
transition: all ease-out 0.2s;
position: absolute;
}
header #hamburger #hamburger_icon::before {
top: -0.4em;
}
header #hamburger #hamburger_icon::after {
top: 0.4em;
}
header #hamburger #hamburger_icon.active {
transform: rotate(90deg);
}
header #hamburger #hamburger_icon.active::before, header #hamburger #hamburger_icon.active::after {
width: 40%;
}
header #hamburger #hamburger_icon.active::before {
transform: rotate(-45deg);
top: -0.25em;
}
header #hamburger #hamburger_icon.active::after {
transform: rotate(45deg);
top: 0.25em;
}
#main_logo {
fill: black;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<header>
<div class="header_content">
<svg class="flex_elem" id="main_logo" version="1.0" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1733.000000 1964.000000" preserveAspectRatio="xMidYMid meet">
<g id="the_logo" transform="translate(0.000000,1964.000000) scale(0.100000,-0.100000)" stroke="none">
<path d="M8530 19634 c-148 -23 -272 -60 -380 -114 -97 -48 -7567 -4361 -7644 -4413 -32 -22 -92 -72 -134 -111 -209 -197 -336 -464 -362 -760 -13 -152 -13 -8680 0 -8832 26 -297 153 -562 362 -760 42 -39 102 -90 135 -112 110 -75 7618 -4405 7693 -4437 304 -130 662 -126 955 9 39 18 994 565 2121 1216 1127 650 2144 1237 2259 1303 116 66 224 130 242 143 39 30 68 100 60 150 -7 41 -517 934 -558 976 -32 32 -96 53 -141 44 -18 -3 -121 -57 -228 -119 -1511 -877 -4229 -2441 -4241 -2441 -9 -1 -1661 949 -3672 2109 l-3656 2110 0 4225 0 4225 3627 2093 c1995 1151 3643 2103 3664 2114 l36 21 3661 -2114 3661 -2113 0 -3683 0 -3683 -22 -4 c-36 -8 -4419 -417 -4459 -416 -43 0 -96 33 -121 75 -14 25 -89 788 -447 4590 -237 2508 -436 4580 -441 4605 -32 135 -169 240 -312 240 -27 0 -286 -22 -576 -50 -520 -49 -528 -50 -589 -80 -34 -17 -76 -47 -94 -67 -44 -51 -80 -132 -85 -195 -2 -30 220 -2422 499 -5374 471 -4974 505 -5324 525 -5357 27 -42 75 -67 132 -67 92 0 6739 630 6800 645 138 33 290 127 375 233 60 74 122 202 140 288 13 60 15 632 15 4276 0 2940 -3 4230 -11 4284 -44 321 -236 630 -499 806 -83 55 -7533 4359 -7638 4412 -81 41 -218 84 -322 101 -86 13 -265 18 -330 9z"/>
<path d="M6340 15539 c-639 -47 -1156 -179 -1531 -391 -608 -343 -907 -961 -989 -2048 -18 -234 -24 -904 -11 -1270 49 -1417 248 -3459 462 -4735 145 -867 296 -1410 509 -1836 293 -584 673 -894 1252 -1023 393 -87 922 -95 1468 -20 272 37 631 120 881 204 263 89 340 135 354 213 3 18 -19 287 -49 599 -59 617 -58 613 -122 650 -49 28 -96 25 -284 -19 -673 -160 -1283 -194 -1618 -92 -415 128 -606 509 -766 1529 -134 852 -337 2837 -426 4170 -78 1168 -59 1639 80 1998 103 267 305 417 690 513 280 69 560 92 1075 87 363 -3 393 -2 418 15 43 28 67 75 67 132 0 28 -23 295 -51 595 -55 587 -56 595 -117 636 -51 35 -291 74 -582 94 -165 11 -554 11 -710 -1z"/>
</g>
</svg>
<ul class="flex_elem" id="nav">
<li class="nav-item"> <a class="nav-link menu_link" href="#">ITEM1</a> </li>
<li class="nav-item"> <a class="nav-link menu_link" href="#">ITEM2</a> </li>
<li class="nav-item"> <a class="nav-link menu_link" href="#">ITEM3</a> </li>
<li class="nav-item"> <a class="nav-link menu_link" href="#">ITEM4</a> </li>
</ul>
</div>
<div id="hamburger">
<div id="hamburger_icon"></div>
</div>
</header>
</body>

Try just to modify this, within #hamburger_icon, adding top attribute:
&.active {
transform: rotate(90deg);
top: 0;
}

Related

SVG as a Mask and Not Clipping Path [duplicate]

This question already has answers here:
How to resize the ClipPath area of SVG?
(2 answers)
masking image with CSS
(2 answers)
Closed 10 months ago.
I'm trying to figure out a way to use an SVG path to hide portions of divs via CSS. The current method I know is using the SVG to clip the entire div. I'm wondering if there's a way to use a mask instead.
My desired result would be to clip only a portion of the div. For the example I was working on, would be the right side of the div.
I've linked my attempts, but at best I can only get clipping to work.
JSFiddle link.
.st0{fill:#000;}
div {
height: 100px;
background: red;
margin-bottom: 20px;
}
.wide {
width: 80%;
}
.short {
width: 20%;
}
.mask {
clip-path: url(#clip);
}
<div class="mask wide"></div>
<div class="mask short"></div>
<svg viewBox="0 0 119.5 290.5">
<defs>
<clippath id="clip">
<path class="st0" d="M12.1,0l27.1,35.2L18.8,72.1l49.3,41.3L9.9,172.6c0,0,43.6,47.1,44.4,44.9c0.9-2.2,36,12.9,32,13.3
s-63.6,12-63.6,12s6.2,17.8,7.6,17.8c1.3,0,55.1,0.9,53.8,0c-1.3-0.9-47.6,17.3-47.6,17.3l-21.3,12.6h104.2V0H12.1z"/>
</clippath>
</defs>
</svg>
Browser support for CSS masks is patchy at present.
However, depending on your requirements, you may be able to use CSS blend modes instead – see the example below. I have yet to find detailed, precise, non-technical descriptions of each blend mode – the best I have found today is this. Some experimentation may be required.
body {
margin: 5vh 5vw;
font-family: sans-serif;
background: #ddd;
}
.background {
background-image: url("https://images.unsplash.com/photo-1531786343146-f297424a3171?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1950&q=80");
background-repeat: no-repeat;
background-size: cover;
background-position: 50% 50%;
height: 90vh;
position: relative;
}
.overlay {
position: absolute;
top: 5vh;
left: 5vw;
right: 5vw;
bottom: 5vh;
background-color: transparent;
transition: all 600ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.overlay-text {
font-size: 20pt;
color: white;
display: inline-block;
position: relative;
}
.overlay-shape {
fill: white;
}
.overlay:hover {
background-color: #ffffffee;
mix-blend-mode: lighten; /* the overlay is painted only in areas where it is lighter than its parent (the background) */
}
.overlay:hover .overlay-text {
color: black;
}
.overlay:hover .overlay-shape {
fill: black;
}
<section class="background">
<div class="overlay">
<h1 class="overlay-text">HOVER ME.</h1>
<svg viewBox="0 0 1642 1920" xmlns="http://www.w3.org/2000/svg">
<path class="overlay-shape" d="m8071 19178c-20-52-31-109-71-340-22-130-52-270-66-310-64-181-200-376-489-703-316-357-419-485-518-646-188-304-308-621-386-1014-69-348-73-782-11-1170 38-236 61-508 70-825 11-347 17-416 55-624 95-518 236-1077 390-1556 35-107 86-256 113-330 48-127 64-180 143-455 43-152 144-464 180-560 47-122 66-166 155-355 84-180 137-316 192-500 50-164 90-320 82-315-5 3-20 26-36 53-57 99-261 420-393 619-275 416-294 456-530 1118-16 44-79 224-141 400-100 287-224 625-300 820-15 39-39 99-53 135-103 265-311 724-439 969-295 565-575 943-883 1190-342 275-680 465-1095 614-158 57-278 92-571 166-481 121-711 237-930 471-62 66-114 118-116 116-2-1 30-120 71-262 116-403 173-647 212-906 34-231 29-755-12-1193-75-792 266-1701 914-2435 137-156 455-470 625-617 292-255 570-443 892-607 61-30 108-55 105-56-3 0-30 9-60 19-550 191-677 239-895 336-418 186-696 250-1085 249-293 0-459-28-761-128-74-24-188-58-254-76-252-66-318-90-665-238-289-122-420-176-514-208-99-34-359-88-695-144-162-28-296-52-298-54-8-8 104-44 202-65 154-33 221-84 580-445 272-274 440-436 550-530 167-142 583-395 960-582 377-186 570-254 920-324 88-17 237-49 330-71 168-38 174-39 520-54 525-23 1114-37 1255-30 69 4 168 16 220 26 52 11 127 27 165 35 209 43 587 152 790 229 228 86 282 111 725 338 135 69 310 154 390 190 146 65 340 141 345 135 4-3-81-75-210-177-84-66-297-210-377-253-79-44-267-129-362-164-97-37-356-114-380-114-14 0-212-66-331-110-111-41-359-167-498-253-76-47-242-160-370-250-268-189-323-225-582-372-347-196-532-331-710-516-130-135-210-243-342-464-337-566-707-1019-1100-1348-137-115-173-150-173-173 0-14 139 6 277 40 148 37 500 135 758 211 370 110 488 142 730 196 440 98 527 119 730 170 677 171 991 284 1252 454 97 63 157 113 343 285 69 64 179 162 245 220 159 138 438 418 502 504 108 146 152 240 301 641 87 235 258 795 343 1122 12 46 23 83 26 83 2 0 3-593 2-1317-3-1656 6-2409 36-3133 58-1347 59-1395 60-2195 0-831 0-839-51-1090-44-215-64-358-64-453 0-120 14-153 84-193 54-31 97-36 143-18 15 6 51 11 80 10 65-2 107 18 122 59 8 23 5 125-9 393-38 710-50 1019-60 1527-19 989-32 1309-85 2112-41 606-50 953-65 2398-6 553-15 1156-20 1340s-9 358-9 385v50l24-85c117-421 505-1058 909-1490 291-311 669-585 1091-790 180-87 358-155 705-268 431-140 614-217 805-338 200-126 328-165 886-268 135-26 293-59 350-75 301-85 594-219 990-452 64-38 119-69 123-69 36 0-126 285-407 714-106 161-193 311-294 505-194 370-240 452-349 616-185 281-327 428-562 581-81 53-243 169-360 258-278 210-469 347-595 426-214 135-476 255-689 316-54 15-96 29-94 31s48-7 102-21c170-42 351-51 1019-51 673 0 689 1 1039 65 577 105 757 158 1147 336 267 121 696 354 877 476 154 104 304 234 672 587 262 251 326 308 433 385 83 59 101 66 236 91 46 9 102 23 124 32 51 21 43 24-118 53-166 29-526 104-666 139-141 35-228 69-569 223-456 206-488 219-756 298-72 21-164 50-205 65-270 98-482 147-714 166-372 30-761-42-1180-218-71-30-179-73-240-95-60-22-145-52-187-68-43-15-78-26-78-24 0 1 48 36 108 76 265 180 538 430 723 663 53 66 149 197 214 290 136 196 235 329 350 470 204 251 326 431 410 610 102 217 166 463 185 718 21 279 39 385 89 540 94 293 141 532 151 772 5 105 17 261 29 347 17 136 26 174 72 295 69 185 154 377 246 553 80 154 141 250 254 395 64 83 117 171 107 180-2 2-62-30-133-72-328-191-679-380-800-432-98-41-259-89-630-186-465-122-519-140-845-283-74-32-153-65-175-72-284-91-559-238-790-420-123-97-350-332-449-465-136-185-215-317-362-610-132-262-222-432-289-545-18-30-89-149-157-265-307-516-444-777-548-1040-66-165-149-340-230-480-35-60-81-141-103-180-137-238-223-478-307-860-103-469-163-659-253-809-39-65-201-267-261-326-39-37-49-43-64-33-9 6-16 15-15 20 2 9 509 1275 568 1418 21 50 48 116 61 148 13 31 35 83 48 115 13 31 40 95 61 142 181 416 268 691 385 1220 72 324 109 456 235 835 163 490 232 823 266 1270 14 190 21 1674 8 1845-33 462-221 862-615 1311-56 64-239 253-405 420-527 529-566 593-668 1093-21 102-41 189-44 192-4 4-11-5-16-18zm-2212-9354c134-49 153-57 546-215 193-77 370-149 395-159 25-9 86-34 135-55 552-228 885-353 984-370 38-6 41-9 41-40 0-38-12-45-74-45-55 0-241 34-389 71-211 53-359 122-527 247-225 167-332 221-685 350-60 22-146 56-190 75-85 36-356 177-341 177 4 0 52-16 105-36zm3576-403c-29-27-323-243-400-294-215-141-397-197-646-197h-116l-7 32c-11 56 34 98 189 175 211 106 493 194 865 271 112 23 127 25 115 13zm-948-666c274-56 532-161 923-375 139-76 273-139 439-207 152-61 477-171 589-198 40-9 71-20 68-22-3-3-78 11-168 31s-257 56-373 81c-262 57-467 114-604 167-58 23-270 123-471 223-414 206-468 230-571 247-85 13-101 23-88 56 7 19 15 22 70 22 34 0 118-11 186-25z" transform="matrix(.1 0 0 -.1 0 1920)"/>
</svg>
</div>
</section>
Credits: code image

SVG height not behaving as expected

Not that it matters but I'm using https://getwaves.io/ to generate an SVG image.
What should happen
The blue waves should take up much more vertical space in the gray box. It seems like it does not use object-fit: cover.
In fact, it should follow the size of the box, like a bounding box.
What I've tried to far
Set height and width to 100%
Set object-fit to cover
Made sure there is a viewbox
Made sure there are no other width and height
Example
It shows that an JPG image works fine but not the SVG image.
Question
How can I fix it?
.wrap {
height: 300px;
width: 300px;
background: #eee;
}
svg, img {
object-fit: cover;
height: 100%;
width: 100%;
}
Just the SVG file
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320">
<path fill="#0369a1" fill-opacity="1" d="M0,224L80,240C160,256,320,288,480,277.3C640,267,800,213,960,208C1120,203,1280,245,1360,266.7L1440,288L1440,320L1360,320C1280,320,1120,320,960,320C800,320,640,320,480,320C320,320,160,320,80,320L0,320Z"></path>
</svg>
SVG in a box - Does not work
<div class="wrap">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320">
<path fill="#0369a1" fill-opacity="1" d="M0,224L80,240C160,256,320,288,480,277.3C640,267,800,213,960,208C1120,203,1280,245,1360,266.7L1440,288L1440,320L1360,320C1280,320,1120,320,960,320C800,320,640,320,480,320C320,320,160,320,80,320L0,320Z"></path>
</svg>
</div>
JPG in a box - Do work
<div class="wrap">
<img src="https://placekitten.com/96/139">
</div>
First of all you can use the attribute preserveAspectRatio="none" on <svg>. This will stretch the SVG if you specify a height and a width.
Second you path was placed around 200 down the y axis. So, when it stretched, the transparent area above the path would also take up more space. I moved the path so that it almost hits y=0 on the top. Now the path only takes up 113 in the height and when stretched it will fill up the entire box.
I used SvgPathEditor to edit the path.
.wrap {
height: 300px;
width: 300px;
background: #eee;
}
svg, img {
height: 100%;
width: 100%;
}
Just the SVG file
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 113">
<path fill="#0369a1" fill-opacity="1" d="M 0 17 L 80 33 C 160 49 320 81 480 70.3 C 640 60 800 6 960 1 C 1120 -4 1280 38 1360 59.7 L 1440 81 L 1440 113 L 1360 113 C 1280 113 1120 113 960 113 C 800 113 640 113 480 113 C 320 113 160 113 80 113 L 0 113 Z"></path>
</svg>
SVG in a box - Does not work
<div class="wrap">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 113" preserveAspectRatio="none">
<path fill="#0369a1" fill-opacity="1" d="M 0 17 L 80 33 C 160 49 320 81 480 70.3 C 640 60 800 6 960 1 C 1120 -4 1280 38 1360 59.7 L 1440 81 L 1440 113 L 1360 113 C 1280 113 1120 113 960 113 C 800 113 640 113 480 113 C 320 113 160 113 80 113 L 0 113 Z"></path>
</svg>
</div>
JPG in a box - Do work
<div class="wrap">
<img src="https://placekitten.com/96/139">
</div>

Is there a way to target Background SVG specific element to use the fill option? [duplicate]

This question already has answers here:
How to modify the fill color of an SVG image when being served as background image?
(24 answers)
Closed 3 years ago.
I have the following code
background-image: url("data:image/svg+xml;charset=UTF-8,<svg id='Layer_1' data-name='Layer 1' xmlns='http://www.w3.org/2000/svg' width='47' height='47' viewBox='0 0 120 120'><polygon class='cls-1' points='120 120 60 120 90 90 120 60 120 0 120 0 60 60 0 0 0 60 30 90 60 120 120 120'/></svg>");
I want to target the cls-1 to change its color but the below code does not seem to effect
.cls-1{
fill: rgb(39, 60, 117);
}
Am I doing something wrong??
I can change the code if I put the Color code inside the polygon tag that is
background-image: url("data:image/svg+xml;charset=UTF-8,<svg id='Layer_1' data-name='Layer 1' xmlns='http://www.w3.org/2000/svg' width='47' height='47' viewBox='0 0 120 120'><polygon fill='rgb(39, 60, 117)' class='cls-1' points='120 120 60 120 90 90 120 60 120 0 120 0 60 60 0 0 0 60 30 90 60 120 120 120'/></svg>");
I wish to target it separately so that I can let the user change the color and not mess up the SVG code.
You can't, try something like this:
<style>
div {
width:47px;
height:47px;
background-image: url("data:image/svg+xml;charset=UTF-8,<svg id='Layer_1' data-name='Layer 1' xmlns='http://www.w3.org/2000/svg' width='47' height='47' viewBox='0 0 120 120'><polygon class='cls-1' points='120 120 60 120 90 90 120 60 120 0 120 0 60 60 0 0 0 60 30 90 60 120 120 120'/></svg>");
}
div.blue {
background-image: url("data:image/svg+xml;charset=UTF-8,<svg id='Layer_1' data-name='Layer 1' xmlns='http://www.w3.org/2000/svg' width='47' height='47' viewBox='0 0 120 120'><polygon fill='rgb(39, 60, 117)' class='cls-1' points='120 120 60 120 90 90 120 60 120 0 120 0 60 60 0 0 0 60 30 90 60 120 120 120'/></svg>");
}
</style>
<div class="blue"></div>

Flexbox logos running amok: Centering an element in a multi-element navigation

I've been hacking my way around this issue for a few websites now. It's time to ask in the open.
I have a navigation bar with a few elements. One of them, the logo, needs to stay centered.
I use flexbox. Is it possible to achieve this using flex rules, without resorting to absolute positioning? This never works for me in small screens, as elements will start mounting on top of each other.
Here is a Codepen with the exact problem, followed by my header markup.
<header role="banner">
<button>Button</button>
<h1>
<a href="/">
<img class="logo" src="http://pre04.deviantart.net/239a/th/pre/i/2014/106/6/c/random_logo_by_criticl-d7eqdvw.png" alt="Logo">
</a>
</h1>
<nav role="navigation">
<ul class="primaryNav">
<li>link 1</li>
<li>link 2</li>
</ul>
<ul class="secondaryNav">
<li><svg viewBox="0 0 512 512"><path d="M211.9 197.4h-36.7v59.9h36.7V433.1h70.5V256.5h49.2l5.2-59.1h-54.4c0 0 0-22.1 0-33.7 0-13.9 2.8-19.5 16.3-19.5 10.9 0 38.2 0 38.2 0V82.9c0 0-40.2 0-48.8 0 -52.5 0-76.1 23.1-76.1 67.3C211.9 188.8 211.9 197.4 211.9 197.4z"/></svg></li>
<li><svg viewBox="0 0 512 512"><path d="M179.7 237.6L179.7 284.2 256.7 284.2C253.6 304.2 233.4 342.9 179.7 342.9 133.4 342.9 95.6 304.4 95.6 257 95.6 209.6 133.4 171.1 179.7 171.1 206.1 171.1 223.7 182.4 233.8 192.1L270.6 156.6C247 134.4 216.4 121 179.7 121 104.7 121 44 181.8 44 257 44 332.2 104.7 393 179.7 393 258 393 310 337.8 310 260.1 310 251.2 309 244.4 307.9 237.6L179.7 237.6 179.7 237.6ZM468 236.7L429.3 236.7 429.3 198 390.7 198 390.7 236.7 352 236.7 352 275.3 390.7 275.3 390.7 314 429.3 314 429.3 275.3 468 275.3"/></svg></li>
<li><svg viewBox="0 0 512 512"><path d="M419.6 168.6c-11.7 5.2-24.2 8.7-37.4 10.2 13.4-8.1 23.8-20.8 28.6-36 -12.6 7.5-26.5 12.9-41.3 15.8 -11.9-12.6-28.8-20.6-47.5-20.6 -42 0-72.9 39.2-63.4 79.9 -54.1-2.7-102.1-28.6-134.2-68 -17 29.2-8.8 67.5 20.1 86.9 -10.7-0.3-20.7-3.3-29.5-8.1 -0.7 30.2 20.9 58.4 52.2 64.6 -9.2 2.5-19.2 3.1-29.4 1.1 8.3 25.9 32.3 44.7 60.8 45.2 -27.4 21.4-61.8 31-96.4 27 28.8 18.5 63 29.2 99.8 29.2 120.8 0 189.1-102.1 185-193.6C399.9 193.1 410.9 181.7 419.6 168.6z"/></svg></li>
</ul>
</nav>
</header>
You could wrap the three sections of the banner with a div like this:
<header role="banner">
<div class="banner-block">
...
</div>
<div class="banner-block">
...
</div>
<div class="banner-block">
...
</div>
</header>
The three banner-block flex items can then be evenly spaced across the banner with this CSS:
.banner-block {
width: 33.333% ;
flex: 1 0;
}
And the h1 logo in the middle can be centered using this:
h1 {
margin: 0 auto;
}
See this updated codepen

Is there a way to create a chrome-like tab using CSS?

I have been looking for a Google Chrome-like tab written using CSS but cannot find one.
I am trying to replicate the look in order to use it in a web application or a website.
yeah its possible, with css3
Ive posted a blog about how to its a lil depthy, and sadly enouth not going to work on ie unless you use images
Edit:
Removed old reference to redeyeoperations cause its a link farm now.
This is a bit lighter version also it is up on a 3rd party site, so its less likely to be down.
http://codepen.io/jacoblwe20/pen/DxAJF
Here is the code
var tabs = $('.tabs > li');
tabs.on("click", function(){
tabs.removeClass('active');
$(this).addClass('active');
});
body {
background: #efefef;
font: .8em sans-serif;
margin: 0;
}
.tab-container {
background: #2BA6CB;
margin: 0;
padding: 0;
max-height: 35px;
}
ul.tabs {
margin: 0;
list-style-type: none;
line-height: 35px;
max-height: 35px;
overflow: hidden;
display: inline-block;
padding-right: 20px
}
ul.tabs > li.active {
z-index: 2;
background: #efefef;
}
ul.tabs > li.active:before {
border-color: transparent #efefef transparent transparent;
}
ul.tabs > li.active:after {
border-color: transparent transparent transparent #efefef;
}
ul.tabs > li {
float: right;
margin: 5px -10px 0;
border-top-right-radius: 25px 170px;
border-top-left-radius: 20px 90px;
padding: 0 30px 0 25px;
height: 170px;
background: #ddd;
position: relative;
box-shadow: 0 10px 20px rgba(0, 0, 0, .5);
max-width: 200px;
}
ul.tabs > li > a {
display: inline-block;
max-width: 100%;
overflow: hidden;
text-overflow: ellipsis;
text-decoration: none;
color: #222;
}
ul.tabs > li:before,
ul.tabs > li:after {
content: '';
background: transparent;
height: 20px;
width: 20px;
border-radius: 100%;
border-width: 10px;
top: 0px;
border-style: solid;
position: absolute;
}
ul.tabs > li:before {
border-color: transparent #ddd transparent transparent;
-webkit-transform: rotate(48deg);
-moz-transform: rotate(48deg);
-ms-transform: rotate(48deg);
-o-transform: rotate(48deg);
transform: rotate(48deg);
left: -23px;
}
ul.tabs > li:after {
border-color: transparent transparent transparent #ddd;
-webkit-transform: rotate(-48deg);
-moz-transform: rotate(-48deg);
-ms-transform: rotate(-48deg);
-o-transform: rotate(-48deg);
transform: rotate(-48deg);
right: -17px;
}
/* Clear Fix took for HTML 5 Boilerlate*/
.clearfix:before, .clearfix:after { content: ""; display: table; }
.clearfix:after { clear: both; }
.clearfix { zoom: 1; }
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class=tab-container>
<ul class="tabs clearfix" >
<li>
<a href=# >Users</a>
</li>
<li class=active >
<a href=# >Pending Lots</a>
</li>
<li>
<a href=# >Nearby Lots</a>
</li>
<li>
<a href=# >Recent Lots</a>
</li>
</ul>
</div>
<div class=outer-circle></div>
I am just giving some css for getting chrome like tabs, rest its up to you to use as you want.
<style type='text/css'>
.chrome_tab {
width: 150px;
height: 0;
border-left: 12px solid transparent;
border-right: 12px solid transparent;
border-bottom: 20px solid grey;
border-radius: 80px 80px 2px 2px;
color: white;
text-align: center;
}
</style>
<div class='chrome_tab'>
muhammad(peace be upon him)
</div>
demo here
http://jsfiddle.net/GH7d6/
What about this :
http://codepen.io/justd/pen/dPeKEG/
Find tuto here .
#import "compass/css3";
#import "compass";
.tab-container {
background: #8dc8fb;
margin: 0;
padding: 0;
max-height: 40px;
ul {
&.nav-tabs {
margin: 0;
list-style-type: none;
line-height: 40px;
max-height: 40px;
overflow: hidden;
display: inline-block;
#include display-flex;
padding-right: 20px;
border-bottom: 5px solid #f7f7f7;
$color: #c3d5e6;
> li {
$raduis: 28px 145px;
margin: 5px -14px 0;
#include border-top-left-radius($raduis);
#include border-top-right-radius($raduis);
padding: 0 30px 0 25px;
height: 170px;
background: $color;
position: relative;
#include box-shadow(0 4px 6px rgba(0,0,0,.5));
width: 200px;
max-width: 200px;
min-width: 20px;
border:1px solid #aaa;
&:first-child {
margin-left: 0;
}
&:last-of-type {
margin-right: 0;
}
> a {
display: block;
max-width:100%;
text-decoration: none;
color: #222;
padding: 3px 7px;
span {
overflow: hidden;
white-space: nowrap;
display: block;
}
&:focus,
&:hover {
background-color: transparent;
border-color: transparent;
}
.glyphicon-remove {
color: #777;
display: inline-block;
padding:3px;
font-size: 10px;
position:absolute;
z-index: 10;
top:7px;
right: -10px;
#include border-radius(50%);
&:hover {
background: #d39ea3;
color: white;
#include box-shadow(inset 0 1px 1px rgba(0,0,0,.25));
#include text-shadow(0 1px 1px rgba(0,0,0,.25));
}
}
}
&.active {
z-index: 2;
#include background-image(linear-gradient(white, #f7f7f7 30px));
> a {
background-color: transparent;
border-color: transparent;
border-bottom-color: transparent;
&:focus,
&:hover {
background-color: transparent;
border-color: transparent;
border-bottom-color: transparent;
}
}
}
}
.btn {
float: left;
height: 20px;
width: 35px;
min-width: 35px;
max-width: 35px;
margin: 10px 0 0 0;
border-color: #71a0c9;
outline: none;
#include transform(skew(30deg));
&.btn-default {
background: $color;
&:hover {
background: #d2deeb;
}
&:active {
background: #9cb5cc;
}
}
}
}
}
.tab-pane {
padding: 60px 40px;
text-align: center;
&.active {
border-top:1px solid #ddd;
}
}
}
I created here tabs like google chrome stylish UI, you can find the light and dark themes in the attached pen.
<div class="sd-tabs" dark>
<div class="sd-header-tabs">
<div class="sd-group-tabs">
<input class="sd-tab-radio" type="radio" tab id="rTab-1" name="tab">
<label class='sd-tab-label' for='rTab-1'>
<div class="sd-tab-icon">
<svg aria-hidden="true" data-prefix="fab" data-icon="whatsapp"
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"
class="svg-inline--fa fa-whatsapp fa-w-14 fa-2x">
<path fill="currentColor"
d="M380.9 97.1C339 55.1 283.2 32 223.9 32c-122.4 0-222 99.6-222 222 0 39.1 10.2 77.3 29.6 111L0 480l117.7-30.9c32.4 17.7 68.9 27 106.1 27h.1c122.3 0 224.1-99.6 224.1-222 0-59.3-25.2-115-67.1-157zm-157 341.6c-33.2 0-65.7-8.9-94-25.7l-6.7-4-69.8 18.3L72 359.2l-4.4-7c-18.5-29.4-28.2-63.3-28.2-98.2 0-101.7 82.8-184.5 184.6-184.5 49.3 0 95.6 19.2 130.4 54.1 34.8 34.9 56.2 81.2 56.1 130.5 0 101.8-84.9 184.6-186.6 184.6zm101.2-138.2c-5.5-2.8-32.8-16.2-37.9-18-5.1-1.9-8.8-2.8-12.5 2.8-3.7 5.6-14.3 18-17.6 21.8-3.2 3.7-6.5 4.2-12 1.4-32.6-16.3-54-29.1-75.5-66-5.7-9.8 5.7-9.1 16.3-30.3 1.8-3.7.9-6.9-.5-9.7-1.4-2.8-12.5-30.1-17.1-41.2-4.5-10.8-9.1-9.3-12.5-9.5-3.2-.2-6.9-.2-10.6-.2-3.7 0-9.7 1.4-14.8 6.9-5.1 5.6-19.4 19-19.4 46.3 0 27.3 19.9 53.7 22.6 57.4 2.8 3.7 39.1 59.7 94.8 83.8 35.2 15.2 49 16.5 66.6 13.9 10.7-1.6 32.8-13.4 37.4-26.4 4.6-13 4.6-24.1 3.2-26.4-1.3-2.5-5-3.9-10.5-6.6z" />
</svg>
</div>
<div class="sd-tab-desc">Descricao da tab bem grande para teste</div>
<div class="sd-tab-icon sd-tab-close">
<svg aria-hidden="true" data-prefix="fal" data-icon="times" xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 320 512" class="svg-inline--fa fa-times fa-w-10 fa-2x">
<path fill="currentColor"
d="M193.94 256L296.5 153.44l21.15-21.15c3.12-3.12 3.12-8.19 0-11.31l-22.63-22.63c-3.12-3.12-8.19-3.12-11.31 0L160 222.06 36.29 98.34c-3.12-3.12-8.19-3.12-11.31 0L2.34 120.97c-3.12 3.12-3.12 8.19 0 11.31L126.06 256 2.34 379.71c-3.12 3.12-3.12 8.19 0 11.31l22.63 22.63c3.12 3.12 8.19 3.12 11.31 0L160 289.94 262.56 392.5l21.15 21.15c3.12 3.12 8.19 3.12 11.31 0l22.63-22.63c3.12-3.12 3.12-8.19 0-11.31L193.94 256z" />
</svg>
</div>
</label>
<input class="sd-tab-radio" type="radio" tab id="rTab-2" name="tab">
<label class='sd-tab-label' for='rTab-2' icon-only>
<div class="sd-tab-icon">
<svg aria-hidden="true" data-prefix="fab" data-icon="whatsapp"
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"
class="svg-inline--fa fa-whatsapp fa-w-14 fa-2x">
<path fill="currentColor"
d="M380.9 97.1C339 55.1 283.2 32 223.9 32c-122.4 0-222 99.6-222 222 0 39.1 10.2 77.3 29.6 111L0 480l117.7-30.9c32.4 17.7 68.9 27 106.1 27h.1c122.3 0 224.1-99.6 224.1-222 0-59.3-25.2-115-67.1-157zm-157 341.6c-33.2 0-65.7-8.9-94-25.7l-6.7-4-69.8 18.3L72 359.2l-4.4-7c-18.5-29.4-28.2-63.3-28.2-98.2 0-101.7 82.8-184.5 184.6-184.5 49.3 0 95.6 19.2 130.4 54.1 34.8 34.9 56.2 81.2 56.1 130.5 0 101.8-84.9 184.6-186.6 184.6zm101.2-138.2c-5.5-2.8-32.8-16.2-37.9-18-5.1-1.9-8.8-2.8-12.5 2.8-3.7 5.6-14.3 18-17.6 21.8-3.2 3.7-6.5 4.2-12 1.4-32.6-16.3-54-29.1-75.5-66-5.7-9.8 5.7-9.1 16.3-30.3 1.8-3.7.9-6.9-.5-9.7-1.4-2.8-12.5-30.1-17.1-41.2-4.5-10.8-9.1-9.3-12.5-9.5-3.2-.2-6.9-.2-10.6-.2-3.7 0-9.7 1.4-14.8 6.9-5.1 5.6-19.4 19-19.4 46.3 0 27.3 19.9 53.7 22.6 57.4 2.8 3.7 39.1 59.7 94.8 83.8 35.2 15.2 49 16.5 66.6 13.9 10.7-1.6 32.8-13.4 37.4-26.4 4.6-13 4.6-24.1 3.2-26.4-1.3-2.5-5-3.9-10.5-6.6z" />
</svg>
</div>
<div class="sd-tab-desc"></div>
<div class="sd-tab-icon sd-tab-close">
<svg aria-hidden="true" data-prefix="fal" data-icon="times" xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 320 512" class="svg-inline--fa fa-times fa-w-10 fa-2x">
<path fill="currentColor"
d="M193.94 256L296.5 153.44l21.15-21.15c3.12-3.12 3.12-8.19 0-11.31l-22.63-22.63c-3.12-3.12-8.19-3.12-11.31 0L160 222.06 36.29 98.34c-3.12-3.12-8.19-3.12-11.31 0L2.34 120.97c-3.12 3.12-3.12 8.19 0 11.31L126.06 256 2.34 379.71c-3.12 3.12-3.12 8.19 0 11.31l22.63 22.63c3.12 3.12 8.19 3.12 11.31 0L160 289.94 262.56 392.5l21.15 21.15c3.12 3.12 8.19 3.12 11.31 0l22.63-22.63c3.12-3.12 3.12-8.19 0-11.31L193.94 256z" />
</svg>
</div>
</label>
<input class="sd-tab-radio" type="radio" tab id="rTab-3" name="tab">
<label class='sd-tab-label' for='rTab-3'>
<div class="sd-tab-icon">
<svg aria-hidden="true" data-prefix="fab" data-icon="whatsapp"
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"
class="svg-inline--fa fa-whatsapp fa-w-14 fa-2x">
<path fill="currentColor"
d="M380.9 97.1C339 55.1 283.2 32 223.9 32c-122.4 0-222 99.6-222 222 0 39.1 10.2 77.3 29.6 111L0 480l117.7-30.9c32.4 17.7 68.9 27 106.1 27h.1c122.3 0 224.1-99.6 224.1-222 0-59.3-25.2-115-67.1-157zm-157 341.6c-33.2 0-65.7-8.9-94-25.7l-6.7-4-69.8 18.3L72 359.2l-4.4-7c-18.5-29.4-28.2-63.3-28.2-98.2 0-101.7 82.8-184.5 184.6-184.5 49.3 0 95.6 19.2 130.4 54.1 34.8 34.9 56.2 81.2 56.1 130.5 0 101.8-84.9 184.6-186.6 184.6zm101.2-138.2c-5.5-2.8-32.8-16.2-37.9-18-5.1-1.9-8.8-2.8-12.5 2.8-3.7 5.6-14.3 18-17.6 21.8-3.2 3.7-6.5 4.2-12 1.4-32.6-16.3-54-29.1-75.5-66-5.7-9.8 5.7-9.1 16.3-30.3 1.8-3.7.9-6.9-.5-9.7-1.4-2.8-12.5-30.1-17.1-41.2-4.5-10.8-9.1-9.3-12.5-9.5-3.2-.2-6.9-.2-10.6-.2-3.7 0-9.7 1.4-14.8 6.9-5.1 5.6-19.4 19-19.4 46.3 0 27.3 19.9 53.7 22.6 57.4 2.8 3.7 39.1 59.7 94.8 83.8 35.2 15.2 49 16.5 66.6 13.9 10.7-1.6 32.8-13.4 37.4-26.4 4.6-13 4.6-24.1 3.2-26.4-1.3-2.5-5-3.9-10.5-6.6z" />
</svg>
</div>
<div class="sd-tab-desc">Descricao da tab bem grande para teste</div>
<div class="sd-tab-icon sd-tab-close">
<svg aria-hidden="true" data-prefix="fal" data-icon="times" xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 320 512" class="svg-inline--fa fa-times fa-w-10 fa-2x">
<path fill="currentColor"
d="M193.94 256L296.5 153.44l21.15-21.15c3.12-3.12 3.12-8.19 0-11.31l-22.63-22.63c-3.12-3.12-8.19-3.12-11.31 0L160 222.06 36.29 98.34c-3.12-3.12-8.19-3.12-11.31 0L2.34 120.97c-3.12 3.12-3.12 8.19 0 11.31L126.06 256 2.34 379.71c-3.12 3.12-3.12 8.19 0 11.31l22.63 22.63c3.12 3.12 8.19 3.12 11.31 0L160 289.94 262.56 392.5l21.15 21.15c3.12 3.12 8.19 3.12 11.31 0l22.63-22.63c3.12-3.12 3.12-8.19 0-11.31L193.94 256z" />
</svg>
</div>
</label>
<input class="sd-tab-radio" type="radio" tab id="rTab-4" name="tab">
<label class='sd-tab-label' for='rTab-4'>
<div class="sd-tab-icon">
<svg aria-hidden="true" data-prefix="fab" data-icon="whatsapp"
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"
class="svg-inline--fa fa-whatsapp fa-w-14 fa-2x">
<path fill="currentColor"
d="M380.9 97.1C339 55.1 283.2 32 223.9 32c-122.4 0-222 99.6-222 222 0 39.1 10.2 77.3 29.6 111L0 480l117.7-30.9c32.4 17.7 68.9 27 106.1 27h.1c122.3 0 224.1-99.6 224.1-222 0-59.3-25.2-115-67.1-157zm-157 341.6c-33.2 0-65.7-8.9-94-25.7l-6.7-4-69.8 18.3L72 359.2l-4.4-7c-18.5-29.4-28.2-63.3-28.2-98.2 0-101.7 82.8-184.5 184.6-184.5 49.3 0 95.6 19.2 130.4 54.1 34.8 34.9 56.2 81.2 56.1 130.5 0 101.8-84.9 184.6-186.6 184.6zm101.2-138.2c-5.5-2.8-32.8-16.2-37.9-18-5.1-1.9-8.8-2.8-12.5 2.8-3.7 5.6-14.3 18-17.6 21.8-3.2 3.7-6.5 4.2-12 1.4-32.6-16.3-54-29.1-75.5-66-5.7-9.8 5.7-9.1 16.3-30.3 1.8-3.7.9-6.9-.5-9.7-1.4-2.8-12.5-30.1-17.1-41.2-4.5-10.8-9.1-9.3-12.5-9.5-3.2-.2-6.9-.2-10.6-.2-3.7 0-9.7 1.4-14.8 6.9-5.1 5.6-19.4 19-19.4 46.3 0 27.3 19.9 53.7 22.6 57.4 2.8 3.7 39.1 59.7 94.8 83.8 35.2 15.2 49 16.5 66.6 13.9 10.7-1.6 32.8-13.4 37.4-26.4 4.6-13 4.6-24.1 3.2-26.4-1.3-2.5-5-3.9-10.5-6.6z" />
</svg>
</div>
<div class="sd-tab-desc">Descricao da tab bem grande para teste</div>
<div class="sd-tab-icon sd-tab-close">
<svg aria-hidden="true" data-prefix="fal" data-icon="times" xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 320 512" class="svg-inline--fa fa-times fa-w-10 fa-2x">
<path fill="currentColor"
d="M193.94 256L296.5 153.44l21.15-21.15c3.12-3.12 3.12-8.19 0-11.31l-22.63-22.63c-3.12-3.12-8.19-3.12-11.31 0L160 222.06 36.29 98.34c-3.12-3.12-8.19-3.12-11.31 0L2.34 120.97c-3.12 3.12-3.12 8.19 0 11.31L126.06 256 2.34 379.71c-3.12 3.12-3.12 8.19 0 11.31l22.63 22.63c3.12 3.12 8.19 3.12 11.31 0L160 289.94 262.56 392.5l21.15 21.15c3.12 3.12 8.19 3.12 11.31 0l22.63-22.63c3.12-3.12 3.12-8.19 0-11.31L193.94 256z" />
</svg>
</div>
</label>
<input class="sd-tab-radio" type="radio" tab id="rTab-5" name="tab">
<label class='sd-tab-label' for='rTab-5'>
<div class="sd-tab-icon">
<svg aria-hidden="true" data-prefix="fab" data-icon="whatsapp"
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"
class="svg-inline--fa fa-whatsapp fa-w-14 fa-2x">
<path fill="currentColor"
d="M380.9 97.1C339 55.1 283.2 32 223.9 32c-122.4 0-222 99.6-222 222 0 39.1 10.2 77.3 29.6 111L0 480l117.7-30.9c32.4 17.7 68.9 27 106.1 27h.1c122.3 0 224.1-99.6 224.1-222 0-59.3-25.2-115-67.1-157zm-157 341.6c-33.2 0-65.7-8.9-94-25.7l-6.7-4-69.8 18.3L72 359.2l-4.4-7c-18.5-29.4-28.2-63.3-28.2-98.2 0-101.7 82.8-184.5 184.6-184.5 49.3 0 95.6 19.2 130.4 54.1 34.8 34.9 56.2 81.2 56.1 130.5 0 101.8-84.9 184.6-186.6 184.6zm101.2-138.2c-5.5-2.8-32.8-16.2-37.9-18-5.1-1.9-8.8-2.8-12.5 2.8-3.7 5.6-14.3 18-17.6 21.8-3.2 3.7-6.5 4.2-12 1.4-32.6-16.3-54-29.1-75.5-66-5.7-9.8 5.7-9.1 16.3-30.3 1.8-3.7.9-6.9-.5-9.7-1.4-2.8-12.5-30.1-17.1-41.2-4.5-10.8-9.1-9.3-12.5-9.5-3.2-.2-6.9-.2-10.6-.2-3.7 0-9.7 1.4-14.8 6.9-5.1 5.6-19.4 19-19.4 46.3 0 27.3 19.9 53.7 22.6 57.4 2.8 3.7 39.1 59.7 94.8 83.8 35.2 15.2 49 16.5 66.6 13.9 10.7-1.6 32.8-13.4 37.4-26.4 4.6-13 4.6-24.1 3.2-26.4-1.3-2.5-5-3.9-10.5-6.6z" />
</svg>
</div>
<div class="sd-tab-desc">Descricao da tab bem grande para teste</div>
<div class="sd-tab-icon sd-tab-close">
<svg aria-hidden="true" data-prefix="fal" data-icon="times" xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 320 512" class="svg-inline--fa fa-times fa-w-10 fa-2x">
<path fill="currentColor"
d="M193.94 256L296.5 153.44l21.15-21.15c3.12-3.12 3.12-8.19 0-11.31l-22.63-22.63c-3.12-3.12-8.19-3.12-11.31 0L160 222.06 36.29 98.34c-3.12-3.12-8.19-3.12-11.31 0L2.34 120.97c-3.12 3.12-3.12 8.19 0 11.31L126.06 256 2.34 379.71c-3.12 3.12-3.12 8.19 0 11.31l22.63 22.63c3.12 3.12 8.19 3.12 11.31 0L160 289.94 262.56 392.5l21.15 21.15c3.12 3.12 8.19 3.12 11.31 0l22.63-22.63c3.12-3.12 3.12-8.19 0-11.31L193.94 256z" />
</svg>
</div>
</label>
<input class="sd-tab-radio" type="radio" tab id="rTab-6" name="tab">
<label class='sd-tab-label' for='rTab-6'>
<div class="sd-tab-icon">
<svg aria-hidden="true" data-prefix="fab" data-icon="whatsapp"
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"
class="svg-inline--fa fa-whatsapp fa-w-14 fa-2x">
<path fill="currentColor"
d="M380.9 97.1C339 55.1 283.2 32 223.9 32c-122.4 0-222 99.6-222 222 0 39.1 10.2 77.3 29.6 111L0 480l117.7-30.9c32.4 17.7 68.9 27 106.1 27h.1c122.3 0 224.1-99.6 224.1-222 0-59.3-25.2-115-67.1-157zm-157 341.6c-33.2 0-65.7-8.9-94-25.7l-6.7-4-69.8 18.3L72 359.2l-4.4-7c-18.5-29.4-28.2-63.3-28.2-98.2 0-101.7 82.8-184.5 184.6-184.5 49.3 0 95.6 19.2 130.4 54.1 34.8 34.9 56.2 81.2 56.1 130.5 0 101.8-84.9 184.6-186.6 184.6zm101.2-138.2c-5.5-2.8-32.8-16.2-37.9-18-5.1-1.9-8.8-2.8-12.5 2.8-3.7 5.6-14.3 18-17.6 21.8-3.2 3.7-6.5 4.2-12 1.4-32.6-16.3-54-29.1-75.5-66-5.7-9.8 5.7-9.1 16.3-30.3 1.8-3.7.9-6.9-.5-9.7-1.4-2.8-12.5-30.1-17.1-41.2-4.5-10.8-9.1-9.3-12.5-9.5-3.2-.2-6.9-.2-10.6-.2-3.7 0-9.7 1.4-14.8 6.9-5.1 5.6-19.4 19-19.4 46.3 0 27.3 19.9 53.7 22.6 57.4 2.8 3.7 39.1 59.7 94.8 83.8 35.2 15.2 49 16.5 66.6 13.9 10.7-1.6 32.8-13.4 37.4-26.4 4.6-13 4.6-24.1 3.2-26.4-1.3-2.5-5-3.9-10.5-6.6z" />
</svg>
</div>
<div class="sd-tab-desc">Descricao da tab bem grande para teste</div>
<div class="sd-tab-icon sd-tab-close">
<svg aria-hidden="true" data-prefix="fal" data-icon="times" xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 320 512" class="svg-inline--fa fa-times fa-w-10 fa-2x">
<path fill="currentColor"
d="M193.94 256L296.5 153.44l21.15-21.15c3.12-3.12 3.12-8.19 0-11.31l-22.63-22.63c-3.12-3.12-8.19-3.12-11.31 0L160 222.06 36.29 98.34c-3.12-3.12-8.19-3.12-11.31 0L2.34 120.97c-3.12 3.12-3.12 8.19 0 11.31L126.06 256 2.34 379.71c-3.12 3.12-3.12 8.19 0 11.31l22.63 22.63c3.12 3.12 8.19 3.12 11.31 0L160 289.94 262.56 392.5l21.15 21.15c3.12 3.12 8.19 3.12 11.31 0l22.63-22.63c3.12-3.12 3.12-8.19 0-11.31L193.94 256z" />
</svg>
</div>
</label>
<input class="sd-tab-radio" type="radio" tab id="rTab-7" name="tab">
<label class='sd-tab-label' for='rTab-7'>
<div class="sd-tab-icon">
<svg aria-hidden="true" data-prefix="fab" data-icon="whatsapp"
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"
class="svg-inline--fa fa-whatsapp fa-w-14 fa-2x">
<path fill="currentColor"
d="M380.9 97.1C339 55.1 283.2 32 223.9 32c-122.4 0-222 99.6-222 222 0 39.1 10.2 77.3 29.6 111L0 480l117.7-30.9c32.4 17.7 68.9 27 106.1 27h.1c122.3 0 224.1-99.6 224.1-222 0-59.3-25.2-115-67.1-157zm-157 341.6c-33.2 0-65.7-8.9-94-25.7l-6.7-4-69.8 18.3L72 359.2l-4.4-7c-18.5-29.4-28.2-63.3-28.2-98.2 0-101.7 82.8-184.5 184.6-184.5 49.3 0 95.6 19.2 130.4 54.1 34.8 34.9 56.2 81.2 56.1 130.5 0 101.8-84.9 184.6-186.6 184.6zm101.2-138.2c-5.5-2.8-32.8-16.2-37.9-18-5.1-1.9-8.8-2.8-12.5 2.8-3.7 5.6-14.3 18-17.6 21.8-3.2 3.7-6.5 4.2-12 1.4-32.6-16.3-54-29.1-75.5-66-5.7-9.8 5.7-9.1 16.3-30.3 1.8-3.7.9-6.9-.5-9.7-1.4-2.8-12.5-30.1-17.1-41.2-4.5-10.8-9.1-9.3-12.5-9.5-3.2-.2-6.9-.2-10.6-.2-3.7 0-9.7 1.4-14.8 6.9-5.1 5.6-19.4 19-19.4 46.3 0 27.3 19.9 53.7 22.6 57.4 2.8 3.7 39.1 59.7 94.8 83.8 35.2 15.2 49 16.5 66.6 13.9 10.7-1.6 32.8-13.4 37.4-26.4 4.6-13 4.6-24.1 3.2-26.4-1.3-2.5-5-3.9-10.5-6.6z" />
</svg>
</div>
<div class="sd-tab-desc">Descricao da tab bem grande para teste</div>
<div class="sd-tab-icon sd-tab-close">
<svg aria-hidden="true" data-prefix="fal" data-icon="times" xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 320 512" class="svg-inline--fa fa-times fa-w-10 fa-2x">
<path fill="currentColor"
d="M193.94 256L296.5 153.44l21.15-21.15c3.12-3.12 3.12-8.19 0-11.31l-22.63-22.63c-3.12-3.12-8.19-3.12-11.31 0L160 222.06 36.29 98.34c-3.12-3.12-8.19-3.12-11.31 0L2.34 120.97c-3.12 3.12-3.12 8.19 0 11.31L126.06 256 2.34 379.71c-3.12 3.12-3.12 8.19 0 11.31l22.63 22.63c3.12 3.12 8.19 3.12 11.31 0L160 289.94 262.56 392.5l21.15 21.15c3.12 3.12 8.19 3.12 11.31 0l22.63-22.63c3.12-3.12 3.12-8.19 0-11.31L193.94 256z" />
</svg>
</div>
</label>
</div>
</div>
</div>

Resources