How to make a centered SVG image and text responsive? - html
I'm looking for a way to make responsive a SVG image and a text above it, that are centered in the page. The solution posted here doesn't work in my case.
Here is my code:
body {
background: white;
font-family: "Lucida Console", Monaco, monospace;
}
.container {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.text-line {
text-align: center;
color: #2a2f33;
position: relative;
white-space: nowrap;
overflow: hidden;
}
<div class="container">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="512px" height="118px" viewBox="0 0 512 118" version="1.1" preserveAspectRatio="xMidYMid">
<defs>
<linearGradient x1="63.809892%" y1="70.3374666%" x2="32.3301087%" y2="22.2678268%" id="linearGradient-1">
<stop stop-color="#FCD08F" offset="0%"/>
<stop stop-color="#F79673" offset="100%"/>
</linearGradient>
<linearGradient x1="87.2564115%" y1="28.4536279%" x2="13.5510427%" y2="89.1540742%" id="linearGradient-2">
<stop stop-color="#E74047" offset="0%"/>
<stop stop-color="#7F50A0" offset="100%"/>
</linearGradient>
<linearGradient x1="87.6749398%" y1="70.707777%" x2="12.8241649%" y2="11.4981431%" id="linearGradient-3">
<stop stop-color="#E6FFAB" offset="0%"/>
<stop stop-color="#47BEBC" offset="100%"/>
</linearGradient>
<linearGradient x1="50.0011435%" y1="99.9998449%" x2="50.0011435%" y2="0.000388913438%" id="linearGradient-4">
<stop stop-color="#84E9DB" offset="0%"/>
<stop stop-color="#197491" offset="100%"/>
</linearGradient>
</defs>
<g>
<g transform="translate(0.000000, -0.000009)" fill-rule="nonzero">
<path d="M427.167431,30.8014194 L431.494833,30.8014194 L431.494833,83.527398 L427.167431,83.527398 L427.167431,30.8014194 Z M469.758178,77.2640501 C469.758178,80.2822992 471.238605,83.5273953 471.238605,83.5273953 L466.227929,83.5273953 C466.227929,83.5273953 464.861381,80.6804202 464.861381,78.0612031 C464.861381,78.0612031 459.79331,84.4384273 450.740384,84.4384273 C441.687459,84.4384273 437.985936,79.7119931 437.985936,73.0505269 C437.985936,66.3890608 444.078007,61.6626266 456.434335,61.6626266 L465.089139,61.6480501 L465.089139,56.5380714 C465.089139,56.5380714 465.203018,47.9971462 454.61227,47.9971462 C444.021523,47.9971462 444.249281,55.3847049 444.249281,55.3847049 L439.580242,55.3992814 C439.580242,55.3992814 439.997495,44.5771319 454.726149,44.5771319 C469.454804,44.5771319 469.758178,56.0825554 469.758178,56.0825554 L469.758178,77.2640501 Z M465.089139,69.6915519 L465.089139,64.9077227 L456.092698,64.9077227 C448.690562,64.9077227 442.59758,68.2676088 442.59758,73.392164 C442.59758,78.5167191 446.469466,80.7378152 451.138505,80.7378152 C455.807544,80.7378152 465.089139,77.3788401 465.089139,69.6915519 Z M474.237722,45.4918081 L478.792883,45.4918081 L492.913879,77.9099718 L506.655886,45.4918081 L511.817794,45.4918081 C511.817794,45.4918081 493.825822,87.8165341 492.154989,91.802301 C490.484157,95.7880661 486.498391,99.4704576 481.602505,99.4704576 C479.39963,99.4704576 477.198577,98.1795252 477.198577,98.1795252 L478.413893,94.7631551 C478.413893,94.7631551 479.515331,95.3708135 481.678121,95.3708135 C483.840911,95.3708135 487.599829,90.3601355 487.599829,90.3601355 L490.332925,83.8307689 L474.237722,45.4918081 Z M404.438093,44.5771319 C412.637381,44.5771319 421.519943,50.1180287 421.519943,64.2034949 C421.519943,78.2889611 414.117808,84.4384273 404.551972,84.4384273 C395.15832,84.4384273 390.935687,77.5346266 390.787189,77.2868259 L390.787189,98.1039096 L390.772612,98.1039096 L386.459786,98.1039096 L386.459786,45.4918081 L390.772612,45.4918081 L390.787189,45.4918081 L390.787189,51.3952956 C390.937509,51.2094451 396.353594,44.5771319 404.438093,44.5771319 Z M403.754819,80.9081782 C411.726349,80.9081782 417.078662,73.7292458 417.078662,64.5068686 C417.078662,55.2844914 411.270833,48.2239931 404.324214,48.2239931 C396.683388,48.2239931 390.93842,55.9714095 390.787189,56.1763917 L390.787189,72.6177867 C390.937509,72.8646764 395.905367,80.9081782 403.754819,80.9081782 Z M183.251359,34.5238935 L176.929708,40.482954 L174.005295,41.2664415 L175.823715,38.2864558 C175.823715,38.2864558 170.21358,30.9162067 160.256,30.9162067 C150.300242,30.9162067 138.842192,37.6988401 138.842192,53.7311818 C138.842192,66.8637084 149.469381,81.2498152 165.867957,81.2498152 C171.536399,81.2498152 175.270719,79.1334878 175.270719,79.1334878 L175.270719,67.3738864 C175.270719,67.3738864 166.835473,67.2754949 163.654149,68.0790252 L169.581324,64.7856444 L186.412641,64.7856444 C186.412641,64.7856444 183.251359,66.3945269 183.251359,71.0580999 C183.251359,75.724406 183.251359,80.5464985 183.251359,80.5464985 C183.251359,80.5464985 171.04353,84.544107 160.177651,84.544107 C139.157409,84.544107 130.702121,69.09847 130.702121,56.866954 C130.702121,42.872591 141.884128,28.0947405 161.126036,28.0947405 C176.930619,28.0947405 183.251359,34.5238935 183.251359,34.5238935 Z M210.001993,44.7283632 C221.282391,44.7283632 229.638377,52.5823704 229.638377,64.1133027 C229.638377,75.6442351 221.030947,83.8307689 208.748413,83.8307689 C196.467701,83.8307689 189.532925,73.4705127 189.532925,64.8649042 C189.532925,52.9158081 198.723416,44.7283632 210.001993,44.7283632 Z M210.837409,81.3236088 C220.146335,81.3236088 221.44911,71.7987689 221.448199,67.9560358 C221.448199,56.7977156 215.849907,47.2346124 207.745367,47.2346124 C202.065082,47.2346124 197.134577,52.4147405 197.134577,59.683865 C197.134577,66.9539006 201.529395,81.3236088 210.837409,81.3236088 Z M253.891872,44.748406 C265.166804,44.748406 273.517324,52.5987689 273.517324,64.1242351 C273.517324,75.6497013 264.91627,83.83168 252.639203,83.83168 C240.363046,83.83168 233.431915,73.4759789 233.431915,64.8749255 C233.431915,52.9322067 242.617851,44.748406 253.891872,44.748406 Z M254.726377,81.3254309 C264.031658,81.3254309 265.333523,71.8051462 265.333523,67.9633241 C265.333523,56.8122921 259.738875,47.253744 251.637068,47.253744 C245.959516,47.253744 241.030833,52.431139 241.030833,59.6957084 C241.030833,66.9611889 245.423829,81.3254309 254.726377,81.3254309 Z M305.905423,81.0594095 C309.933096,83.8407903 312.710833,87.8037796 312.712655,93.0103295 C312.712655,103.926315 299.143744,108.199055 291.216854,108.199055 C283.290875,108.199055 273.622093,104.98129 273.622093,96.4139451 C273.622093,82.2428401 295.740128,82.2227974 295.740128,82.2227974 C295.740128,82.2227974 293.376,79.7748544 293.376,77.035381 C293.376,75.355438 293.956327,74.0881924 293.956327,74.0881924 C293.956327,74.0881924 293.292185,74.2959077 292.296427,74.2959077 C282.709637,74.2959077 277.854747,67.449502 277.854747,61.7236657 C277.854747,53.5899718 285.241395,46.0366052 295.034989,46.0366052 C304.826762,46.0366052 314.122021,46.0366052 314.122021,46.0366052 L309.226135,48.9418864 L304.330249,49.1067832 C304.330249,49.1067832 309.475758,52.5094878 309.475758,60.1457583 C309.475758,65.2921782 306.859274,68.1345981 303.996811,70.8531177 C301.134349,73.5707262 301.09153,74.5455305 301.09153,75.7480928 C301.09153,76.9515661 301.879573,78.2807618 305.905423,81.0594095 Z M295.40669,71.8060572 C301.19721,71.8060572 302.315046,67.2627405 302.315046,63.9010323 C302.315046,54.2532031 296.839744,48.9619291 292.231744,48.9619291 C287.625566,48.9619291 285.011815,52.6971604 285.011815,57.9264842 C285.011815,63.1548971 289.617993,71.8060572 295.40669,71.8060572 Z M294.972128,104.671539 C297.646918,104.671539 306.922135,103.926315 306.922135,95.8946569 C306.922135,90.2945412 302.44168,88.5198508 298.393964,84.941317 C298.393964,84.941317 297.088456,84.7226693 295.561566,84.7226693 C294.036498,84.7226693 280.904883,85.5644629 280.904883,94.589148 C280.904883,103.613831 292.295516,104.671539 294.972128,104.671539 Z M313.144484,28.2459718 L318.604299,25.2668971 L330.582548,25.2668971 C327.791146,26.7564344 326.745281,27.9362209 326.67331,34.8864842 C326.601338,41.8349255 326.237836,77.233075 326.237836,77.233075 C326.237836,79.8823561 328.541836,80.6002494 330.618078,80.6002494 C332.507559,80.6002494 333.37395,80.9673953 333.37395,80.9673953 L330.83126,82.7357084 L316.307587,82.7357084 C316.307587,82.7357084 318.39294,80.8717369 318.418448,79.0123205 L319.163673,28.2605483 L313.144484,28.2459718 Z M366.114619,54.8927476 L347.07405,62.526285 L340.615744,62.8624558 C340.615744,62.8624558 356.762875,56.2775163 357.392399,55.1451035 C358.019189,54.0136017 356.720968,47.5962921 349.591231,47.5962921 C346.037295,47.5962921 340.363388,50.8668971 340.363388,59.0042351 C340.363388,71.0808757 349.423601,79.3020287 357.222036,79.3020287 C362.423117,79.3020287 367.120399,76.5334024 367.120399,76.5334024 C367.120399,76.5334024 362.674562,83.8307689 352.860925,83.8307689 C338.853808,83.8307689 333.233651,73.1771604 333.233651,63.7006052 C333.233651,54.223139 339.609964,44.5771319 351.855146,44.5771319 C364.100327,44.5771319 366.114619,54.8927476 366.114619,54.8927476 Z" fill="#808285"/>
<g>
<path d="M81.2440142,77.0025839 C95.1709609,69.3799789 105.80726,63.5575732 106.774776,63.0273526 C109.660925,61.447623 112.684641,57.4163063 106.774776,54.193986 C104.875274,53.1563205 94.5250391,47.5124771 81.2276157,40.2579291 L62.9386477,58.687196 L81.2440142,77.0025839 Z" fill="url(#linearGradient-1)"/>
<path d="M62.9377367,58.687196 L4.44219217,117.629148 C5.76318861,117.796778 7.35202847,117.446942 9.17955872,116.446628 C12.9630747,114.375853 53.5951032,92.1348277 81.2440142,77.0007618 L62.9377367,58.687196 Z" fill="url(#linearGradient-2)"/>
<path d="M62.9377367,58.687196 L81.2267046,40.2579291 C81.2267046,40.2579291 13.2491388,3.1707266 9.17955872,0.950541548 C7.61531673,0.0969045651 5.90986477,-0.201002908 4.4002847,0.13516791 L62.9377367,58.687196 Z" fill="url(#linearGradient-3)"/>
<path d="M62.9377367,58.687196 L4.39937367,0.136078942 C1.98149466,0.675409903 0,2.76805045 0,6.97428532 C0,13.8070252 0,104.867411 0,110.60418 C0,114.565347 1.5587758,117.351283 4.44128114,117.629148 L62.9377367,58.687196 Z" fill="url(#linearGradient-4)"/>
</g>
</g>
</g>
</svg>
<div class="text-line">Some text under the SVG image</div>
</div>
Link to JsFiddle
As you can see I set white-space: nowrap; to avoid text going to new line in case of small displays.
Now, how can I edit my code to make both SVG image and text to scale according to different device resolution and keeping to being centered in the page?
Consider using viewport-related sizing units, in this case vw:
body {
background: white;
font-family: "Lucida Console", Monaco, monospace;
}
.container {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 25em;
font-size:2vw;
}
.text-line {
text-align: center;
color: #2a2f33;
position: relative;
white-space: nowrap;
overflow: hidden;
}
<div class="container">
<svg viewBox="0 0 512 118">
<defs>
<linearGradient x1="63.809892%" y1="70.3374666%" x2="32.3301087%" y2="22.2678268%" id="linearGradient-1">
<stop stop-color="#FCD08F" offset="0%"/>
<stop stop-color="#F79673" offset="100%"/>
</linearGradient>
<linearGradient x1="87.2564115%" y1="28.4536279%" x2="13.5510427%" y2="89.1540742%" id="linearGradient-2">
<stop stop-color="#E74047" offset="0%"/>
<stop stop-color="#7F50A0" offset="100%"/>
</linearGradient>
<linearGradient x1="87.6749398%" y1="70.707777%" x2="12.8241649%" y2="11.4981431%" id="linearGradient-3">
<stop stop-color="#E6FFAB" offset="0%"/>
<stop stop-color="#47BEBC" offset="100%"/>
</linearGradient>
<linearGradient x1="50.0011435%" y1="99.9998449%" x2="50.0011435%" y2="0.000388913438%" id="linearGradient-4">
<stop stop-color="#84E9DB" offset="0%"/>
<stop stop-color="#197491" offset="100%"/>
</linearGradient>
</defs>
<g>
<g transform="translate(0.000000, -0.000009)" fill-rule="nonzero">
<path d="M427.167431,30.8014194 L431.494833,30.8014194 L431.494833,83.527398 L427.167431,83.527398 L427.167431,30.8014194 Z M469.758178,77.2640501 C469.758178,80.2822992 471.238605,83.5273953 471.238605,83.5273953 L466.227929,83.5273953 C466.227929,83.5273953 464.861381,80.6804202 464.861381,78.0612031 C464.861381,78.0612031 459.79331,84.4384273 450.740384,84.4384273 C441.687459,84.4384273 437.985936,79.7119931 437.985936,73.0505269 C437.985936,66.3890608 444.078007,61.6626266 456.434335,61.6626266 L465.089139,61.6480501 L465.089139,56.5380714 C465.089139,56.5380714 465.203018,47.9971462 454.61227,47.9971462 C444.021523,47.9971462 444.249281,55.3847049 444.249281,55.3847049 L439.580242,55.3992814 C439.580242,55.3992814 439.997495,44.5771319 454.726149,44.5771319 C469.454804,44.5771319 469.758178,56.0825554 469.758178,56.0825554 L469.758178,77.2640501 Z M465.089139,69.6915519 L465.089139,64.9077227 L456.092698,64.9077227 C448.690562,64.9077227 442.59758,68.2676088 442.59758,73.392164 C442.59758,78.5167191 446.469466,80.7378152 451.138505,80.7378152 C455.807544,80.7378152 465.089139,77.3788401 465.089139,69.6915519 Z M474.237722,45.4918081 L478.792883,45.4918081 L492.913879,77.9099718 L506.655886,45.4918081 L511.817794,45.4918081 C511.817794,45.4918081 493.825822,87.8165341 492.154989,91.802301 C490.484157,95.7880661 486.498391,99.4704576 481.602505,99.4704576 C479.39963,99.4704576 477.198577,98.1795252 477.198577,98.1795252 L478.413893,94.7631551 C478.413893,94.7631551 479.515331,95.3708135 481.678121,95.3708135 C483.840911,95.3708135 487.599829,90.3601355 487.599829,90.3601355 L490.332925,83.8307689 L474.237722,45.4918081 Z M404.438093,44.5771319 C412.637381,44.5771319 421.519943,50.1180287 421.519943,64.2034949 C421.519943,78.2889611 414.117808,84.4384273 404.551972,84.4384273 C395.15832,84.4384273 390.935687,77.5346266 390.787189,77.2868259 L390.787189,98.1039096 L390.772612,98.1039096 L386.459786,98.1039096 L386.459786,45.4918081 L390.772612,45.4918081 L390.787189,45.4918081 L390.787189,51.3952956 C390.937509,51.2094451 396.353594,44.5771319 404.438093,44.5771319 Z M403.754819,80.9081782 C411.726349,80.9081782 417.078662,73.7292458 417.078662,64.5068686 C417.078662,55.2844914 411.270833,48.2239931 404.324214,48.2239931 C396.683388,48.2239931 390.93842,55.9714095 390.787189,56.1763917 L390.787189,72.6177867 C390.937509,72.8646764 395.905367,80.9081782 403.754819,80.9081782 Z M183.251359,34.5238935 L176.929708,40.482954 L174.005295,41.2664415 L175.823715,38.2864558 C175.823715,38.2864558 170.21358,30.9162067 160.256,30.9162067 C150.300242,30.9162067 138.842192,37.6988401 138.842192,53.7311818 C138.842192,66.8637084 149.469381,81.2498152 165.867957,81.2498152 C171.536399,81.2498152 175.270719,79.1334878 175.270719,79.1334878 L175.270719,67.3738864 C175.270719,67.3738864 166.835473,67.2754949 163.654149,68.0790252 L169.581324,64.7856444 L186.412641,64.7856444 C186.412641,64.7856444 183.251359,66.3945269 183.251359,71.0580999 C183.251359,75.724406 183.251359,80.5464985 183.251359,80.5464985 C183.251359,80.5464985 171.04353,84.544107 160.177651,84.544107 C139.157409,84.544107 130.702121,69.09847 130.702121,56.866954 C130.702121,42.872591 141.884128,28.0947405 161.126036,28.0947405 C176.930619,28.0947405 183.251359,34.5238935 183.251359,34.5238935 Z M210.001993,44.7283632 C221.282391,44.7283632 229.638377,52.5823704 229.638377,64.1133027 C229.638377,75.6442351 221.030947,83.8307689 208.748413,83.8307689 C196.467701,83.8307689 189.532925,73.4705127 189.532925,64.8649042 C189.532925,52.9158081 198.723416,44.7283632 210.001993,44.7283632 Z M210.837409,81.3236088 C220.146335,81.3236088 221.44911,71.7987689 221.448199,67.9560358 C221.448199,56.7977156 215.849907,47.2346124 207.745367,47.2346124 C202.065082,47.2346124 197.134577,52.4147405 197.134577,59.683865 C197.134577,66.9539006 201.529395,81.3236088 210.837409,81.3236088 Z M253.891872,44.748406 C265.166804,44.748406 273.517324,52.5987689 273.517324,64.1242351 C273.517324,75.6497013 264.91627,83.83168 252.639203,83.83168 C240.363046,83.83168 233.431915,73.4759789 233.431915,64.8749255 C233.431915,52.9322067 242.617851,44.748406 253.891872,44.748406 Z M254.726377,81.3254309 C264.031658,81.3254309 265.333523,71.8051462 265.333523,67.9633241 C265.333523,56.8122921 259.738875,47.253744 251.637068,47.253744 C245.959516,47.253744 241.030833,52.431139 241.030833,59.6957084 C241.030833,66.9611889 245.423829,81.3254309 254.726377,81.3254309 Z M305.905423,81.0594095 C309.933096,83.8407903 312.710833,87.8037796 312.712655,93.0103295 C312.712655,103.926315 299.143744,108.199055 291.216854,108.199055 C283.290875,108.199055 273.622093,104.98129 273.622093,96.4139451 C273.622093,82.2428401 295.740128,82.2227974 295.740128,82.2227974 C295.740128,82.2227974 293.376,79.7748544 293.376,77.035381 C293.376,75.355438 293.956327,74.0881924 293.956327,74.0881924 C293.956327,74.0881924 293.292185,74.2959077 292.296427,74.2959077 C282.709637,74.2959077 277.854747,67.449502 277.854747,61.7236657 C277.854747,53.5899718 285.241395,46.0366052 295.034989,46.0366052 C304.826762,46.0366052 314.122021,46.0366052 314.122021,46.0366052 L309.226135,48.9418864 L304.330249,49.1067832 C304.330249,49.1067832 309.475758,52.5094878 309.475758,60.1457583 C309.475758,65.2921782 306.859274,68.1345981 303.996811,70.8531177 C301.134349,73.5707262 301.09153,74.5455305 301.09153,75.7480928 C301.09153,76.9515661 301.879573,78.2807618 305.905423,81.0594095 Z M295.40669,71.8060572 C301.19721,71.8060572 302.315046,67.2627405 302.315046,63.9010323 C302.315046,54.2532031 296.839744,48.9619291 292.231744,48.9619291 C287.625566,48.9619291 285.011815,52.6971604 285.011815,57.9264842 C285.011815,63.1548971 289.617993,71.8060572 295.40669,71.8060572 Z M294.972128,104.671539 C297.646918,104.671539 306.922135,103.926315 306.922135,95.8946569 C306.922135,90.2945412 302.44168,88.5198508 298.393964,84.941317 C298.393964,84.941317 297.088456,84.7226693 295.561566,84.7226693 C294.036498,84.7226693 280.904883,85.5644629 280.904883,94.589148 C280.904883,103.613831 292.295516,104.671539 294.972128,104.671539 Z M313.144484,28.2459718 L318.604299,25.2668971 L330.582548,25.2668971 C327.791146,26.7564344 326.745281,27.9362209 326.67331,34.8864842 C326.601338,41.8349255 326.237836,77.233075 326.237836,77.233075 C326.237836,79.8823561 328.541836,80.6002494 330.618078,80.6002494 C332.507559,80.6002494 333.37395,80.9673953 333.37395,80.9673953 L330.83126,82.7357084 L316.307587,82.7357084 C316.307587,82.7357084 318.39294,80.8717369 318.418448,79.0123205 L319.163673,28.2605483 L313.144484,28.2459718 Z M366.114619,54.8927476 L347.07405,62.526285 L340.615744,62.8624558 C340.615744,62.8624558 356.762875,56.2775163 357.392399,55.1451035 C358.019189,54.0136017 356.720968,47.5962921 349.591231,47.5962921 C346.037295,47.5962921 340.363388,50.8668971 340.363388,59.0042351 C340.363388,71.0808757 349.423601,79.3020287 357.222036,79.3020287 C362.423117,79.3020287 367.120399,76.5334024 367.120399,76.5334024 C367.120399,76.5334024 362.674562,83.8307689 352.860925,83.8307689 C338.853808,83.8307689 333.233651,73.1771604 333.233651,63.7006052 C333.233651,54.223139 339.609964,44.5771319 351.855146,44.5771319 C364.100327,44.5771319 366.114619,54.8927476 366.114619,54.8927476 Z" fill="#808285"/>
<g>
<path d="M81.2440142,77.0025839 C95.1709609,69.3799789 105.80726,63.5575732 106.774776,63.0273526 C109.660925,61.447623 112.684641,57.4163063 106.774776,54.193986 C104.875274,53.1563205 94.5250391,47.5124771 81.2276157,40.2579291 L62.9386477,58.687196 L81.2440142,77.0025839 Z" fill="url(#linearGradient-1)"/>
<path d="M62.9377367,58.687196 L4.44219217,117.629148 C5.76318861,117.796778 7.35202847,117.446942 9.17955872,116.446628 C12.9630747,114.375853 53.5951032,92.1348277 81.2440142,77.0007618 L62.9377367,58.687196 Z" fill="url(#linearGradient-2)"/>
<path d="M62.9377367,58.687196 L81.2267046,40.2579291 C81.2267046,40.2579291 13.2491388,3.1707266 9.17955872,0.950541548 C7.61531673,0.0969045651 5.90986477,-0.201002908 4.4002847,0.13516791 L62.9377367,58.687196 Z" fill="url(#linearGradient-3)"/>
<path d="M62.9377367,58.687196 L4.39937367,0.136078942 C1.98149466,0.675409903 0,2.76805045 0,6.97428532 C0,13.8070252 0,104.867411 0,110.60418 C0,114.565347 1.5587758,117.351283 4.44128114,117.629148 L62.9377367,58.687196 Z" fill="url(#linearGradient-4)"/>
</g>
</g>
</g>
</svg>
<div class="text-line">Some text under the SVG image</div>
</div>
Related
How to scale SVG to exactly same height as adjacent SVG's
Here's a snipped I've made. It's a list of different web service's logos for e.g. a website. As you can see, the Twitter logo is not perfectly aligned compared to other logos: body { background-color: white; } .list { list-style-type: none; display: flex; justify-content: space-between; padding-right: 20%; padding-left: 20%; } .list-item { fill: palevioletred; transition: all 0.1s; transform-origin: center; width: 8vw; height: 8vw; } .list-item:hover { fill: hotpink; transform: scale(1.08); } <!DOCTYPE html> <html> <head> <link rel="stylesheet" href="styles.css" /> </head> <body> <div> <ul class="list"> <li class="list-item"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2133.0101 2133.5199" > <path d="M8760.78,1116.74H6863.07a117.579,117.579,0,0,0-117.63,117.69V3132.57a117.586,117.586,0,0,0,117.63,117.69H7884.8V2423.09H7605.7V2102.18h279.16v-237.6c0-275.59,168.15-424.87,413.94-424.87,117.73,0,218.92,7.99,248.42,11.91v288.13l-170.48-.05c-133.67,0-158.64,63.53-158.64,156.76v205.72h317.89l-41.51,320.91H8218.1v827.17h542.68a117.639,117.639,0,0,0,117.67-117.69V1234.43A117.632,117.632,0,0,0,8760.78,1116.74Z" transform="translate(-6745.44 -1116.75)" ></path> </svg> </li> <li class="list-item"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 61 49.998463"> <path d="M94.184,149c23.02,0,35.608-19.234,35.608-35.913q0-.82-0.035-1.632A25.6,25.6,0,0,0,136,104.919a24.8,24.8,0,0,1-7.187,1.987,12.647,12.647,0,0,0,5.5-6.982,24.945,24.945,0,0,1-7.947,3.064,12.5,12.5,0,0,0-21.652,8.633,12.683,12.683,0,0,0,.325,2.878,35.431,35.431,0,0,1-25.8-13.187,12.7,12.7,0,0,0,3.874,16.85,12.326,12.326,0,0,1-5.668-1.579c0,0.053,0,.106,0,0.161A12.6,12.6,0,0,0,87.49,129.119a12.469,12.469,0,0,1-3.3.444,12.315,12.315,0,0,1-2.353-.228A12.543,12.543,0,0,0,93.529,138.1a24.976,24.976,0,0,1-15.544,5.4A25.378,25.378,0,0,1,75,143.331,35.212,35.212,0,0,0,94.184,149" transform="translate(-75 -99)" ></path> </svg> </li> <li class="list-item"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 6999.9997 6999.9997" > <path d="M3412 -12c-871,0 -994,5 -1356,21 -372,17 -627,76 -849,163 -230,89 -425,209 -620,404 -195,195 -314,390 -404,620 -86,223 -146,477 -163,849 -17,373 -21,492 -21,1443 0,950 4,1069 21,1443 17,372 76,627 163,849 89,230 209,425 404,620 195,195 390,314 620,404 223,86 477,146 849,163 373,17 492,21 1443,21 950,0 1069,-4 1443,-21 372,-17 627,-76 849,-163 230,-89 425,-209 620,-404 195,-195 314,-390 404,-620 86,-223 146,-477 163,-849 16,-362 21,-485 21,-1356l0 -173c0,-871 -5,-994 -21,-1356 -17,-372 -76,-627 -163,-849 -89,-230 -209,-425 -404,-620 -195,-195 -390,-314 -620,-404 -223,-86 -477,-146 -849,-163 -362,-16 -485,-21 -1356,-21l-173 0zm87 630c934,0 1045,4 1414,20 341,16 526,73 650,120 163,63 280,139 402,262 122,122 198,239 262,402 48,123 105,309 120,650 17,369 20,480 20,1414 0,934 -4,1045 -20,1414 -16,341 -73,526 -120,650 -63,163 -139,280 -262,402 -122,122 -239,198 -402,262 -123,48 -309,105 -650,120 -369,17 -480,20 -1414,20 -934,0 -1045,-4 -1414,-20 -341,-16 -526,-73 -650,-120 -163,-63 -280,-139 -402,-262 -122,-122 -198,-239 -262,-402 -48,-123 -105,-309 -120,-650 -17,-369 -20,-480 -20,-1414 0,-934 4,-1045 20,-1414 16,-341 73,-526 120,-650 63,-163 139,-280 262,-402 122,-122 239,-198 402,-262 123,-48 309,-105 650,-120 369,-17 480,-20 1414,-20z" ></path> <path d="M3499 4654c-644,0 -1166,-522 -1166,-1166 0,-644 522,-1166 1166,-1166 644,0 1166,522 1166,1166 0,644 -522,1166 -1166,1166zm0 -2963c-992,0 -1797,804 -1797,1797 0,992 804,1797 1797,1797 992,0 1797,-804 1797,-1797 0,-992 -804,-1797 -1797,-1797z" ></path> <path d="M5786 1620c0,232 -188,420 -420,420 -232,0 -420,-188 -420,-420 0,-232 188,-420 420,-420 232,0 420,188 420,420z" ></path> </svg> </li> <li class="list-item"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440.02 1440"> <path d="M 1227.06,1227.07 H 1013.62 V 892.883 c 0,-79.731 -1.46,-182.235 -110.983,-182.235 -111.145,0 -128.164,86.825 -128.164,176.461 V 1227.07 H 561.047 V 539.863 H 765.93 v 93.891 h 2.84 c 28.496,-54.027 98.171,-110.996 202.082,-110.996 216.278,0 256.208,142.336 256.208,327.359 z M 320.344,445.918 c -68.457,0 -123.867,-55.508 -123.867,-123.868 0,-68.3 55.41,-123.8 123.867,-123.8 68.277,0 123.765,55.5 123.765,123.8 0,68.36 -55.488,123.868 -123.765,123.868 z M 427.09,1227.07 H 213.496 V 539.863 H 427.09 Z M 1333.43,0 H 106.289 C 47.6484,0 0,46.48 0,103.79 v 1232.3 C 0,1393.4492 47.6484,1440 106.289,1440 H 1333.43 c 58.74,0 106.59,-46.5508 106.59,-103.91 V 103.79 C 1440.02,46.48 1392.17,0 1333.43,0" ></path> </svg> </li> <li class="list-item"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 42.60677 41.555031" > <path d="M 21.30354,0 C 9.539461,0 0,9.5376996 0,21.303544 c 0,9.412464 6.10411,17.397938 14.56866,20.214878 1.06469,0.1972 1.45556,-0.46214 1.45556,-1.02483 0,-0.508 -0.0198,-2.186159 -0.0289,-3.966275 -5.92666,1.288695 -7.17726,-2.513542 -7.17726,-2.513542 -0.96908,-2.46239 -2.36537,-3.117146 -2.36537,-3.117146 -1.93287,-1.32221 0.14569,-1.295046 0.14569,-1.295046 2.13925,0.149929 3.2656707,2.195687 3.2656707,2.195687 1.9000593,3.256492 4.9836893,2.31493 6.1993593,1.770592 0.19121,-1.376892 0.7433,-2.317043 1.35255,-2.848679 -4.73181,-0.538691 -9.70597,-2.365375 -9.70597,-10.5283 0,-2.325864 0.8322,-4.226278 2.1949807,-5.718175 C 9.683781,13.93578 8.95459,11.769372 10.11134,8.8349671 c 0,0 1.78894,-0.572559 5.86,2.1836939 1.69933,-0.472017 3.52178,-0.708731 5.33223,-0.716845 1.81046,0.0081 3.63432,0.244828 5.33682,0.716845 4.06612,-2.7562529 5.85259,-2.1836939 5.85259,-2.1836939 1.15958,2.9344049 0.43003,5.1008129 0.20884,5.6377409 1.36596,1.491897 2.19252,3.392311 2.19252,5.718175 0,8.182327 -4.9837,9.983962 -9.7275,10.511367 0.76412,0.661104 1.44498,1.957562 1.44498,3.945112 0,2.850446 -0.0247,5.14456 -0.0247,5.84623 0,0.56692 0.38347,1.2312 1.46332,1.022 8.45997,-2.8201 14.55633,-10.802759 14.55633,-20.212048 C 42.60676,9.5376996 33.0687,0 21.30356,0" ></path> <path d="m 8.06873,30.587244 c -0.0469,0.106185 -0.21343,0.137583 -0.36512,0.06491 -0.15452,-0.0695 -0.2413,-0.213784 -0.19121,-0.319969 0.0459,-0.108656 0.21273,-0.138993 0.36689,-0.06668 0.15487,0.06985 0.24307,0.215548 0.18944,0.321734 v 0" ></path> <path d="M 8.93163,31.54962 C 8.83003,31.64381 8.63141,31.60007 8.49665,31.45119 8.35731,31.302672 8.3312,31.104057 8.43425,31.008455 c 0.10478,-0.09384 0.29739,-0.04974 0.43709,0.09842 0.13935,0.150284 0.16651,0.347485 0.0603,0.442735 v 0" ></path> <path d="m 9.7715907,32.776583 c -0.1305297,0.09066 -0.3439597,0.0056 -0.4759007,-0.183798 -0.13052,-0.189441 -0.13052,-0.416631 0.003,-0.507648 0.132301,-0.09102 0.342551,-0.0088 0.4762507,0.178858 0.13018,0.192617 0.13018,0.419807 -0.003,0.512588 v 0" ></path> <path d="m 10.92235,33.961917 c -0.11677,0.128762 -0.36547,0.09419 -0.54751,-0.08149 -0.18626,-0.171805 -0.23812,-0.415573 -0.121,-0.544338 0.11818,-0.129117 0.3683,-0.09278 0.55174,0.08149 0.18486,0.17145 0.2413,0.416983 0.11677,0.544338 v 0" ></path> <path d="m 12.50985,34.650185 c -0.0515,0.166865 -0.29104,0.24271 -0.53234,0.171802 -0.24095,-0.07303 -0.39864,-0.268462 -0.34995,-0.437092 0.0501,-0.16792 0.29068,-0.246943 0.53375,-0.171095 0.24059,0.07267 0.39864,0.2667 0.34854,0.436385 v 0" ></path> <path d="m 14.25328,34.777892 c 0.006,0.175683 -0.19861,0.321378 -0.45191,0.324553 -0.2547,0.0056 -0.46073,-0.136525 -0.46355,-0.309385 0,-0.177448 0.20003,-0.321733 0.45473,-0.325966 0.2533,-0.0049 0.46073,0.136173 0.46073,0.310798 v 0" ></path> <path d="m 15.87571,34.501667 c 0.0303,0.17145 -0.1457,0.347485 -0.39723,0.394403 -0.2473,0.04516 -0.47625,-0.06068 -0.50765,-0.230716 -0.0307,-0.175684 0.14852,-0.351719 0.39546,-0.397227 0.25189,-0.04374 0.47731,0.05927 0.50942,0.23354 v 0" ></path> </svg> </li> </ul> </div> </body> </html> When we add borders around the element, we can see that the issue is that the Twitter logo does not fit into a perfect square. It requires rectangular area to fit into and when it's squeezed inside a square it's scaled down to fit it. This causes it look like it's higher than the adjacent logos. body { background-color: white; } .list { list-style-type: none; display: flex; justify-content: space-between; padding-right: 20%; padding-left: 20%; } .list-item { border: 2px dashed; fill: palevioletred; transition: all 0.1s; transform-origin: center; width: 8vw; height: 8vw; } .list-item:hover { fill: hotpink; transform: scale(1.08); } <!DOCTYPE html> <html> <head> <link rel="stylesheet" href="styles.css" /> </head> <body> <div> <ul class="list"> <li class="list-item"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2133.0101 2133.5199" > <path d="M8760.78,1116.74H6863.07a117.579,117.579,0,0,0-117.63,117.69V3132.57a117.586,117.586,0,0,0,117.63,117.69H7884.8V2423.09H7605.7V2102.18h279.16v-237.6c0-275.59,168.15-424.87,413.94-424.87,117.73,0,218.92,7.99,248.42,11.91v288.13l-170.48-.05c-133.67,0-158.64,63.53-158.64,156.76v205.72h317.89l-41.51,320.91H8218.1v827.17h542.68a117.639,117.639,0,0,0,117.67-117.69V1234.43A117.632,117.632,0,0,0,8760.78,1116.74Z" transform="translate(-6745.44 -1116.75)" ></path> </svg> </li> <li class="list-item"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 61 49.998463"> <path d="M94.184,149c23.02,0,35.608-19.234,35.608-35.913q0-.82-0.035-1.632A25.6,25.6,0,0,0,136,104.919a24.8,24.8,0,0,1-7.187,1.987,12.647,12.647,0,0,0,5.5-6.982,24.945,24.945,0,0,1-7.947,3.064,12.5,12.5,0,0,0-21.652,8.633,12.683,12.683,0,0,0,.325,2.878,35.431,35.431,0,0,1-25.8-13.187,12.7,12.7,0,0,0,3.874,16.85,12.326,12.326,0,0,1-5.668-1.579c0,0.053,0,.106,0,0.161A12.6,12.6,0,0,0,87.49,129.119a12.469,12.469,0,0,1-3.3.444,12.315,12.315,0,0,1-2.353-.228A12.543,12.543,0,0,0,93.529,138.1a24.976,24.976,0,0,1-15.544,5.4A25.378,25.378,0,0,1,75,143.331,35.212,35.212,0,0,0,94.184,149" transform="translate(-75 -99)" ></path> </svg> </li> <li class="list-item"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 6999.9997 6999.9997" > <path d="M3412 -12c-871,0 -994,5 -1356,21 -372,17 -627,76 -849,163 -230,89 -425,209 -620,404 -195,195 -314,390 -404,620 -86,223 -146,477 -163,849 -17,373 -21,492 -21,1443 0,950 4,1069 21,1443 17,372 76,627 163,849 89,230 209,425 404,620 195,195 390,314 620,404 223,86 477,146 849,163 373,17 492,21 1443,21 950,0 1069,-4 1443,-21 372,-17 627,-76 849,-163 230,-89 425,-209 620,-404 195,-195 314,-390 404,-620 86,-223 146,-477 163,-849 16,-362 21,-485 21,-1356l0 -173c0,-871 -5,-994 -21,-1356 -17,-372 -76,-627 -163,-849 -89,-230 -209,-425 -404,-620 -195,-195 -390,-314 -620,-404 -223,-86 -477,-146 -849,-163 -362,-16 -485,-21 -1356,-21l-173 0zm87 630c934,0 1045,4 1414,20 341,16 526,73 650,120 163,63 280,139 402,262 122,122 198,239 262,402 48,123 105,309 120,650 17,369 20,480 20,1414 0,934 -4,1045 -20,1414 -16,341 -73,526 -120,650 -63,163 -139,280 -262,402 -122,122 -239,198 -402,262 -123,48 -309,105 -650,120 -369,17 -480,20 -1414,20 -934,0 -1045,-4 -1414,-20 -341,-16 -526,-73 -650,-120 -163,-63 -280,-139 -402,-262 -122,-122 -198,-239 -262,-402 -48,-123 -105,-309 -120,-650 -17,-369 -20,-480 -20,-1414 0,-934 4,-1045 20,-1414 16,-341 73,-526 120,-650 63,-163 139,-280 262,-402 122,-122 239,-198 402,-262 123,-48 309,-105 650,-120 369,-17 480,-20 1414,-20z" ></path> <path d="M3499 4654c-644,0 -1166,-522 -1166,-1166 0,-644 522,-1166 1166,-1166 644,0 1166,522 1166,1166 0,644 -522,1166 -1166,1166zm0 -2963c-992,0 -1797,804 -1797,1797 0,992 804,1797 1797,1797 992,0 1797,-804 1797,-1797 0,-992 -804,-1797 -1797,-1797z" ></path> <path d="M5786 1620c0,232 -188,420 -420,420 -232,0 -420,-188 -420,-420 0,-232 188,-420 420,-420 232,0 420,188 420,420z" ></path> </svg> </li> <li class="list-item"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440.02 1440"> <path d="M 1227.06,1227.07 H 1013.62 V 892.883 c 0,-79.731 -1.46,-182.235 -110.983,-182.235 -111.145,0 -128.164,86.825 -128.164,176.461 V 1227.07 H 561.047 V 539.863 H 765.93 v 93.891 h 2.84 c 28.496,-54.027 98.171,-110.996 202.082,-110.996 216.278,0 256.208,142.336 256.208,327.359 z M 320.344,445.918 c -68.457,0 -123.867,-55.508 -123.867,-123.868 0,-68.3 55.41,-123.8 123.867,-123.8 68.277,0 123.765,55.5 123.765,123.8 0,68.36 -55.488,123.868 -123.765,123.868 z M 427.09,1227.07 H 213.496 V 539.863 H 427.09 Z M 1333.43,0 H 106.289 C 47.6484,0 0,46.48 0,103.79 v 1232.3 C 0,1393.4492 47.6484,1440 106.289,1440 H 1333.43 c 58.74,0 106.59,-46.5508 106.59,-103.91 V 103.79 C 1440.02,46.48 1392.17,0 1333.43,0" ></path> </svg> </li> <li class="list-item"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 42.60677 41.555031" > <path d="M 21.30354,0 C 9.539461,0 0,9.5376996 0,21.303544 c 0,9.412464 6.10411,17.397938 14.56866,20.214878 1.06469,0.1972 1.45556,-0.46214 1.45556,-1.02483 0,-0.508 -0.0198,-2.186159 -0.0289,-3.966275 -5.92666,1.288695 -7.17726,-2.513542 -7.17726,-2.513542 -0.96908,-2.46239 -2.36537,-3.117146 -2.36537,-3.117146 -1.93287,-1.32221 0.14569,-1.295046 0.14569,-1.295046 2.13925,0.149929 3.2656707,2.195687 3.2656707,2.195687 1.9000593,3.256492 4.9836893,2.31493 6.1993593,1.770592 0.19121,-1.376892 0.7433,-2.317043 1.35255,-2.848679 -4.73181,-0.538691 -9.70597,-2.365375 -9.70597,-10.5283 0,-2.325864 0.8322,-4.226278 2.1949807,-5.718175 C 9.683781,13.93578 8.95459,11.769372 10.11134,8.8349671 c 0,0 1.78894,-0.572559 5.86,2.1836939 1.69933,-0.472017 3.52178,-0.708731 5.33223,-0.716845 1.81046,0.0081 3.63432,0.244828 5.33682,0.716845 4.06612,-2.7562529 5.85259,-2.1836939 5.85259,-2.1836939 1.15958,2.9344049 0.43003,5.1008129 0.20884,5.6377409 1.36596,1.491897 2.19252,3.392311 2.19252,5.718175 0,8.182327 -4.9837,9.983962 -9.7275,10.511367 0.76412,0.661104 1.44498,1.957562 1.44498,3.945112 0,2.850446 -0.0247,5.14456 -0.0247,5.84623 0,0.56692 0.38347,1.2312 1.46332,1.022 8.45997,-2.8201 14.55633,-10.802759 14.55633,-20.212048 C 42.60676,9.5376996 33.0687,0 21.30356,0" ></path> <path d="m 8.06873,30.587244 c -0.0469,0.106185 -0.21343,0.137583 -0.36512,0.06491 -0.15452,-0.0695 -0.2413,-0.213784 -0.19121,-0.319969 0.0459,-0.108656 0.21273,-0.138993 0.36689,-0.06668 0.15487,0.06985 0.24307,0.215548 0.18944,0.321734 v 0" ></path> <path d="M 8.93163,31.54962 C 8.83003,31.64381 8.63141,31.60007 8.49665,31.45119 8.35731,31.302672 8.3312,31.104057 8.43425,31.008455 c 0.10478,-0.09384 0.29739,-0.04974 0.43709,0.09842 0.13935,0.150284 0.16651,0.347485 0.0603,0.442735 v 0" ></path> <path d="m 9.7715907,32.776583 c -0.1305297,0.09066 -0.3439597,0.0056 -0.4759007,-0.183798 -0.13052,-0.189441 -0.13052,-0.416631 0.003,-0.507648 0.132301,-0.09102 0.342551,-0.0088 0.4762507,0.178858 0.13018,0.192617 0.13018,0.419807 -0.003,0.512588 v 0" ></path> <path d="m 10.92235,33.961917 c -0.11677,0.128762 -0.36547,0.09419 -0.54751,-0.08149 -0.18626,-0.171805 -0.23812,-0.415573 -0.121,-0.544338 0.11818,-0.129117 0.3683,-0.09278 0.55174,0.08149 0.18486,0.17145 0.2413,0.416983 0.11677,0.544338 v 0" ></path> <path d="m 12.50985,34.650185 c -0.0515,0.166865 -0.29104,0.24271 -0.53234,0.171802 -0.24095,-0.07303 -0.39864,-0.268462 -0.34995,-0.437092 0.0501,-0.16792 0.29068,-0.246943 0.53375,-0.171095 0.24059,0.07267 0.39864,0.2667 0.34854,0.436385 v 0" ></path> <path d="m 14.25328,34.777892 c 0.006,0.175683 -0.19861,0.321378 -0.45191,0.324553 -0.2547,0.0056 -0.46073,-0.136525 -0.46355,-0.309385 0,-0.177448 0.20003,-0.321733 0.45473,-0.325966 0.2533,-0.0049 0.46073,0.136173 0.46073,0.310798 v 0" ></path> <path d="m 15.87571,34.501667 c 0.0303,0.17145 -0.1457,0.347485 -0.39723,0.394403 -0.2473,0.04516 -0.47625,-0.06068 -0.50765,-0.230716 -0.0307,-0.175684 0.14852,-0.351719 0.39546,-0.397227 0.25189,-0.04374 0.47731,0.05927 0.50942,0.23354 v 0" ></path> </svg> </li> </ul> </div> </body> </html> Is there a way of scaling SVG's to exactly same height and take whatever space needed horizontally?
Note that the parent container .list-item has an aspect ratio 1:1 width:8vw; height:8vh; And three icons besides the twitter icon also have an aspect ratio of 1:1 (width and height viewBox are equal) Therefore, these three icons evenly fill the parent container. But the twitter icon has width greater than height - viewBox="0 0 61 49.998463" Therefore, a free field is obtained according to the height of the container. In the example below, the red border shows the bounds of the canvas svg. What will go beyond the bounds of the SVG canvas will be clipped. Therefore, it is useless to position icons by height with transform="translate()" body { background-color: white; } .list { list-style-type: none; display: flex; justify-content: space-between; padding-right: 20%; padding-left: 20%; } .list-item { border: 2px dashed; fill: palevioletred; transition: all 0.1s; transform-origin: center; width: 8vw; height: 8vw; } .list-item:hover { fill: hotpink; transform: scale(1.08); } <!DOCTYPE html> <html> <head> <link rel="stylesheet" href="styles.css" /> </head> <body> <div> <ul class="list"> <li class="list-item"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2133.0101 2133.5199" > <path d="M8760.78,1116.74H6863.07a117.579,117.579,0,0,0-117.63,117.69V3132.57a117.586,117.586,0,0,0,117.63,117.69H7884.8V2423.09H7605.7V2102.18h279.16v-237.6c0-275.59,168.15-424.87,413.94-424.87,117.73,0,218.92,7.99,248.42,11.91v288.13l-170.48-.05c-133.67,0-158.64,63.53-158.64,156.76v205.72h317.89l-41.51,320.91H8218.1v827.17h542.68a117.639,117.639,0,0,0,117.67-117.69V1234.43A117.632,117.632,0,0,0,8760.78,1116.74Z" transform="translate(-6745.44 -1116.75)" ></path> </svg> </li> <li class="list-item"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 61 49.998463" style="border:1px solid red"> <path id="path" d="M94.184,149c23.02,0,35.608-19.234,35.608-35.913q0-.82-0.035-1.632A25.6,25.6,0,0,0,136,104.919a24.8,24.8,0,0,1-7.187,1.987,12.647,12.647,0,0,0,5.5-6.982,24.945,24.945,0,0,1-7.947,3.064,12.5,12.5,0,0,0-21.652,8.633,12.683,12.683,0,0,0,.325,2.878,35.431,35.431,0,0,1-25.8-13.187,12.7,12.7,0,0,0,3.874,16.85,12.326,12.326,0,0,1-5.668-1.579c0,0.053,0,.106,0,0.161A12.6,12.6,0,0,0,87.49,129.119a12.469,12.469,0,0,1-3.3.444,12.315,12.315,0,0,1-2.353-.228A12.543,12.543,0,0,0,93.529,138.1a24.976,24.976,0,0,1-15.544,5.4A25.378,25.378,0,0,1,75,143.331,35.212,35.212,0,0,0,94.184,149" transform="translate(-75 -99)" ></path> </svg> </li> <li class="list-item"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 6999.9997 6999.9997" > <path d="M3412 -12c-871,0 -994,5 -1356,21 -372,17 -627,76 -849,163 -230,89 -425,209 -620,404 -195,195 -314,390 -404,620 -86,223 -146,477 -163,849 -17,373 -21,492 -21,1443 0,950 4,1069 21,1443 17,372 76,627 163,849 89,230 209,425 404,620 195,195 390,314 620,404 223,86 477,146 849,163 373,17 492,21 1443,21 950,0 1069,-4 1443,-21 372,-17 627,-76 849,-163 230,-89 425,-209 620,-404 195,-195 314,-390 404,-620 86,-223 146,-477 163,-849 16,-362 21,-485 21,-1356l0 -173c0,-871 -5,-994 -21,-1356 -17,-372 -76,-627 -163,-849 -89,-230 -209,-425 -404,-620 -195,-195 -390,-314 -620,-404 -223,-86 -477,-146 -849,-163 -362,-16 -485,-21 -1356,-21l-173 0zm87 630c934,0 1045,4 1414,20 341,16 526,73 650,120 163,63 280,139 402,262 122,122 198,239 262,402 48,123 105,309 120,650 17,369 20,480 20,1414 0,934 -4,1045 -20,1414 -16,341 -73,526 -120,650 -63,163 -139,280 -262,402 -122,122 -239,198 -402,262 -123,48 -309,105 -650,120 -369,17 -480,20 -1414,20 -934,0 -1045,-4 -1414,-20 -341,-16 -526,-73 -650,-120 -163,-63 -280,-139 -402,-262 -122,-122 -198,-239 -262,-402 -48,-123 -105,-309 -120,-650 -17,-369 -20,-480 -20,-1414 0,-934 4,-1045 20,-1414 16,-341 73,-526 120,-650 63,-163 139,-280 262,-402 122,-122 239,-198 402,-262 123,-48 309,-105 650,-120 369,-17 480,-20 1414,-20z" ></path> <path d="M3499 4654c-644,0 -1166,-522 -1166,-1166 0,-644 522,-1166 1166,-1166 644,0 1166,522 1166,1166 0,644 -522,1166 -1166,1166zm0 -2963c-992,0 -1797,804 -1797,1797 0,992 804,1797 1797,1797 992,0 1797,-804 1797,-1797 0,-992 -804,-1797 -1797,-1797z" ></path> <path d="M5786 1620c0,232 -188,420 -420,420 -232,0 -420,-188 -420,-420 0,-232 188,-420 420,-420 232,0 420,188 420,420z" ></path> </svg> </li> <li class="list-item"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440.02 1440"> <path d="M 1227.06,1227.07 H 1013.62 V 892.883 c 0,-79.731 -1.46,-182.235 -110.983,-182.235 -111.145,0 -128.164,86.825 -128.164,176.461 V 1227.07 H 561.047 V 539.863 H 765.93 v 93.891 h 2.84 c 28.496,-54.027 98.171,-110.996 202.082,-110.996 216.278,0 256.208,142.336 256.208,327.359 z M 320.344,445.918 c -68.457,0 -123.867,-55.508 -123.867,-123.868 0,-68.3 55.41,-123.8 123.867,-123.8 68.277,0 123.765,55.5 123.765,123.8 0,68.36 -55.488,123.868 -123.765,123.868 z M 427.09,1227.07 H 213.496 V 539.863 H 427.09 Z M 1333.43,0 H 106.289 C 47.6484,0 0,46.48 0,103.79 v 1232.3 C 0,1393.4492 47.6484,1440 106.289,1440 H 1333.43 c 58.74,0 106.59,-46.5508 106.59,-103.91 V 103.79 C 1440.02,46.48 1392.17,0 1333.43,0" ></path> </svg> </li> <li class="list-item"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 42.60677 41.555031" > <path d="M 21.30354,0 C 9.539461,0 0,9.5376996 0,21.303544 c 0,9.412464 6.10411,17.397938 14.56866,20.214878 1.06469,0.1972 1.45556,-0.46214 1.45556,-1.02483 0,-0.508 -0.0198,-2.186159 -0.0289,-3.966275 -5.92666,1.288695 -7.17726,-2.513542 -7.17726,-2.513542 -0.96908,-2.46239 -2.36537,-3.117146 -2.36537,-3.117146 -1.93287,-1.32221 0.14569,-1.295046 0.14569,-1.295046 2.13925,0.149929 3.2656707,2.195687 3.2656707,2.195687 1.9000593,3.256492 4.9836893,2.31493 6.1993593,1.770592 0.19121,-1.376892 0.7433,-2.317043 1.35255,-2.848679 -4.73181,-0.538691 -9.70597,-2.365375 -9.70597,-10.5283 0,-2.325864 0.8322,-4.226278 2.1949807,-5.718175 C 9.683781,13.93578 8.95459,11.769372 10.11134,8.8349671 c 0,0 1.78894,-0.572559 5.86,2.1836939 1.69933,-0.472017 3.52178,-0.708731 5.33223,-0.716845 1.81046,0.0081 3.63432,0.244828 5.33682,0.716845 4.06612,-2.7562529 5.85259,-2.1836939 5.85259,-2.1836939 1.15958,2.9344049 0.43003,5.1008129 0.20884,5.6377409 1.36596,1.491897 2.19252,3.392311 2.19252,5.718175 0,8.182327 -4.9837,9.983962 -9.7275,10.511367 0.76412,0.661104 1.44498,1.957562 1.44498,3.945112 0,2.850446 -0.0247,5.14456 -0.0247,5.84623 0,0.56692 0.38347,1.2312 1.46332,1.022 8.45997,-2.8201 14.55633,-10.802759 14.55633,-20.212048 C 42.60676,9.5376996 33.0687,0 21.30356,0" ></path> <path d="m 8.06873,30.587244 c -0.0469,0.106185 -0.21343,0.137583 -0.36512,0.06491 -0.15452,-0.0695 -0.2413,-0.213784 -0.19121,-0.319969 0.0459,-0.108656 0.21273,-0.138993 0.36689,-0.06668 0.15487,0.06985 0.24307,0.215548 0.18944,0.321734 v 0" ></path> <path d="M 8.93163,31.54962 C 8.83003,31.64381 8.63141,31.60007 8.49665,31.45119 8.35731,31.302672 8.3312,31.104057 8.43425,31.008455 c 0.10478,-0.09384 0.29739,-0.04974 0.43709,0.09842 0.13935,0.150284 0.16651,0.347485 0.0603,0.442735 v 0" ></path> <path d="m 9.7715907,32.776583 c -0.1305297,0.09066 -0.3439597,0.0056 -0.4759007,-0.183798 -0.13052,-0.189441 -0.13052,-0.416631 0.003,-0.507648 0.132301,-0.09102 0.342551,-0.0088 0.4762507,0.178858 0.13018,0.192617 0.13018,0.419807 -0.003,0.512588 v 0" ></path> <path d="m 10.92235,33.961917 c -0.11677,0.128762 -0.36547,0.09419 -0.54751,-0.08149 -0.18626,-0.171805 -0.23812,-0.415573 -0.121,-0.544338 0.11818,-0.129117 0.3683,-0.09278 0.55174,0.08149 0.18486,0.17145 0.2413,0.416983 0.11677,0.544338 v 0" ></path> <path d="m 12.50985,34.650185 c -0.0515,0.166865 -0.29104,0.24271 -0.53234,0.171802 -0.24095,-0.07303 -0.39864,-0.268462 -0.34995,-0.437092 0.0501,-0.16792 0.29068,-0.246943 0.53375,-0.171095 0.24059,0.07267 0.39864,0.2667 0.34854,0.436385 v 0" ></path> <path d="m 14.25328,34.777892 c 0.006,0.175683 -0.19861,0.321378 -0.45191,0.324553 -0.2547,0.0056 -0.46073,-0.136525 -0.46355,-0.309385 0,-0.177448 0.20003,-0.321733 0.45473,-0.325966 0.2533,-0.0049 0.46073,0.136173 0.46073,0.310798 v 0" ></path> <path d="m 15.87571,34.501667 c 0.0303,0.17145 -0.1457,0.347485 -0.39723,0.394403 -0.2473,0.04516 -0.47625,-0.06068 -0.50765,-0.230716 -0.0307,-0.175684 0.14852,-0.351719 0.39546,-0.397227 0.25189,-0.04374 0.47731,0.05927 0.50942,0.23354 v 0" ></path> </svg> </li> </ul> </div> </body> </html> Solution: It is necessary to make aspect ratio 1:1 for the twitter icon by choosing the same width and height parameters equal to 61 viewBox="87 108 61 61" To completely fill the entire parent container, add scaling - transform="scale(1.11)" body { background-color: white; } .list { list-style-type: none; display: flex; justify-content: space-between; padding-right: 20%; padding-left: 20%; } .list-item { border: 2px dashed; fill: palevioletred; transition: all 0.1s; transform-origin: center; width: 8vw; height: 8vw; } .list-item:hover { fill: hotpink; transform: scale(1.08); } <!DOCTYPE html> <html> <head> <link rel="stylesheet" href="styles.css" /> </head> <body> <div> <ul class="list"> <li class="list-item"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2133.0101 2133.5199" > <path d="M8760.78,1116.74H6863.07a117.579,117.579,0,0,0-117.63,117.69V3132.57a117.586,117.586,0,0,0,117.63,117.69H7884.8V2423.09H7605.7V2102.18h279.16v-237.6c0-275.59,168.15-424.87,413.94-424.87,117.73,0,218.92,7.99,248.42,11.91v288.13l-170.48-.05c-133.67,0-158.64,63.53-158.64,156.76v205.72h317.89l-41.51,320.91H8218.1v827.17h542.68a117.639,117.639,0,0,0,117.67-117.69V1234.43A117.632,117.632,0,0,0,8760.78,1116.74Z" transform="translate(-6745.44 -1116.75)" ></path> </svg> </li> <li class="list-item"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="87 108 61 61" style="border:0px solid red"> <path id="path" d="M94.184,149c23.02,0,35.608-19.234,35.608-35.913q0-.82-0.035-1.632A25.6,25.6,0,0,0,136,104.919a24.8,24.8,0,0,1-7.187,1.987,12.647,12.647,0,0,0,5.5-6.982,24.945,24.945,0,0,1-7.947,3.064,12.5,12.5,0,0,0-21.652,8.633,12.683,12.683,0,0,0,.325,2.878,35.431,35.431,0,0,1-25.8-13.187,12.7,12.7,0,0,0,3.874,16.85,12.326,12.326,0,0,1-5.668-1.579c0,0.053,0,.106,0,0.161A12.6,12.6,0,0,0,87.49,129.119a12.469,12.469,0,0,1-3.3.444,12.315,12.315,0,0,1-2.353-.228A12.543,12.543,0,0,0,93.529,138.1a24.976,24.976,0,0,1-15.544,5.4A25.378,25.378,0,0,1,75,143.331,35.212,35.212,0,0,0,94.184,149" transform="scale(1.11)" ></path> </svg> </li> <li class="list-item"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 6999.9997 6999.9997" > <path d="M3412 -12c-871,0 -994,5 -1356,21 -372,17 -627,76 -849,163 -230,89 -425,209 -620,404 -195,195 -314,390 -404,620 -86,223 -146,477 -163,849 -17,373 -21,492 -21,1443 0,950 4,1069 21,1443 17,372 76,627 163,849 89,230 209,425 404,620 195,195 390,314 620,404 223,86 477,146 849,163 373,17 492,21 1443,21 950,0 1069,-4 1443,-21 372,-17 627,-76 849,-163 230,-89 425,-209 620,-404 195,-195 314,-390 404,-620 86,-223 146,-477 163,-849 16,-362 21,-485 21,-1356l0 -173c0,-871 -5,-994 -21,-1356 -17,-372 -76,-627 -163,-849 -89,-230 -209,-425 -404,-620 -195,-195 -390,-314 -620,-404 -223,-86 -477,-146 -849,-163 -362,-16 -485,-21 -1356,-21l-173 0zm87 630c934,0 1045,4 1414,20 341,16 526,73 650,120 163,63 280,139 402,262 122,122 198,239 262,402 48,123 105,309 120,650 17,369 20,480 20,1414 0,934 -4,1045 -20,1414 -16,341 -73,526 -120,650 -63,163 -139,280 -262,402 -122,122 -239,198 -402,262 -123,48 -309,105 -650,120 -369,17 -480,20 -1414,20 -934,0 -1045,-4 -1414,-20 -341,-16 -526,-73 -650,-120 -163,-63 -280,-139 -402,-262 -122,-122 -198,-239 -262,-402 -48,-123 -105,-309 -120,-650 -17,-369 -20,-480 -20,-1414 0,-934 4,-1045 20,-1414 16,-341 73,-526 120,-650 63,-163 139,-280 262,-402 122,-122 239,-198 402,-262 123,-48 309,-105 650,-120 369,-17 480,-20 1414,-20z" ></path> <path d="M3499 4654c-644,0 -1166,-522 -1166,-1166 0,-644 522,-1166 1166,-1166 644,0 1166,522 1166,1166 0,644 -522,1166 -1166,1166zm0 -2963c-992,0 -1797,804 -1797,1797 0,992 804,1797 1797,1797 992,0 1797,-804 1797,-1797 0,-992 -804,-1797 -1797,-1797z" ></path> <path d="M5786 1620c0,232 -188,420 -420,420 -232,0 -420,-188 -420,-420 0,-232 188,-420 420,-420 232,0 420,188 420,420z" ></path> </svg> </li> <li class="list-item"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440.02 1440"> <path d="M 1227.06,1227.07 H 1013.62 V 892.883 c 0,-79.731 -1.46,-182.235 -110.983,-182.235 -111.145,0 -128.164,86.825 -128.164,176.461 V 1227.07 H 561.047 V 539.863 H 765.93 v 93.891 h 2.84 c 28.496,-54.027 98.171,-110.996 202.082,-110.996 216.278,0 256.208,142.336 256.208,327.359 z M 320.344,445.918 c -68.457,0 -123.867,-55.508 -123.867,-123.868 0,-68.3 55.41,-123.8 123.867,-123.8 68.277,0 123.765,55.5 123.765,123.8 0,68.36 -55.488,123.868 -123.765,123.868 z M 427.09,1227.07 H 213.496 V 539.863 H 427.09 Z M 1333.43,0 H 106.289 C 47.6484,0 0,46.48 0,103.79 v 1232.3 C 0,1393.4492 47.6484,1440 106.289,1440 H 1333.43 c 58.74,0 106.59,-46.5508 106.59,-103.91 V 103.79 C 1440.02,46.48 1392.17,0 1333.43,0" ></path> </svg> </li> <li class="list-item"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 42.60677 41.555031" > <path d="M 21.30354,0 C 9.539461,0 0,9.5376996 0,21.303544 c 0,9.412464 6.10411,17.397938 14.56866,20.214878 1.06469,0.1972 1.45556,-0.46214 1.45556,-1.02483 0,-0.508 -0.0198,-2.186159 -0.0289,-3.966275 -5.92666,1.288695 -7.17726,-2.513542 -7.17726,-2.513542 -0.96908,-2.46239 -2.36537,-3.117146 -2.36537,-3.117146 -1.93287,-1.32221 0.14569,-1.295046 0.14569,-1.295046 2.13925,0.149929 3.2656707,2.195687 3.2656707,2.195687 1.9000593,3.256492 4.9836893,2.31493 6.1993593,1.770592 0.19121,-1.376892 0.7433,-2.317043 1.35255,-2.848679 -4.73181,-0.538691 -9.70597,-2.365375 -9.70597,-10.5283 0,-2.325864 0.8322,-4.226278 2.1949807,-5.718175 C 9.683781,13.93578 8.95459,11.769372 10.11134,8.8349671 c 0,0 1.78894,-0.572559 5.86,2.1836939 1.69933,-0.472017 3.52178,-0.708731 5.33223,-0.716845 1.81046,0.0081 3.63432,0.244828 5.33682,0.716845 4.06612,-2.7562529 5.85259,-2.1836939 5.85259,-2.1836939 1.15958,2.9344049 0.43003,5.1008129 0.20884,5.6377409 1.36596,1.491897 2.19252,3.392311 2.19252,5.718175 0,8.182327 -4.9837,9.983962 -9.7275,10.511367 0.76412,0.661104 1.44498,1.957562 1.44498,3.945112 0,2.850446 -0.0247,5.14456 -0.0247,5.84623 0,0.56692 0.38347,1.2312 1.46332,1.022 8.45997,-2.8201 14.55633,-10.802759 14.55633,-20.212048 C 42.60676,9.5376996 33.0687,0 21.30356,0" ></path> <path d="m 8.06873,30.587244 c -0.0469,0.106185 -0.21343,0.137583 -0.36512,0.06491 -0.15452,-0.0695 -0.2413,-0.213784 -0.19121,-0.319969 0.0459,-0.108656 0.21273,-0.138993 0.36689,-0.06668 0.15487,0.06985 0.24307,0.215548 0.18944,0.321734 v 0" ></path> <path d="M 8.93163,31.54962 C 8.83003,31.64381 8.63141,31.60007 8.49665,31.45119 8.35731,31.302672 8.3312,31.104057 8.43425,31.008455 c 0.10478,-0.09384 0.29739,-0.04974 0.43709,0.09842 0.13935,0.150284 0.16651,0.347485 0.0603,0.442735 v 0" ></path> <path d="m 9.7715907,32.776583 c -0.1305297,0.09066 -0.3439597,0.0056 -0.4759007,-0.183798 -0.13052,-0.189441 -0.13052,-0.416631 0.003,-0.507648 0.132301,-0.09102 0.342551,-0.0088 0.4762507,0.178858 0.13018,0.192617 0.13018,0.419807 -0.003,0.512588 v 0" ></path> <path d="m 10.92235,33.961917 c -0.11677,0.128762 -0.36547,0.09419 -0.54751,-0.08149 -0.18626,-0.171805 -0.23812,-0.415573 -0.121,-0.544338 0.11818,-0.129117 0.3683,-0.09278 0.55174,0.08149 0.18486,0.17145 0.2413,0.416983 0.11677,0.544338 v 0" ></path> <path d="m 12.50985,34.650185 c -0.0515,0.166865 -0.29104,0.24271 -0.53234,0.171802 -0.24095,-0.07303 -0.39864,-0.268462 -0.34995,-0.437092 0.0501,-0.16792 0.29068,-0.246943 0.53375,-0.171095 0.24059,0.07267 0.39864,0.2667 0.34854,0.436385 v 0" ></path> <path d="m 14.25328,34.777892 c 0.006,0.175683 -0.19861,0.321378 -0.45191,0.324553 -0.2547,0.0056 -0.46073,-0.136525 -0.46355,-0.309385 0,-0.177448 0.20003,-0.321733 0.45473,-0.325966 0.2533,-0.0049 0.46073,0.136173 0.46073,0.310798 v 0" ></path> <path d="m 15.87571,34.501667 c 0.0303,0.17145 -0.1457,0.347485 -0.39723,0.394403 -0.2473,0.04516 -0.47625,-0.06068 -0.50765,-0.230716 -0.0307,-0.175684 0.14852,-0.351719 0.39546,-0.397227 0.25189,-0.04374 0.47731,0.05927 0.50942,0.23354 v 0" ></path> </svg> </li> </ul> </div> </body> </html>
Cut sharped neon text and svg effect
I am developing a Neon website. There is a option for texts and SVGs to do the cut sharped effect like these example images: I am trying to do the same effect on my neon texts and svgs, but unable to make it perfect. First Try: filter: drop-shadow(rgb(179, 179, 179) 2px 0px 0px) drop-shadow(rgb(179, 179, 179) -2px 0px 0px) drop-shadow(rgb(179, 179, 179) 0px 2px 0px) drop-shadow(rgb(179, 179, 179) 0px -2px 0px); This drop-shadow doesn't work fine, because it's displaying like 3/4 shadow layers: 2nd Try: -webkit-text-stroke: 1px rgb(179, 179, 179); stroke also doesn't work perfect, it's weird. Can someone help me to achieve cut sharped effect on text and svgs like the example image I have shown above? I am stuck on it.
You might use svg filters as described by Sara Soueidan (SVG Filter Effects: Outline Text with ) Svg filters could be applied to svg and html elements. body { background-color: #222; } h1, h2{ font-family: 'Kaushan Script', cursive; color: #fff; text-align:center; font-size: 12vw; margin:0 } h1{ font-size: 20vw; } .outline{ filter: url(#outline); } <link href="https://fonts.googleapis.com/css2?family=Kaushan+Script&display=swap" rel="stylesheet"> <h1 class="outline">Hello</h1> <h2 class="outline">World</h2> <svg viewBox="0 0 100 100"> <filter id="outline"> <feMorphology in="SourceAlpha" result="dilated" operator="dilate" radius="5" /> <feFlood flood-color="magenta" flood-opacity="1" result="neon" /> <feComposite in="neon" in2="dilated" operator="in" result="outline" /> <feMerge> <feMergeNode in="outline" /> <feMergeNode in="SourceGraphic" /> </feMerge> </filter> </svg> However: svg filters are infamous for introducing massive performance hits. So you should not apply them to many elements.
For SVGs it's easy. Just draw the paths stroked, before you draw the fills. You have to draw all the strokes before any of the fills though. Otherwise the stroke for one element will be on top of the previous element's fill. <svg viewBox="0 0 203.2 152.4"> <defs> <g id="hello"> <path d="m 153.91272,38.02268 c -2.12093,1.573594 -4.03661,4.173443 -7.04696,3.626107 1.29993,-2.668267 2.66827,-5.062866 2.66827,-8.073218 0,-2.052513 -0.4105,-3.489272 -2.46302,-4.036609 0.75259,-0.410503 1.5736,-0.821005 1.5736,-1.847262 0,-1.847261 -2.25777,-2.531432 -3.76294,-2.463015 -4.17345,0.205251 -9.09948,2.052513 -12.794,5.062865 -3.83136,2.941935 -6.36279,6.36279 -6.22596,11.494073 0.27367,6.225956 3.55769,9.783645 7.11538,9.783645 4.31028,0 7.66272,-2.189347 10.53623,-5.131283 4.99445,0 8.00481,-1.64201 11.08357,-5.541785 z m -12.58874,-5.336533 c 0.27367,0.136834 -2.94194,4.447111 -2.94194,8.0048 0,1.163091 0.34209,2.052513 0.82101,3.147187 -1.5736,1.436759 -3.01036,2.736684 -5.26812,2.736684 -1.71043,0 -3.01035,-0.615754 -3.01035,-2.59985 0,-2.12093 1.29992,-4.789197 2.8051,-6.294373 2.05251,-1.984096 5.26812,-3.626106 7.5943,-4.994448 z"/> <path d="m 113.6151,31.728307 c 3.2156,-7.046961 7.11537,-13.2045 10.46781,-14.84651 -1.23151,3.899774 -5.47337,10.467816 -10.33098,14.983344 z m 13.34133,7.252213 c -2.73668,2.463015 -8.0048,6.84171 -11.76774,6.84171 -1.84726,0 -2.8051,-1.368342 -3.42086,-2.941936 -0.34208,-1.64201 -0.13683,-3.557689 0.47892,-4.72078 14.84652,-14.36759 16.62536,-20.388295 17.10428,-26.887919 0.0684,-0.889423 -0.20525,-2.5314327 -1.36834,-2.5314327 -2.18935,0 -8.68897,6.3627897 -14.70968,13.8202537 -4.44711,5.473368 -7.52588,13.2045 -7.52588,20.388295 0,4.036609 1.09467,8.894223 6.08912,8.894223 5.88387,0 12.31508,-6.910127 16.07802,-10.809901 z"/> <path d="m 93.090027,31.728307 c 3.2156,-7.046961 7.115373,-13.2045 10.467813,-14.84651 -1.23151,3.899774 -5.473373,10.467816 -10.330983,14.983344 z m 13.341333,7.252213 c -2.73668,2.463015 -8.004803,6.84171 -11.767743,6.84171 -1.84726,0 -2.8051,-1.368342 -3.42086,-2.941936 -0.34208,-1.64201 -0.13683,-3.557689 0.47892,-4.72078 14.846513,-14.36759 16.625363,-20.388295 17.104283,-26.887919 0.0684,-0.889423 -0.20525,-2.5314327 -1.36834,-2.5314327 -2.18935,0 -8.688973,6.3627897 -14.709683,13.8202537 -4.44711,5.473368 -7.52588,13.2045 -7.52588,20.388295 0,4.036609 1.09467,8.894223 6.08912,8.894223 5.88387,0 12.315083,-6.910127 16.078023,-10.809901 z"/> <path d="m 85.974747,38.364766 c -3.6261,2.873518 -9.373141,7.867966 -14.230755,7.867966 -2.189347,0 -4.447112,-0.889422 -4.24186,-3.489272 l 0.136834,-1.505176 c 13.136081,-4.310277 16.488521,-9.373143 16.488521,-12.72558 0,-2.736684 -2.73668,-3.284021 -4.92603,-3.284021 -8.894224,-0.06842 -18.814704,9.099474 -18.541035,18.062114 0.136834,4.515528 2.463015,8.96264 7.457464,8.96264 6.773292,0 14.299171,-6.431207 18.472621,-11.288821 z m -17.925278,-0.47892 c 1.847261,-4.515528 5.815453,-7.799549 9.236308,-8.688971 0.47892,-0.136835 0.82101,0.273668 0.82101,0.752588 0.0684,1.16309 -4.036614,5.88387 -10.057318,7.936383 z"/> <path d="m 39.861688,39.254188 c -2.531432,4.789197 -3.626106,7.936384 -3.968191,9.988897 -0.342086,2.052512 0.06842,3.010352 1.231507,3.420854 1.778845,0.615754 5.268117,-2.736683 7.457464,-2.257764 C 44.3088,49.10625 43.82988,47.532657 43.82988,46.301149 c 0,-2.052513 2.531433,-5.268116 3.557689,-7.046961 2.805101,-0.205251 4.926031,0 6.978544,0.47892 2.189348,-3.557689 4.994449,-6.636459 8.210052,-9.167892 -2.805101,-1.710427 -6.157539,-1.64201 -9.304725,-1.710427 l 7.389046,-9.099474 c 5.131283,-6.294373 5.610203,-7.594298 5.610203,-9.7836447 0,-0.752588 -0.273669,-1.573594 -1.163091,-1.573594 -1.436759,0 -4.310277,3.8313577 -5.131283,4.9260317 L 47.592821,28.854789 37.056587,30.086297 44.78772,21.876245 c 2.736683,-2.941935 6.841709,-7.046961 6.841709,-11.288821 0,-3.3524377 -1.710427,-6.7048757 -7.389046,-6.7048757 -5.883871,0 -14.504425,1.64201 -20.183044,3.489272 -3.899775,1.231508 -15.3254311,4.9944477 -17.7884461,7.7995487 -1.231508,1.642011 -2.326182,5.541785 -2.326182,7.525881 0,1.231508 0.47892,3.147187 2.052513,3.147187 0.95784,0 1.915679,-0.547337 2.736684,-0.95784 4.7207801,-2.394598 4.2418601,-2.463015 9.3731431,-4.24186 0.821005,-0.273668 1.710427,-0.684171 1.710427,-1.64201 0,-0.615754 -0.478919,-0.821005 -0.957839,-1.026257 11.220404,-4.652362 19.840959,-7.183795 23.467065,-7.183795 0.821005,0 2.394598,0.273668 2.394598,1.505176 0,1.368342 -1.984095,3.762941 -2.873518,4.72078 -6.020704,6.84171 -10.946736,12.178244 -13.546585,14.709676 -10.399399,1.984096 -10.467816,2.463016 -11.220405,2.463016 -0.547336,0 -1.094673,-0.47892 -1.573593,-0.47892 -1.847262,0 -3.831357,3.626106 -3.831357,5.1997 0,2.326181 2.189347,3.215603 6.978544,2.805101 -0.95784,1.847261 -5.815454,6.568041 -5.815454,8.48372 0,1.573593 1.847262,2.941935 3.352438,2.941935 1.642011,0 3.147187,-2.736684 3.968192,-3.899774 l 7.115378,-8.346887 z"/> </g> </defs> <use xlink:href="#hello" fill="none" stroke="red" stroke-width="8"/> <use xlink:href="#hello" fill="black"/> </svg>
You can add multiple shadows with text-shadow just by comma-separating them like so: .neon { color: #fff; text-shadow: 0 0 7px #fff, 0 0 10px #fff, 0 0 21px #fff; } Just play with the shadow colors and spacing until they match your preferences. Or view this on Codepen.
Flex divs not colliding and flexing relative to each other
I want the lower div (containing the image and the button) to collide as in not overlap with the division above it (texts' divisions), so when the button hits, collides, with the division above it the button moves down squishing the image under it if there is no space available. You can see the GIF to visualize what I'm trying to do. I tried putting both divisions on the same z-index since they weren't but that was futile. .content { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; flex: 1 0 auto; } .waveContainer { position: absolute; z-index: -1; max-height: 100vh; top: 0; left: 0; right: 0; bottom: 0; } #wave { position: absolute; z-index: -1; } .flexParent { display: flex; justify-content: space-between; align-items: center; width: 100%; max-width: 1610px; bottom: 0; padding-right: 10px; padding-left: 10px; padding-bottom: 10px; z-index: 1; } .contact { width: 300px; height: 71px; border: none; background: #009ABC; border-radius: 18px; border-style: solid; border-color: #ffffff; font-family: Alata; font-style: normal; font-weight: normal; font-size: 30px; text-align: center; letter-spacing: 0.3em; color: #ffffff; } .contactContainer { z-index: 2; max-height: 500px; } .programmer { max-height: 500px; } #programmer { max-width: 100%; height: auto; } <div class="content"> <div class="flexParent"> <div class="programmer"> <svg id="programmer" width="594" height="451" viewBox="0 0 594 451" fill="none" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="none"> <g clip-path="url(#clip0)"> <path d="M287.383 398.746C159.532 389.016 7.06427 289.944 14.8267 187.933C22.589 85.9218 170.256 -9.0419 298.107 0.688383C425.958 10.4187 499.553 201.06 491.791 303.071C484.029 405.082 415.234 408.476 287.383 398.746Z" fill="#00D1FF" /> <path d="M298.106 415.131C445.502 415.131 564.991 407.81 564.991 398.779C564.991 389.748 445.502 382.427 298.106 382.427C150.709 382.427 31.2211 389.748 31.2211 398.779C31.2211 407.81 150.709 415.131 298.106 415.131Z" fill="#004150" /> <path opacity="0.1" d="M298.106 409.329C423.655 409.329 525.433 404.487 525.433 398.515C525.433 392.543 423.655 387.702 298.106 387.702C172.557 387.702 70.7791 392.543 70.7791 398.515C70.7791 404.487 172.557 409.329 298.106 409.329Z" fill="black" /> <path d="M111.919 451C173.731 451 223.839 446.631 223.839 441.242C223.839 435.852 173.731 431.483 111.919 431.483C50.108 431.483 0 435.852 0 441.242C0 446.631 50.108 451 111.919 451Z" fill="#004150" /> <path opacity="0.1" d="M111.919 447.537C164.569 447.537 207.25 444.648 207.25 441.084C207.25 437.52 164.569 434.631 111.919 434.631C59.2698 434.631 16.5889 437.52 16.5889 441.084C16.5889 444.648 59.2698 447.537 111.919 447.537Z" fill="black" /> <path d="M500.116 85.4526H103.48V396.669H500.116V85.4526Z" fill="#3F3D56" /> <path d="M297.285 127.983H199.436C199.28 127.984 199.125 127.953 198.981 127.894C198.836 127.834 198.705 127.747 198.595 127.636C198.484 127.526 198.396 127.395 198.337 127.251C198.277 127.107 198.246 126.952 198.246 126.796C198.246 126.64 198.277 126.485 198.337 126.341C198.396 126.196 198.484 126.065 198.595 125.955C198.705 125.845 198.836 125.757 198.981 125.698C199.125 125.638 199.28 125.608 199.436 125.608H297.285C297.6 125.609 297.901 125.734 298.124 125.957C298.346 126.18 298.47 126.481 298.47 126.796C298.47 127.11 298.346 127.412 298.124 127.635C297.901 127.857 297.6 127.983 297.285 127.983V127.983Z" fill="#F2F2F2" /> <path d="M404.397 141.047H250.498C250.183 141.047 249.881 140.922 249.659 140.699C249.436 140.476 249.311 140.174 249.311 139.859C249.311 139.544 249.436 139.242 249.659 139.02C249.881 138.797 250.183 138.672 250.498 138.672H404.397C404.553 138.672 404.708 138.702 404.852 138.762C404.996 138.822 405.127 138.909 405.237 139.02C405.347 139.13 405.435 139.261 405.495 139.405C405.554 139.549 405.585 139.703 405.585 139.859C405.585 140.015 405.554 140.17 405.495 140.314C405.435 140.458 405.347 140.589 405.237 140.699C405.127 140.809 404.996 140.897 404.852 140.956C404.708 141.016 404.553 141.047 404.397 141.047V141.047Z" fill="#F2F2F2" /> <path d="M297.76 154.11H199.911C199.596 154.11 199.294 153.985 199.071 153.763C198.849 153.54 198.723 153.238 198.723 152.923C198.723 152.608 198.849 152.306 199.071 152.083C199.294 151.86 199.596 151.735 199.911 151.735H297.76C298.075 151.735 298.377 151.86 298.6 152.083C298.823 152.306 298.948 152.608 298.948 152.923C298.948 153.238 298.823 153.54 298.6 153.763C298.377 153.985 298.075 154.11 297.76 154.11V154.11Z" fill="#F2F2F2" /> <path d="M404.397 154.348H306.548C306.233 154.348 305.931 154.223 305.708 154C305.486 153.777 305.36 153.475 305.36 153.16C305.36 152.845 305.486 152.543 305.708 152.321C305.931 152.098 306.233 151.973 306.548 151.973H404.397C404.712 151.973 405.014 152.098 405.237 152.321C405.46 152.543 405.585 152.845 405.585 153.16C405.585 153.475 405.46 153.777 405.237 154C405.014 154.223 404.712 154.348 404.397 154.348V154.348Z" fill="#F2F2F2" /> <path d="M297.998 167.174H200.148C199.834 167.174 199.531 167.049 199.309 166.826C199.086 166.603 198.961 166.301 198.961 165.986C198.961 165.671 199.086 165.369 199.309 165.147C199.531 164.924 199.834 164.799 200.148 164.799H297.998C298.313 164.799 298.615 164.924 298.838 165.147C299.06 165.369 299.186 165.671 299.186 165.986C299.186 166.301 299.06 166.603 298.838 166.826C298.615 167.049 298.313 167.174 297.998 167.174V167.174Z" fill="#F2F2F2" /> <path d="M298.236 180.238H200.386C200.071 180.238 199.769 180.112 199.546 179.89C199.324 179.667 199.198 179.365 199.198 179.05C199.198 178.735 199.324 178.433 199.546 178.21C199.769 177.987 200.071 177.862 200.386 177.862H298.236C298.55 177.862 298.853 177.987 299.075 178.21C299.298 178.433 299.423 178.735 299.423 179.05C299.423 179.365 299.298 179.667 299.075 179.89C298.853 180.112 298.55 180.238 298.236 180.238V180.238Z" fill="#F2F2F2" /> <path d="M342.648 128.221H314.623C314.308 128.221 314.006 128.096 313.783 127.873C313.561 127.65 313.435 127.348 313.435 127.033C313.435 126.718 313.561 126.416 313.783 126.193C314.006 125.971 314.308 125.846 314.623 125.846H342.648C342.963 125.846 343.265 125.971 343.487 126.193C343.71 126.416 343.835 126.718 343.835 127.033C343.835 127.348 343.71 127.65 343.487 127.873C343.265 128.096 342.963 128.221 342.648 128.221V128.221Z" fill="#F2F2F2" /> <path d="M342.648 167.174H314.623C314.308 167.174 314.006 167.049 313.783 166.826C313.561 166.603 313.435 166.301 313.435 165.986C313.435 165.671 313.561 165.369 313.783 165.147C314.006 164.924 314.308 164.799 314.623 164.799H342.648C342.963 164.799 343.265 164.924 343.487 165.147C343.71 165.369 343.835 165.671 343.835 165.986C343.835 166.301 343.71 166.603 343.487 166.826C343.265 167.049 342.963 167.174 342.648 167.174V167.174Z" fill="#F2F2F2" /> <path d="M342.648 180H314.623C314.467 180 314.312 179.97 314.168 179.91C314.023 179.851 313.892 179.763 313.782 179.653C313.671 179.543 313.583 179.412 313.524 179.267C313.464 179.123 313.433 178.969 313.433 178.812C313.433 178.656 313.464 178.502 313.524 178.357C313.583 178.213 313.671 178.082 313.782 177.972C313.892 177.861 314.023 177.774 314.168 177.714C314.312 177.655 314.467 177.624 314.623 177.625H342.648C342.804 177.624 342.959 177.655 343.103 177.714C343.247 177.774 343.379 177.861 343.489 177.972C343.6 178.082 343.687 178.213 343.747 178.357C343.807 178.502 343.838 178.656 343.838 178.812C343.838 178.969 343.807 179.123 343.747 179.267C343.687 179.412 343.6 179.543 343.489 179.653C343.379 179.763 343.247 179.851 343.103 179.91C342.959 179.97 342.804 180 342.648 180V180Z" fill="#F2F2F2" /> <path d="M389.673 180H361.648C361.333 179.999 361.032 179.874 360.81 179.651C360.587 179.429 360.463 179.127 360.463 178.812C360.463 178.498 360.587 178.196 360.81 177.974C361.032 177.751 361.333 177.625 361.648 177.625H389.673C389.829 177.624 389.983 177.655 390.128 177.714C390.272 177.774 390.403 177.861 390.514 177.972C390.624 178.082 390.712 178.213 390.772 178.357C390.832 178.502 390.863 178.656 390.863 178.812C390.863 178.969 390.832 179.123 390.772 179.267C390.712 179.412 390.624 179.543 390.514 179.653C390.403 179.763 390.272 179.851 390.128 179.91C389.983 179.97 389.829 180 389.673 180V180Z" fill="#F2F2F2" /> <path d="M227.223 141.047H199.198C198.884 141.047 198.581 140.922 198.359 140.699C198.136 140.476 198.011 140.174 198.011 139.859C198.011 139.544 198.136 139.242 198.359 139.02C198.581 138.797 198.884 138.672 199.198 138.672H227.223C227.538 138.672 227.84 138.797 228.063 139.02C228.286 139.242 228.411 139.544 228.411 139.859C228.411 140.174 228.286 140.476 228.063 140.699C227.84 140.922 227.538 141.047 227.223 141.047V141.047Z" fill="#F2F2F2" /> <path d="M297.404 320.374H199.555C199.24 320.374 198.938 320.249 198.715 320.026C198.492 319.803 198.367 319.501 198.367 319.186C198.367 318.871 198.492 318.569 198.715 318.346C198.938 318.124 199.24 317.999 199.555 317.999H297.404C297.719 317.999 298.021 318.124 298.244 318.346C298.467 318.569 298.592 318.871 298.592 319.186C298.592 319.501 298.467 319.803 298.244 320.026C298.021 320.249 297.719 320.374 297.404 320.374Z" fill="#F2F2F2" /> <path d="M112.792 223.877C111.489 223.195 109.847 223.489 108.588 224.249C107.371 225.082 106.306 226.116 105.438 227.307C102.622 230.745 99.6408 234.689 100.058 239.113C100.215 240.772 100.85 242.342 101.281 243.952C103.169 251.009 101.081 258.473 101.32 265.775C101.459 269.994 102.377 274.144 103.291 278.266C103.478 279.107 103.777 280.08 104.59 280.364C105.201 280.576 105.861 280.303 106.466 280.073C108.72 279.24 111.141 278.962 113.524 279.263C115.908 279.563 118.184 280.433 120.16 281.799C121.671 280.993 121.105 278.443 120.766 276.764C119.76 271.775 121.126 266.628 122.786 261.817C124.445 257.006 126.431 252.201 126.706 247.119C127.017 241.361 125.108 235.741 123.224 230.291C122.813 229.101 122.364 227.854 121.411 227.032C120.595 226.425 119.66 225.998 118.667 225.778C116.666 225.187 114.64 224.845 112.792 223.877Z" fill="#2F2E41" /> </g> <defs> <clipPath id="clip0"> <rect width="594" height="451" fill="white" /> </clipPath> </defs> </svg> </div> <div class="contactContainer"> <button class="contact" onclick="document.location.href='contact.html'"> VIEW </button> </div>
Move .waveContainer outside flex parent div, and remove position: absolute;.
Max-height and max-width not applying to flex children
I'm trying to set max-width and height to flex children, but, the div gets squished down to fit its children exactly. I found out that div .content (or its styling) is causing the issue, but, not sure why. I expect the division has a max-width and height of 1600px x 500px so they can flex correctly; i.e move closer to each other as the page gets smaller in width. html,body { /* removes all default margin and padding */ margin: 0; padding: 0; min-height: 100vh; } body { background-image: url(/Component\1\–\1svg); background-repeat: no-repeat; padding: none; margin: none; font-family: "Alata", sans-serif; background-color: #e5e5e5; display: flex; flex-direction: column; } .content { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; flex: 1 0 auto; } .waveContainer { position: absolute; top: 0; left: 0; right: 0; bottom: 0; } #wave { position: absolute; z-index: -1; } .flexParent { display: flex; justify-content: space-between; align-items: center; max-width: 1600px; max-height: 500px; /* both max width and height are not being applied to the div; notice how the div is not 1600x500 */ opacity: 0.6; background-color: yellow; } .contact { width: 369px; height: 71px; border: 0; padding: 0; background: #00d1ff; border-radius: 12px; border-color: 20px white; font-family: Alata; font-style: normal; font-weight: normal; font-size: 30px; line-height: 71px; text-align: center; letter-spacing: 0.3em; margin: 0px 0px 0px 0px; color: #ffffff; } <body> <div class="content"> <div class="waveContainer"> <svg id="wave" data-name="Component 1 – 1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="100%" height="100%" viewBox="0 0 1920 1080" preserveAspectRatio="none"> <defs> <clipPath id="clip-path"> <rect id="Rectangle_1" data-name="Rectangle 1" width="100%" height="100%" fill="#fff" stroke="#707070" stroke-width="1" /> </clipPath> </defs> <g id="Mask_Group_1" data-name="Mask Group 1" clip-path="url(#clip-path)"> <path id="Vector_3_3" data-name="Vector 3 3" d="M827.436,426.125C1163.09,111.934,1825.38,153.689,1986.77,0L2157,822.019,12.675,854-34,562.171C215.951,541.969,491.785,740.316,827.436,426.125Z" transform="translate(-46 122)" fill="#00d1ff" /> <path id="Vector_2_2" data-name="Vector 2 2" d="M827.436,426.125C1163.09,111.934,1825.38,153.689,1986.77,0L2157,822.019,12.675,854-34,562.171C215.951,541.969,491.785,740.316,827.436,426.125Z" transform="translate(-37 195)" fill="#00bae2" /> <path id="Vector_1_1" data-name="Vector 1 1" d="M831.436,426.125C1167.09,111.934,1829.38,153.689,1990.77,0L2161,822.019,16.675,854-30,562.171C219.951,541.969,495.785,740.316,831.436,426.125Z" transform="translate(-42 273)" fill="#009abc" /> </g> </svg> </div> <div class="flexParent"> <div class="programmer"> <svg id="programmer" width="594" height="451" viewBox="0 0 594 451" fill="none" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="none"> <g clip-path="url(#clip0)"> <path d="M287.383 398.746C159.532 389.016 7.06427 289.944 14.8267 187.933C22.589 85.9218 170.256 -9.0419 298.107 0.688383C425.958 10.4187 499.553 201.06 491.791 303.071C484.029 405.082 415.234 408.476 287.383 398.746Z" fill="#00D1FF" /> <path d="M298.106 415.131C445.502 415.131 564.991 407.81 564.991 398.779C564.991 389.748 445.502 382.427 298.106 382.427C150.709 382.427 31.2211 389.748 31.2211 398.779C31.2211 407.81 150.709 415.131 298.106 415.131Z" fill="#004150" /> <path opacity="0.1" d="M298.106 409.329C423.655 409.329 525.433 404.487 525.433 398.515C525.433 392.543 423.655 387.702 298.106 387.702C172.557 387.702 70.7791 392.543 70.7791 398.515C70.7791 404.487 172.557 409.329 298.106 409.329Z" fill="black" /> <path d="M111.919 451C173.731 451 223.839 446.631 223.839 441.242C223.839 435.852 173.731 431.483 111.919 431.483C50.108 431.483 0 435.852 0 441.242C0 446.631 50.108 451 111.919 451Z" fill="#004150" /> <path opacity="0.1" d="M111.919 447.537C164.569 447.537 207.25 444.648 207.25 441.084C207.25 437.52 164.569 434.631 111.919 434.631C59.2698 434.631 16.5889 437.52 16.5889 441.084C16.5889 444.648 59.2698 447.537 111.919 447.537Z" fill="black" /> <path d="M500.116 85.4526H103.48V396.669H500.116V85.4526Z" fill="#3F3D56" /> <path d="M297.285 127.983H199.436C199.28 127.984 199.125 127.953 198.981 127.894C198.836 127.834 198.705 127.747 198.595 127.636C198.484 127.526 198.396 127.395 198.337 127.251C198.277 127.107 198.246 126.952 198.246 126.796C198.246 126.64 198.277 126.485 198.337 126.341C198.396 126.196 198.484 126.065 198.595 125.955C198.705 125.845 198.836 125.757 198.981 125.698C199.125 125.638 199.28 125.608 199.436 125.608H297.285C297.6 125.609 297.901 125.734 298.124 125.957C298.346 126.18 298.47 126.481 298.47 126.796C298.47 127.11 298.346 127.412 298.124 127.635C297.901 127.857 297.6 127.983 297.285 127.983V127.983Z" fill="#F2F2F2" /> <path d="M404.397 141.047H250.498C250.183 141.047 249.881 140.922 249.659 140.699C249.436 140.476 249.311 140.174 249.311 139.859C249.311 139.544 249.436 139.242 249.659 139.02C249.881 138.797 250.183 138.672 250.498 138.672H404.397C404.553 138.672 404.708 138.702 404.852 138.762C404.996 138.822 405.127 138.909 405.237 139.02C405.347 139.13 405.435 139.261 405.495 139.405C405.554 139.549 405.585 139.703 405.585 139.859C405.585 140.015 405.554 140.17 405.495 140.314C405.435 140.458 405.347 140.589 405.237 140.699C405.127 140.809 404.996 140.897 404.852 140.956C404.708 141.016 404.553 141.047 404.397 141.047V141.047Z" fill="#F2F2F2" /> <path d="M297.76 154.11H199.911C199.596 154.11 199.294 153.985 199.071 153.763C198.849 153.54 198.723 153.238 198.723 152.923C198.723 152.608 198.849 152.306 199.071 152.083C199.294 151.86 199.596 151.735 199.911 151.735H297.76C298.075 151.735 298.377 151.86 298.6 152.083C298.823 152.306 298.948 152.608 298.948 152.923C298.948 153.238 298.823 153.54 298.6 153.763C298.377 153.985 298.075 154.11 297.76 154.11V154.11Z" fill="#F2F2F2" /> <path d="M404.397 154.348H306.548C306.233 154.348 305.931 154.223 305.708 154C305.486 153.777 305.36 153.475 305.36 153.16C305.36 152.845 305.486 152.543 305.708 152.321C305.931 152.098 306.233 151.973 306.548 151.973H404.397C404.712 151.973 405.014 152.098 405.237 152.321C405.46 152.543 405.585 152.845 405.585 153.16C405.585 153.475 405.46 153.777 405.237 154C405.014 154.223 404.712 154.348 404.397 154.348V154.348Z" fill="#F2F2F2" /> <path d="M110.833 367.49C111.226 370.297 111.73 373.114 111.596 375.945C111.408 379.898 109.982 383.706 109.719 387.655C109.522 390.604 109.977 393.585 109.567 396.512C109.305 398.386 108.694 400.193 108.316 402.047C107.717 405.069 107.733 408.181 108.365 411.196C108.997 414.211 110.231 417.068 111.994 419.594C112.253 420.027 112.621 420.384 113.061 420.629C113.483 420.785 113.935 420.845 114.384 420.804C118.832 420.713 123.268 420.31 127.659 419.597C127.981 419.584 128.285 419.45 128.512 419.221C128.611 419.07 128.674 418.898 128.697 418.718C129.511 414.532 127.654 410.334 127.182 406.096C126.678 401.57 127.764 397.035 128.842 392.611C129.33 390.429 129.941 388.275 130.67 386.161C131.191 384.738 131.821 383.354 132.272 381.908C132.912 379.636 133.301 377.301 133.433 374.944C133.747 371.225 133.913 367.498 133.932 363.762C134.038 360.222 133.744 356.681 133.054 353.207C132.063 348.809 130.035 344.724 128.024 340.689C126.949 340.947 125.94 341.427 125.061 342.098C122.47 343.776 119.764 345.271 116.965 346.571C115.083 347.445 111.415 348.066 110.221 349.887C109.044 351.683 109.803 355.347 109.893 357.327C110.048 360.727 110.361 364.115 110.833 367.49Z" fill="#2F2E41" /> <path opacity="0.1" d="M110.833 367.49C111.226 370.297 111.73 373.114 111.596 375.945C111.408 379.898 109.982 383.706 109.719 387.655C109.522 390.604 109.977 393.585 109.567 396.512C109.305 398.386 108.694 400.193 108.316 402.047C107.717 405.069 107.733 408.181 108.365 411.196C108.997 414.211 110.231 417.068 111.994 419.594C112.253 420.027 112.621 420.384 113.061 420.629C113.483 420.785 113.935 420.845 114.384 420.804C118.832 420.713 123.268 420.31 127.659 419.597C127.981 419.584 128.285 419.45 128.512 419.221C128.611 419.07 128.674 418.898 128.697 418.718C129.511 414.532 127.654 410.334 127.182 406.096C126.678 401.57 127.764 397.035 128.842 392.611C129.33 390.429 129.941 388.275 130.67 386.161C131.191 384.738 131.821 383.354 132.272 381.908C132.912 379.636 133.301 377.301 133.433 374.944C133.747 371.225 133.913 367.498 133.932 363.762C134.038 360.222 133.744 356.681 133.054 353.207C132.063 348.809 130.035 344.724 128.024 340.689C126.949 340.947 125.94 341.427 125.061 342.098C122.47 343.776 119.764 345.271 116.965 346.571C115.083 347.445 111.415 348.066 110.221 349.887C109.044 351.683 109.803 355.347 109.893 357.327C110.048 360.727 110.361 364.115 110.833 367.49Z" fill="black" /> <path d="M90.1718 307.533C88.1423 312.998 91.1255 318.903 93.7173 324.124C100.102 336.987 104.536 350.713 108.947 364.38C109.277 365.404 109.607 366.521 109.239 367.532C108.921 368.25 108.405 368.862 107.751 369.297C104.71 371.607 100.838 372.43 97.2152 373.638C93.7144 374.807 90.3615 376.378 87.2241 378.322C84.5991 379.949 82.1401 381.827 79.686 383.701L71.8735 389.668C71.3677 390.01 70.9257 390.438 70.5677 390.933C69.8142 392.115 70.1228 393.658 70.498 395.009C71.4915 398.586 72.7706 402.077 74.323 405.449C74.5785 406.188 75.0648 406.826 75.7102 407.267C76.9296 407.922 78.4211 407.054 79.3523 406.029C80.2834 405.005 81.0888 403.73 82.4014 403.29C83.7125 402.851 85.1555 403.383 86.5248 403.19C88.7393 402.88 90.2096 400.839 91.8059 399.273C98.3279 392.874 109.217 393.338 116.391 387.68C117.428 386.752 118.526 385.895 119.678 385.113C120.891 384.396 122.266 384.002 123.524 383.369C127.352 381.441 129.758 377.456 131.047 373.369C132.336 369.282 132.704 364.967 133.63 360.783C134.109 358.62 134.739 356.48 134.952 354.275C135.089 352.223 135.044 350.164 134.818 348.121L132.23 316.094C132.019 313.487 131.808 310.876 131.399 308.293C123.71 308.567 116.027 308.877 108.335 308.968C102.214 309.04 95.9798 309.468 90.1718 307.533Z" fill="#2F2E41" /> <path d="M87.3455 315.025C88.3884 316.703 90.9269 316.668 92.6748 315.749C94.4228 314.829 95.7808 313.284 97.533 312.372C99.8874 311.147 102.673 311.193 105.327 311.268C109.527 311.386 113.779 311.513 117.82 312.664C122 313.855 126.069 316.147 130.391 315.69C131.143 315.61 131.965 315.394 132.375 314.758C132.615 314.298 132.727 313.781 132.702 313.263L132.843 309.486C132.929 308.833 132.825 308.169 132.542 307.574C132.179 307.079 131.682 306.698 131.11 306.477C124.958 303.499 117.942 302.944 111.112 302.71C107.64 302.591 104.166 302.542 100.691 302.563C97.742 302.581 94.2018 302.155 91.3348 302.943C87.487 304 85.3934 311.886 87.3455 315.025Z" fill="#2F2E41" /> <path d="M125.974 216.124C117.913 216.053 110.609 210.732 102.549 210.602C101.575 210.535 100.6 210.703 99.7046 211.093C98.5815 211.659 97.8432 212.753 96.99 213.677C94.6069 216.258 91.1559 217.636 88.7076 220.155C86.412 222.517 85.1353 226.036 86.0416 229.203C86.9479 232.37 90.3685 234.799 93.573 234.038C94.864 229.858 97.5286 226.238 101.135 223.762C103.011 222.559 104.989 221.521 107.045 220.66C110.667 219.018 114.718 217.346 118.5 218.576C119.895 219.103 121.21 219.82 122.408 220.707L128.713 224.943C127.978 222.045 127.317 218.795 125.974 216.124Z" fill="#007089" /> <path d="M92.6445 231.236C91.5742 232.571 93.116 234.506 92.8801 236.201C92.7233 237.327 91.7965 238.187 91.4106 239.257C91.0109 240.365 91.2228 241.592 91.0712 242.76C90.9191 243.61 90.6941 244.444 90.3987 245.255C89.7196 247.677 89.2457 250.152 88.9818 252.653L87.5709 263.19C87.3261 264.776 87.1771 266.375 87.1247 267.979C87.1958 269.177 87.1157 270.38 86.8863 271.559C86.5738 272.71 85.8821 273.717 85.4167 274.816C84.9514 275.915 84.7357 277.244 85.3643 278.258C83.2591 280.011 82.6331 283.455 84.1051 285.766C84.3854 286.126 84.6046 286.53 84.754 286.961C84.8353 287.564 84.7359 288.177 84.4682 288.723L83.0416 292.525C82.6765 293.498 82.561 294.979 83.5762 295.201C82.7353 296.074 82.0802 297.109 81.6504 298.243C81.4419 298.812 81.3796 299.425 81.4692 300.024C81.5588 300.624 81.7975 301.191 82.1633 301.675C82.5177 301.986 82.8195 302.352 83.057 302.759C83.1965 303.327 83.1605 303.923 82.9537 304.47C82.7404 305.3 82.6992 306.165 82.8328 307.012C82.9665 307.859 83.272 308.669 83.7306 309.393C84.2058 310.108 84.8788 310.668 85.6673 311.006C86.4559 311.344 87.3258 311.445 88.1708 311.297C91.0245 310.653 93.5888 309.637 96.4662 310.165C102.661 311.302 108.877 312.444 114.877 314.359C121.725 316.546 128.356 319.753 135.514 320.426C135.985 320.522 136.474 320.446 136.894 320.211C137.258 319.865 137.485 319.399 137.532 318.899C138.269 315.441 139.007 311.984 139.744 308.526C140.636 304.693 141.314 300.814 141.777 296.907C142.029 294.385 142.101 291.849 142.173 289.315L142.743 269.149C143.01 266.177 142.614 263.182 141.582 260.382L138.303 249.912C136.432 243.938 132.138 238.639 130.61 232.568C129.643 228.725 128.928 224.601 126.334 221.606C122.635 217.336 116.236 216.672 110.635 217.406C108.105 217.738 105.553 218.31 103.364 219.622C100.833 221.14 98.9688 223.53 97.1651 225.866C95.6786 227.791 94.1655 229.338 92.6445 231.236Z" fill="#00657B" /> <path d="M105.722 290.551C106.184 292.541 107.153 294.376 107.746 296.331C108.74 299.606 108.656 303.133 109.648 306.409C110.064 307.784 110.667 309.104 110.966 310.509C111.663 313.785 110.645 317.174 109.382 320.276C108.118 323.377 106.579 326.436 106.169 329.76C105.88 332.101 106.295 334.744 108.1 336.264C109.973 337.841 112.695 337.734 115.135 337.524C116.011 337.5 116.876 337.32 117.689 336.993C119.554 336.11 120.34 333.902 120.777 331.884C122.238 325.122 121.821 318.113 121.396 311.208L120.285 293.15C120.071 289.674 119.842 286.125 118.771 282.787C118.381 281.573 117.702 279.119 116.593 278.344C115.494 277.576 112.358 277.542 110.998 277.478C104.617 277.178 104.688 286.085 105.722 290.551Z" fill="#FBBEBE" /> <path d="M112.792 223.877C111.489 223.195 109.847 223.489 108.588 224.249C107.371 225.082 106.306 226.116 105.438 227.307C102.622 230.745 99.6408 234.689 100.058 239.113C100.215 240.772 100.85 242.342 101.281 243.952C103.169 251.009 101.081 258.473 101.32 265.775C101.459 269.994 102.377 274.144 103.291 278.266C103.478 279.107 103.777 280.08 104.59 280.364C105.201 280.576 105.861 280.303 106.466 280.073C108.72 279.24 111.141 278.962 113.524 279.263C115.908 279.563 118.184 280.433 120.16 281.799C121.671 280.993 121.105 278.443 120.766 276.764C119.76 271.775 121.126 266.628 122.786 261.817C124.445 257.006 126.431 252.201 126.706 247.119C127.017 241.361 125.108 235.741 123.224 230.291C122.813 229.101 122.364 227.854 121.411 227.032C120.595 226.425 119.66 225.998 118.667 225.778C116.666 225.187 114.64 224.845 112.792 223.877Z" fill="#2F2E41" /> </g> <defs> <clipPath id="clip0"> <rect width="594" height="451" fill="white" /> </clipPath> </defs> </svg> </div> CODEPEN
Try to put width and height after max-width and max-height .flexParent { display: flex; justify-content: space-between; align-items: center; /* FOR TESTING */ max-width: 1600px; max-height: 500px; width: 200px; height: 300px; opacity: 0.6; background-color: yellow; }
Animating SVG with CSS and an inner <g> tag is its axis
I've got a small problem that I'm sure is just a simple fix, but I just haven't been able to fix it with how I usually do things. I've created an SVG logo in Sketch, and exported it and just wanted to make a simple loading animation, just rotating circles, one rotating clockwise and one rotating counter-clockwise. This should have been pretty simple, but when I got to the inner circle, it's rotating around a different axis. I put transform-origin: center on it, and it did nothing. I did transform-origin: fill-box and it got it rotating (on its inner axis) in the top left corner, so still not what I wanted. And I've taken the inline transform off, to no avail. The HTML code is here: <div class='loading-screen'> <svg width="62px" height="62px" viewBox="0 0 62 62" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <!-- Generator: Sketch 52.5 (67469) - http://www.bohemiancoding.com/sketch --> <title>Group 11 Copy 9</title> <desc>Created with Sketch.</desc> <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> <g id="Group-11-Copy-9"> <g id="Group-75-Copy" fill="#425563"> <path d="M30.5749355,61.1497976 C29.8994748,61.1497976 29.3519395,60.6028093 29.3519395,59.9280234 L29.3519395,53.2156572 C29.3519395,52.5408713 29.8994748,51.993883 30.5749355,51.993883 C31.2503961,51.993883 31.7979314,52.5408713 31.7979314,53.2156572 L31.7979314,59.9280234 C31.7979314,60.6028093 31.2503961,61.1497976 30.5749355,61.1497976" id="Fill-1"></path> <path d="M38.4886365,60.1022789 C37.8362293,60.2768705 37.1655995,59.8901178 36.9908334,59.2383013 L35.2517331,52.7547123 C35.076967,52.1029569 35.4641064,51.432997 36.1165747,51.2583444 C36.7689819,51.0836918 37.4396118,51.4704444 37.614439,52.1222609 L39.3534781,58.605911 C39.5282442,59.2576664 39.1411049,59.9276263 38.4886365,60.1022789" id="Fill-3"></path> <path d="M45.8315103,57.0489187 C45.2466125,57.3862505 44.498567,57.1860628 44.1608979,56.6017493 L40.801328,50.7886089 C40.4635977,50.2042343 40.6640467,49.4570583 41.2490057,49.1196042 C41.8339035,48.7822724 42.5818878,48.9824601 42.9196181,49.5668347 L46.2791269,55.3799751 C46.6169183,55.9642886 46.4164081,56.7115257 45.8315103,57.0489187" id="Fill-5"></path> <path d="M52.173949,52.1828792 C51.6963079,52.6600431 50.921968,52.6600431 50.4443881,52.1828792 L45.6932934,47.4365309 C45.2156524,46.959367 45.2156524,46.1858007 45.6932934,45.7086979 C46.1708734,45.231534 46.9452133,45.231534 47.4228543,45.7086979 L52.173949,50.4550462 C52.6515901,50.932149 52.6515901,51.7057153 52.173949,52.1828792" id="Fill-7"></path> <path d="M57.0571517,45.8797096 C56.7194825,46.4640231 55.971437,46.6642719 55.3865392,46.3268789 L49.5675856,42.9707264 C48.9826878,42.6332723 48.7822388,41.8860963 49.1199691,41.3017828 C49.4576994,40.7173472 50.2056838,40.5171595 50.7905816,40.8544913 L56.6095352,44.210705 C57.194433,44.5480979 57.3948209,45.295335 57.0571517,45.8797096" id="Fill-9"></path> <path d="M60.0897414,38.5201879 C59.9149141,39.1719433 59.2443454,39.558757 58.5918771,39.3841044 L52.1017433,37.6468026 C51.4493361,37.4722111 51.0621356,36.8022512 51.2369629,36.1504347 C51.4117901,35.4986793 52.08242,35.1118656 52.7348272,35.2865182 L59.2248998,37.02382 C59.8773681,37.1984115 60.2645075,37.8683714 60.0897414,38.5201879" id="Fill-11"></path> <path d="M61.1496508,30.6054126 C61.1496508,31.2801374 60.6020544,31.8271868 59.9266549,31.8271868 L53.2075151,31.8271868 C52.5321156,31.8271868 51.9845192,31.2801374 51.9845192,30.6054126 C51.9845192,29.9306267 52.5321156,29.3836384 53.2075151,29.3836384 L59.9266549,29.3836384 C60.6020544,29.3836384 61.1496508,29.9306267 61.1496508,30.6054126" id="Fill-13"></path> <path d="M-2.4459919e-05,30.6056508 C-2.4459919e-05,29.930865 0.547571977,29.3838767 1.22297149,29.3838767 L7.94211125,29.3838767 C8.61751076,29.3838767 9.1651072,29.930865 9.1651072,30.6056508 C9.1651072,31.2803756 8.61751076,31.827425 7.94211125,31.827425 L1.22297149,31.827425 C0.547571977,31.827425 -2.4459919e-05,31.2803756 -2.4459919e-05,30.6056508" id="Fill-16"></path> <path d="M1.04859673,38.5114766 C0.873769457,37.8596601 1.26096998,37.1897002 1.91337717,37.0151087 L8.40344978,35.2778069 C9.05591812,35.1031543 9.72654795,35.489968 9.90131407,36.1417234 C10.0762025,36.79354 9.68900198,37.4634998 9.03659479,37.6380914 L2.54639987,39.3753932 C1.89399268,39.5500458 1.22336285,39.1632321 1.04859673,38.5114766" id="Fill-19"></path> <path d="M4.10501649,45.8469538 C3.76728615,45.2626403 3.96767404,44.5154032 4.552633,44.1780103 L10.3715866,40.8217966 C10.9564844,40.4844648 11.7044687,40.6846525 12.0421991,41.2690271 C12.3798682,41.8534017 12.1794804,42.6005777 11.5945825,42.9380317 L5.77562896,46.2941843 C5.19066999,46.6315772 4.44268567,46.4313284 4.10501649,45.8469538" id="Fill-21"></path> <path d="M30.574697,0.0610581645 C31.2501577,0.0610581645 31.7976929,0.608046464 31.7976929,1.28283234 L31.7976929,7.99519858 C31.7976929,8.66998446 31.2501577,9.21697276 30.574697,9.21697276 C29.8992363,9.21697276 29.351701,8.66998446 29.351701,7.99519858 L29.351701,1.28283234 C29.351701,0.608046464 29.8992363,0.0610581645 30.574697,0.0610581645" id="Fill-23"></path> <path d="M8.97567736,9.02794597 C9.45331843,8.55078206 10.2276583,8.55078206 10.7052382,9.02794597 L15.4563329,13.7742943 C15.933974,14.2514582 15.933974,15.0250245 15.4563329,15.5021273 C14.978753,15.9792912 14.2044131,15.9792912 13.726772,15.5021273 L8.97567736,10.755779 C8.49803629,10.2786762 8.49803629,9.50510987 8.97567736,9.02794597" id="Fill-25"></path> <path d="M4.09247466,15.3311767 C4.43014384,14.7468021 5.17818932,14.5465533 5.76308713,14.8839463 L11.5820407,18.2401599 C12.1669385,18.5775529 12.3673876,19.3247899 12.0296572,19.9091034 C11.6919269,20.493478 10.9439426,20.6937268 10.3590448,20.3563339 L4.54009118,17.0001202 C3.95519337,16.6627273 3.75480548,15.9154902 4.09247466,15.3311767" id="Fill-27"></path> <path d="M1.05988498,22.6906678 C1.23471225,22.0389124 1.90528093,21.6520987 2.55774927,21.8267513 L9.04788304,23.5640531 C9.70035138,23.7387057 10.0874907,24.4086656 9.91266348,25.060421 C9.7378362,25.7121765 9.06720637,26.0989291 8.41479918,25.9243376 L1.92472657,24.1870358 C1.27225823,24.0123831 0.88511886,23.3424233 1.05988498,22.6906678" id="Fill-29"></path> <path d="M60.1010296,22.6993791 C60.2758569,23.3511345 59.8886564,24.0210944 59.2362492,24.195747 L52.7461766,25.9330488 C52.0937082,26.1076403 51.4230784,25.7208877 51.2483123,25.0691323 C51.0734239,24.4173769 51.4606244,23.747417 52.1130316,23.5727644 L58.6032265,21.8354626 C59.2556337,21.66081 59.9262635,22.0476237 60.1010296,22.6993791" id="Fill-31"></path> <path d="M57.044616,15.3638714 C57.3823463,15.948246 57.1819584,16.695483 56.5969995,17.0328149 L50.7780459,20.3890286 C50.1931481,20.7264215 49.4452249,20.5261727 49.1074334,19.9417981 C48.7697642,19.3574846 48.9701521,18.6102475 49.5550499,18.2728546 L55.3740035,14.916702 C55.9589625,14.5793091 56.7069468,14.7794968 57.044616,15.3638714" id="Fill-33"></path> <path d="M52.1737717,9.02776881 C52.6514127,9.50493272 52.6514127,10.278499 52.1737717,10.7556019 L47.422677,15.5019502 C46.9450359,15.9791141 46.170696,15.9791141 45.6931161,15.5019502 C45.215475,15.0248474 45.215475,14.25122 45.6931161,13.7741171 L50.4442108,9.02776881 C50.9217907,8.55060491 51.6961306,8.55060491 52.1737717,9.02776881" id="Fill-35"></path> <path d="M45.8642316,4.14943833 C46.4491906,4.48683127 46.6496396,5.23406836 46.3119093,5.81838186 L42.9523394,11.6315223 C42.614609,12.2158358 41.8666859,12.4160846 41.2817269,12.0786917 C40.6967679,11.7412987 40.4963801,10.9940616 40.8340492,10.4097481 L44.1936191,4.59660768 C44.5313495,4.01229418 45.2793338,3.81204539 45.8642316,4.14943833" id="Fill-37"></path> <path d="M38.4973565,1.11987821 C39.1498248,1.29453083 39.5369642,1.9644907 39.3621981,2.61624613 L37.623159,9.09989625 C37.4483317,9.75165168 36.7777019,10.1384654 36.1252947,9.96381277 C35.4728264,9.78922124 35.085687,9.11926137 35.2604531,8.46744485 L36.9995533,1.98379473 C37.1743195,1.3320393 37.8449493,0.945225592 38.4973565,1.11987821" id="Fill-39"></path> <path d="M22.6609898,1.1085768 C23.313397,0.933924181 23.9840268,1.32073789 24.158793,1.97249332 L25.8978932,8.45614344 C26.0726593,9.10795996 25.68552,9.77785874 25.0330516,9.95251136 C24.3806444,10.127164 23.7100146,9.74035027 23.5351873,9.08859484 L21.7961482,2.60494472 C21.6213821,1.95318929 22.0085215,1.28322942 22.6609898,1.1085768" id="Fill-49"></path> <path d="M15.3181221,4.16193708 C15.9030199,3.82460523 16.6510654,4.02479293 16.9887346,4.60916752 L20.3483045,10.4222469 C20.6860348,11.0065604 20.4856469,11.7537975 19.9006268,12.0911904 C19.315729,12.4285833 18.5677447,12.2283346 18.2300143,11.6440211 L14.8705056,5.8309417 C14.5327141,5.24656711 14.7332243,4.49933002 15.3181221,4.16193708" id="Fill-51"></path> <path d="M8.97586081,52.1831236 C8.49821974,51.7059597 8.49821974,50.9323323 8.97586081,50.4552905 L13.7269555,45.7089422 C14.2045965,45.2317783 14.9789364,45.2317783 15.4565164,45.7089422 C15.9341574,46.186045 15.9341574,46.9596113 15.4565164,47.4367753 L10.7054217,52.1831236 C10.2278418,52.6602875 9.45350188,52.6602875 8.97586081,52.1831236" id="Fill-53"></path> <path d="M15.2853948,57.0613869 C14.7004358,56.724055 14.4999868,55.9768179 14.8377782,55.3924433 L18.197287,49.5793029 C18.5350173,48.9949894 19.2829405,48.7948017 19.8678994,49.1321335 C20.4528584,49.4695876 20.6532463,50.2167636 20.3155771,50.8010771 L16.9560072,56.6142175 C16.618338,57.1985921 15.8702926,57.3987798 15.2853948,57.0613869" id="Fill-65"></path> <path d="M22.652276,60.090947 C21.9998076,59.9163555 21.6126683,59.2463956 21.7874344,58.5946401 L23.5264735,52.1109289 C23.7013008,51.4591735 24.3719306,51.0723598 25.0243378,51.2470735 C25.6768061,51.421665 26.0639455,52.0916249 25.8891794,52.7433803 L24.1500791,59.2270305 C23.975313,59.8787859 23.3046832,60.2655996 22.652276,60.090947" id="Fill-73"></path> </g> <g id="Group" transform="translate(12.068571, 12.068571)" fill="#FF6900"> <path d="M18.506364,36.2688224 C17.8309034,36.2688224 17.2833681,35.7218341 17.2833681,35.0470483 L17.2833681,31.3817257 C17.2833681,30.7069399 17.8309034,30.1599516 18.506364,30.1599516 C19.1818247,30.1599516 19.72936,30.7069399 19.72936,31.3817257 L19.72936,35.0470483 C19.72936,35.7218341 19.1818247,36.2688224 18.506364,36.2688224" id="Fill-41"></path> <path d="M30.1263727,18.5120575 C30.1263727,17.8372716 30.673908,17.2902833 31.3493686,17.2902833 L35.0183565,17.2902833 C35.6938171,17.2902833 36.2413524,17.8372716 36.2413524,18.5120575 C36.2413524,19.1868434 35.6938171,19.7338317 35.0183565,19.7338317 L31.3493686,19.7338317 C30.673908,19.7338317 30.1263727,19.1868434 30.1263727,18.5120575" id="Fill-43"></path> <path d="M28.560785,24.3360045 C28.8984542,23.7516299 29.6464996,23.5513811 30.2313975,23.8888352 L33.4088632,25.7214964 C33.9938222,26.0588283 34.1942101,26.8060654 33.8565409,27.39044 C33.5187494,27.9747535 32.7708262,28.1750022 32.1858673,27.8376093 L29.0084015,26.004948 C28.4235037,25.6676162 28.2230547,24.920318 28.560785,24.3360045" id="Fill-45"></path> <path d="M24.3010228,28.6082189 C24.8859818,28.2708871 25.6339661,28.4710748 25.9716964,29.0553883 L27.8061904,32.2296798 C28.1439207,32.8140544 27.9434717,33.5612915 27.3585127,33.8986844 C26.7736149,34.2360773 26.0256306,34.0358285 25.6879002,33.451454 L23.8534063,30.2771625 C23.515676,29.692849 23.716125,28.9456119 24.3010228,28.6082189" id="Fill-47"></path> <path d="M18.4956139,0.816643903 C19.1710746,0.816643903 19.7186099,1.3636322 19.7186099,2.03841808 L19.7186099,5.70374061 C19.7186099,6.3784654 19.1710746,6.92551479 18.4956139,6.92551479 C17.8201532,6.92551479 17.272618,6.3784654 17.272618,5.70374061 L17.272618,2.03841808 C17.272618,1.3636322 17.8201532,0.816643903 18.4956139,0.816643903" id="Fill-55"></path> <path d="M8.44118686,12.7494618 C8.10351768,13.3338364 7.35547221,13.5340852 6.77057439,13.1966923 L3.59310861,11.364031 C3.00814965,11.0266381 2.80776176,10.279401 3.14543094,9.69502639 C3.48316127,9.11071289 4.2311456,8.9104641 4.81610456,9.24785704 L7.99357034,11.0805183 C8.57846816,11.4179112 8.77885604,12.1651483 8.44118686,12.7494618" id="Fill-57"></path> <path d="M12.700894,8.47724741 C12.1159962,8.81464035 11.3680119,8.61439156 11.0302815,8.03001697 L9.19578759,4.85578657 C8.85805726,4.27141198 9.0585063,3.5241749 9.64340411,3.18678196 C10.2283631,2.84945011 10.9763474,3.04963781 11.3140777,3.63401239 L13.1485717,6.8082428 C13.486302,7.39261738 13.285853,8.13985447 12.700894,8.47724741" id="Fill-59"></path> <path d="M24.2842983,8.48953846 L24.2842372,8.48953846 C23.6993394,8.15214552 23.4988903,7.40496952 23.8366207,6.82059493 L25.6711146,3.64630344 C26.0088449,3.06192885 26.7568293,2.86174115 27.3417271,3.199073 L27.3417882,3.199073 C27.926686,3.53646594 28.1271351,4.28370303 27.7894047,4.86807762 L25.9549108,8.04236911 C25.6171805,8.6267437 24.8691962,8.8269314 24.2842983,8.48953846" id="Fill-61"></path> <path d="M28.560785,12.7450207 C28.2230547,12.1606461 28.4235037,11.413409 29.0084015,11.0760772 L32.1858673,9.2433548 C32.7708262,8.90602295 33.5187494,9.10621065 33.8565409,9.69058524 C34.1942101,10.2749598 33.9938222,11.0221358 33.4088632,11.3595288 L30.2313975,13.19219 C29.6464996,13.529583 28.8984542,13.3293953 28.560785,12.7450207" id="Fill-63"></path> <path d="M0.772922751,18.5515452 C0.772922751,17.8768204 1.32045804,17.329771 1.9959187,17.329771 L5.66490656,17.329771 C6.34036722,17.329771 6.88790251,17.8768204 6.88790251,18.5515452 C6.88790251,19.2263311 6.34036722,19.7733194 5.66490656,19.7733194 L1.9959187,19.7733194 C1.32045804,19.7733194 0.772922751,19.2263311 0.772922751,18.5515452" id="Fill-67"></path> <path d="M12.7176735,28.5959279 C13.3026325,28.9332597 13.5030815,29.6805579 13.16529,30.2648714 L11.3307961,33.4391629 C10.9931269,34.0235375 10.2451426,34.2237252 9.66018362,33.8863933 C9.0752858,33.5490004 8.87483677,32.8017633 9.2125671,32.2173887 L11.047061,29.0430972 C11.3847302,28.4587837 12.1327757,28.258596 12.7176735,28.5959279" id="Fill-69"></path> <path d="M8.44118686,24.3404762 C8.77885604,24.9247897 8.57846816,25.6720268 7.99357034,26.0094197 L4.81610456,27.842081 C4.2311456,28.1794739 3.48316127,27.9792252 3.14543094,27.3949117 C2.80776176,26.8105371 3.00814965,26.0633 3.59310861,25.725907 L6.77057439,23.8932458 C7.35547221,23.5558528 8.10351768,23.7561016 8.44118686,24.3404762" id="Fill-71"></path> </g> </g> </g> </svg> </div> And the SCSS code is here: * { margin: 0; padding: 0; } .loading-screen { height: 100vh; width: 100vw; background-color: #f3f4f5; position: fixed; z-index: 9999; display: flex; justify-content: center; align-items: center; g#Group-75-Copy { transform-origin: center; animation: backwards-spin 3s infinite linear; } g#Group { transform-origin: center; transform-box: fill-box; animation: spin 3s infinite linear; } } #keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } #keyframes backwards-spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(-360deg); } } And here's a link to a working codepen: https://codepen.io/adammcgurk/pen/oJmLxW So the TL;DR question is: How can I get the orange circle to be in the middle as opposed to in the top left corner of the SVG?
I would add some translation to the animation to rectify the position: * { margin: 0; padding: 0; } .loading-screen { height: 100vh; width: 100vw; background-color: #f3f4f5; position: fixed; z-index: 9999; display: flex; justify-content: center; align-items: center; } svg { width: 62px; height: 62px; } g#Group-75-Copy { transform-origin: center; animation: backwards-spin 3s infinite linear; } g#Group { transform-origin: center; transform-box:fill-box; animation: spin 3s infinite linear; } #keyframes spin { 0% { transform:translate(35%,35%) rotate(0deg); } 100% { transform:translate(35%,35%) rotate(360deg); } } #keyframes backwards-spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(-360deg); } } <div class='loading-screen'> <svg> <g id="Page-1" stroke-width="1" fill="none" fill-rule="evenodd"> <g id="Group-11-Copy-9"> <g id="Group-75-Copy" fill="#425563"> <path d="M30.5749355,61.1497976 C29.8994748,61.1497976 29.3519395,60.6028093 29.3519395,59.9280234 L29.3519395,53.2156572 C29.3519395,52.5408713 29.8994748,51.993883 30.5749355,51.993883 C31.2503961,51.993883 31.7979314,52.5408713 31.7979314,53.2156572 L31.7979314,59.9280234 C31.7979314,60.6028093 31.2503961,61.1497976 30.5749355,61.1497976" id="Fill-1"></path> <path d="M38.4886365,60.1022789 C37.8362293,60.2768705 37.1655995,59.8901178 36.9908334,59.2383013 L35.2517331,52.7547123 C35.076967,52.1029569 35.4641064,51.432997 36.1165747,51.2583444 C36.7689819,51.0836918 37.4396118,51.4704444 37.614439,52.1222609 L39.3534781,58.605911 C39.5282442,59.2576664 39.1411049,59.9276263 38.4886365,60.1022789" id="Fill-3"></path> <path d="M45.8315103,57.0489187 C45.2466125,57.3862505 44.498567,57.1860628 44.1608979,56.6017493 L40.801328,50.7886089 C40.4635977,50.2042343 40.6640467,49.4570583 41.2490057,49.1196042 C41.8339035,48.7822724 42.5818878,48.9824601 42.9196181,49.5668347 L46.2791269,55.3799751 C46.6169183,55.9642886 46.4164081,56.7115257 45.8315103,57.0489187" id="Fill-5"></path> <path d="M52.173949,52.1828792 C51.6963079,52.6600431 50.921968,52.6600431 50.4443881,52.1828792 L45.6932934,47.4365309 C45.2156524,46.959367 45.2156524,46.1858007 45.6932934,45.7086979 C46.1708734,45.231534 46.9452133,45.231534 47.4228543,45.7086979 L52.173949,50.4550462 C52.6515901,50.932149 52.6515901,51.7057153 52.173949,52.1828792" id="Fill-7"></path> <path d="M57.0571517,45.8797096 C56.7194825,46.4640231 55.971437,46.6642719 55.3865392,46.3268789 L49.5675856,42.9707264 C48.9826878,42.6332723 48.7822388,41.8860963 49.1199691,41.3017828 C49.4576994,40.7173472 50.2056838,40.5171595 50.7905816,40.8544913 L56.6095352,44.210705 C57.194433,44.5480979 57.3948209,45.295335 57.0571517,45.8797096" id="Fill-9"></path> <path d="M60.0897414,38.5201879 C59.9149141,39.1719433 59.2443454,39.558757 58.5918771,39.3841044 L52.1017433,37.6468026 C51.4493361,37.4722111 51.0621356,36.8022512 51.2369629,36.1504347 C51.4117901,35.4986793 52.08242,35.1118656 52.7348272,35.2865182 L59.2248998,37.02382 C59.8773681,37.1984115 60.2645075,37.8683714 60.0897414,38.5201879" id="Fill-11"></path> <path d="M61.1496508,30.6054126 C61.1496508,31.2801374 60.6020544,31.8271868 59.9266549,31.8271868 L53.2075151,31.8271868 C52.5321156,31.8271868 51.9845192,31.2801374 51.9845192,30.6054126 C51.9845192,29.9306267 52.5321156,29.3836384 53.2075151,29.3836384 L59.9266549,29.3836384 C60.6020544,29.3836384 61.1496508,29.9306267 61.1496508,30.6054126" id="Fill-13"></path> <path d="M-2.4459919e-05,30.6056508 C-2.4459919e-05,29.930865 0.547571977,29.3838767 1.22297149,29.3838767 L7.94211125,29.3838767 C8.61751076,29.3838767 9.1651072,29.930865 9.1651072,30.6056508 C9.1651072,31.2803756 8.61751076,31.827425 7.94211125,31.827425 L1.22297149,31.827425 C0.547571977,31.827425 -2.4459919e-05,31.2803756 -2.4459919e-05,30.6056508" id="Fill-16"></path> <path d="M1.04859673,38.5114766 C0.873769457,37.8596601 1.26096998,37.1897002 1.91337717,37.0151087 L8.40344978,35.2778069 C9.05591812,35.1031543 9.72654795,35.489968 9.90131407,36.1417234 C10.0762025,36.79354 9.68900198,37.4634998 9.03659479,37.6380914 L2.54639987,39.3753932 C1.89399268,39.5500458 1.22336285,39.1632321 1.04859673,38.5114766" id="Fill-19"></path> <path d="M4.10501649,45.8469538 C3.76728615,45.2626403 3.96767404,44.5154032 4.552633,44.1780103 L10.3715866,40.8217966 C10.9564844,40.4844648 11.7044687,40.6846525 12.0421991,41.2690271 C12.3798682,41.8534017 12.1794804,42.6005777 11.5945825,42.9380317 L5.77562896,46.2941843 C5.19066999,46.6315772 4.44268567,46.4313284 4.10501649,45.8469538" id="Fill-21"></path> <path d="M30.574697,0.0610581645 C31.2501577,0.0610581645 31.7976929,0.608046464 31.7976929,1.28283234 L31.7976929,7.99519858 C31.7976929,8.66998446 31.2501577,9.21697276 30.574697,9.21697276 C29.8992363,9.21697276 29.351701,8.66998446 29.351701,7.99519858 L29.351701,1.28283234 C29.351701,0.608046464 29.8992363,0.0610581645 30.574697,0.0610581645" id="Fill-23"></path> <path d="M8.97567736,9.02794597 C9.45331843,8.55078206 10.2276583,8.55078206 10.7052382,9.02794597 L15.4563329,13.7742943 C15.933974,14.2514582 15.933974,15.0250245 15.4563329,15.5021273 C14.978753,15.9792912 14.2044131,15.9792912 13.726772,15.5021273 L8.97567736,10.755779 C8.49803629,10.2786762 8.49803629,9.50510987 8.97567736,9.02794597" id="Fill-25"></path> <path d="M4.09247466,15.3311767 C4.43014384,14.7468021 5.17818932,14.5465533 5.76308713,14.8839463 L11.5820407,18.2401599 C12.1669385,18.5775529 12.3673876,19.3247899 12.0296572,19.9091034 C11.6919269,20.493478 10.9439426,20.6937268 10.3590448,20.3563339 L4.54009118,17.0001202 C3.95519337,16.6627273 3.75480548,15.9154902 4.09247466,15.3311767" id="Fill-27"></path> <path d="M1.05988498,22.6906678 C1.23471225,22.0389124 1.90528093,21.6520987 2.55774927,21.8267513 L9.04788304,23.5640531 C9.70035138,23.7387057 10.0874907,24.4086656 9.91266348,25.060421 C9.7378362,25.7121765 9.06720637,26.0989291 8.41479918,25.9243376 L1.92472657,24.1870358 C1.27225823,24.0123831 0.88511886,23.3424233 1.05988498,22.6906678" id="Fill-29"></path> <path d="M60.1010296,22.6993791 C60.2758569,23.3511345 59.8886564,24.0210944 59.2362492,24.195747 L52.7461766,25.9330488 C52.0937082,26.1076403 51.4230784,25.7208877 51.2483123,25.0691323 C51.0734239,24.4173769 51.4606244,23.747417 52.1130316,23.5727644 L58.6032265,21.8354626 C59.2556337,21.66081 59.9262635,22.0476237 60.1010296,22.6993791" id="Fill-31"></path> <path d="M57.044616,15.3638714 C57.3823463,15.948246 57.1819584,16.695483 56.5969995,17.0328149 L50.7780459,20.3890286 C50.1931481,20.7264215 49.4452249,20.5261727 49.1074334,19.9417981 C48.7697642,19.3574846 48.9701521,18.6102475 49.5550499,18.2728546 L55.3740035,14.916702 C55.9589625,14.5793091 56.7069468,14.7794968 57.044616,15.3638714" id="Fill-33"></path> <path d="M52.1737717,9.02776881 C52.6514127,9.50493272 52.6514127,10.278499 52.1737717,10.7556019 L47.422677,15.5019502 C46.9450359,15.9791141 46.170696,15.9791141 45.6931161,15.5019502 C45.215475,15.0248474 45.215475,14.25122 45.6931161,13.7741171 L50.4442108,9.02776881 C50.9217907,8.55060491 51.6961306,8.55060491 52.1737717,9.02776881" id="Fill-35"></path> <path d="M45.8642316,4.14943833 C46.4491906,4.48683127 46.6496396,5.23406836 46.3119093,5.81838186 L42.9523394,11.6315223 C42.614609,12.2158358 41.8666859,12.4160846 41.2817269,12.0786917 C40.6967679,11.7412987 40.4963801,10.9940616 40.8340492,10.4097481 L44.1936191,4.59660768 C44.5313495,4.01229418 45.2793338,3.81204539 45.8642316,4.14943833" id="Fill-37"></path> <path d="M38.4973565,1.11987821 C39.1498248,1.29453083 39.5369642,1.9644907 39.3621981,2.61624613 L37.623159,9.09989625 C37.4483317,9.75165168 36.7777019,10.1384654 36.1252947,9.96381277 C35.4728264,9.78922124 35.085687,9.11926137 35.2604531,8.46744485 L36.9995533,1.98379473 C37.1743195,1.3320393 37.8449493,0.945225592 38.4973565,1.11987821" id="Fill-39"></path> <path d="M22.6609898,1.1085768 C23.313397,0.933924181 23.9840268,1.32073789 24.158793,1.97249332 L25.8978932,8.45614344 C26.0726593,9.10795996 25.68552,9.77785874 25.0330516,9.95251136 C24.3806444,10.127164 23.7100146,9.74035027 23.5351873,9.08859484 L21.7961482,2.60494472 C21.6213821,1.95318929 22.0085215,1.28322942 22.6609898,1.1085768" id="Fill-49"></path> <path d="M15.3181221,4.16193708 C15.9030199,3.82460523 16.6510654,4.02479293 16.9887346,4.60916752 L20.3483045,10.4222469 C20.6860348,11.0065604 20.4856469,11.7537975 19.9006268,12.0911904 C19.315729,12.4285833 18.5677447,12.2283346 18.2300143,11.6440211 L14.8705056,5.8309417 C14.5327141,5.24656711 14.7332243,4.49933002 15.3181221,4.16193708" id="Fill-51"></path> <path d="M8.97586081,52.1831236 C8.49821974,51.7059597 8.49821974,50.9323323 8.97586081,50.4552905 L13.7269555,45.7089422 C14.2045965,45.2317783 14.9789364,45.2317783 15.4565164,45.7089422 C15.9341574,46.186045 15.9341574,46.9596113 15.4565164,47.4367753 L10.7054217,52.1831236 C10.2278418,52.6602875 9.45350188,52.6602875 8.97586081,52.1831236" id="Fill-53"></path> <path d="M15.2853948,57.0613869 C14.7004358,56.724055 14.4999868,55.9768179 14.8377782,55.3924433 L18.197287,49.5793029 C18.5350173,48.9949894 19.2829405,48.7948017 19.8678994,49.1321335 C20.4528584,49.4695876 20.6532463,50.2167636 20.3155771,50.8010771 L16.9560072,56.6142175 C16.618338,57.1985921 15.8702926,57.3987798 15.2853948,57.0613869" id="Fill-65"></path> <path d="M22.652276,60.090947 C21.9998076,59.9163555 21.6126683,59.2463956 21.7874344,58.5946401 L23.5264735,52.1109289 C23.7013008,51.4591735 24.3719306,51.0723598 25.0243378,51.2470735 C25.6768061,51.421665 26.0639455,52.0916249 25.8891794,52.7433803 L24.1500791,59.2270305 C23.975313,59.8787859 23.3046832,60.2655996 22.652276,60.090947" id="Fill-73"></path> </g> <g id="Group" fill="#FF6900"> <path d="M18.506364,36.2688224 C17.8309034,36.2688224 17.2833681,35.7218341 17.2833681,35.0470483 L17.2833681,31.3817257 C17.2833681,30.7069399 17.8309034,30.1599516 18.506364,30.1599516 C19.1818247,30.1599516 19.72936,30.7069399 19.72936,31.3817257 L19.72936,35.0470483 C19.72936,35.7218341 19.1818247,36.2688224 18.506364,36.2688224" id="Fill-41"></path> <path d="M30.1263727,18.5120575 C30.1263727,17.8372716 30.673908,17.2902833 31.3493686,17.2902833 L35.0183565,17.2902833 C35.6938171,17.2902833 36.2413524,17.8372716 36.2413524,18.5120575 C36.2413524,19.1868434 35.6938171,19.7338317 35.0183565,19.7338317 L31.3493686,19.7338317 C30.673908,19.7338317 30.1263727,19.1868434 30.1263727,18.5120575" id="Fill-43"></path> <path d="M28.560785,24.3360045 C28.8984542,23.7516299 29.6464996,23.5513811 30.2313975,23.8888352 L33.4088632,25.7214964 C33.9938222,26.0588283 34.1942101,26.8060654 33.8565409,27.39044 C33.5187494,27.9747535 32.7708262,28.1750022 32.1858673,27.8376093 L29.0084015,26.004948 C28.4235037,25.6676162 28.2230547,24.920318 28.560785,24.3360045" id="Fill-45"></path> <path d="M24.3010228,28.6082189 C24.8859818,28.2708871 25.6339661,28.4710748 25.9716964,29.0553883 L27.8061904,32.2296798 C28.1439207,32.8140544 27.9434717,33.5612915 27.3585127,33.8986844 C26.7736149,34.2360773 26.0256306,34.0358285 25.6879002,33.451454 L23.8534063,30.2771625 C23.515676,29.692849 23.716125,28.9456119 24.3010228,28.6082189" id="Fill-47"></path> <path d="M18.4956139,0.816643903 C19.1710746,0.816643903 19.7186099,1.3636322 19.7186099,2.03841808 L19.7186099,5.70374061 C19.7186099,6.3784654 19.1710746,6.92551479 18.4956139,6.92551479 C17.8201532,6.92551479 17.272618,6.3784654 17.272618,5.70374061 L17.272618,2.03841808 C17.272618,1.3636322 17.8201532,0.816643903 18.4956139,0.816643903" id="Fill-55"></path> <path d="M8.44118686,12.7494618 C8.10351768,13.3338364 7.35547221,13.5340852 6.77057439,13.1966923 L3.59310861,11.364031 C3.00814965,11.0266381 2.80776176,10.279401 3.14543094,9.69502639 C3.48316127,9.11071289 4.2311456,8.9104641 4.81610456,9.24785704 L7.99357034,11.0805183 C8.57846816,11.4179112 8.77885604,12.1651483 8.44118686,12.7494618" id="Fill-57"></path> <path d="M12.700894,8.47724741 C12.1159962,8.81464035 11.3680119,8.61439156 11.0302815,8.03001697 L9.19578759,4.85578657 C8.85805726,4.27141198 9.0585063,3.5241749 9.64340411,3.18678196 C10.2283631,2.84945011 10.9763474,3.04963781 11.3140777,3.63401239 L13.1485717,6.8082428 C13.486302,7.39261738 13.285853,8.13985447 12.700894,8.47724741" id="Fill-59"></path> <path d="M24.2842983,8.48953846 L24.2842372,8.48953846 C23.6993394,8.15214552 23.4988903,7.40496952 23.8366207,6.82059493 L25.6711146,3.64630344 C26.0088449,3.06192885 26.7568293,2.86174115 27.3417271,3.199073 L27.3417882,3.199073 C27.926686,3.53646594 28.1271351,4.28370303 27.7894047,4.86807762 L25.9549108,8.04236911 C25.6171805,8.6267437 24.8691962,8.8269314 24.2842983,8.48953846" id="Fill-61"></path> <path d="M28.560785,12.7450207 C28.2230547,12.1606461 28.4235037,11.413409 29.0084015,11.0760772 L32.1858673,9.2433548 C32.7708262,8.90602295 33.5187494,9.10621065 33.8565409,9.69058524 C34.1942101,10.2749598 33.9938222,11.0221358 33.4088632,11.3595288 L30.2313975,13.19219 C29.6464996,13.529583 28.8984542,13.3293953 28.560785,12.7450207" id="Fill-63"></path> <path d="M0.772922751,18.5515452 C0.772922751,17.8768204 1.32045804,17.329771 1.9959187,17.329771 L5.66490656,17.329771 C6.34036722,17.329771 6.88790251,17.8768204 6.88790251,18.5515452 C6.88790251,19.2263311 6.34036722,19.7733194 5.66490656,19.7733194 L1.9959187,19.7733194 C1.32045804,19.7733194 0.772922751,19.2263311 0.772922751,18.5515452" id="Fill-67"></path> <path d="M12.7176735,28.5959279 C13.3026325,28.9332597 13.5030815,29.6805579 13.16529,30.2648714 L11.3307961,33.4391629 C10.9931269,34.0235375 10.2451426,34.2237252 9.66018362,33.8863933 C9.0752858,33.5490004 8.87483677,32.8017633 9.2125671,32.2173887 L11.047061,29.0430972 C11.3847302,28.4587837 12.1327757,28.258596 12.7176735,28.5959279" id="Fill-69"></path> <path d="M8.44118686,24.3404762 C8.77885604,24.9247897 8.57846816,25.6720268 7.99357034,26.0094197 L4.81610456,27.842081 C4.2311456,28.1794739 3.48316127,27.9792252 3.14543094,27.3949117 C2.80776176,26.8105371 3.00814965,26.0633 3.59310861,25.725907 L6.77057439,23.8932458 C7.35547221,23.5558528 8.10351768,23.7561016 8.44118686,24.3404762" id="Fill-71"></path> </g> </g> </g> </svg> </div>
Pure svg and smil Option using stroke-dasharray We divide one circle into 12 parts, the second circle into 24 parts. Set the circles to a wide stroke. Use the animation of the rotation of circles in different directions .container { width:50%; height:50%; } <div class="container"> <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 400 400" preserveAspectRatio="xMinYMin meet" > <circle fill="none" cx="200" cy="200" r="50" stroke="#425563" stroke-width="14" stroke-dasharray="4 9.08" > <animateTransform attributeName="transform" type="rotate" dur="2s" values="0 200 200; -360 200 200" repeatCount="indefinite" /> </circle> <circle fill="none" cx="200" cy="200" r="25" stroke="#FF6900" stroke-width="12" stroke-dasharray="4 9.08" > <animateTransform attributeName="transform" type="rotate" dur="2s" values="0 200 200; 360 200 200" repeatCount="indefinite" /> </circle> </svg> </div>