How to downward a svg element? - html

I'm working on a project and currently I meet a problem.
Here is my markup:
<a href="#">Here is a link icon.
<svg width='14' height='14' viewBox='0 0 14 14' fill='none' xmlns='http://www.w3.org/2000/svg'>
<path d='M12.2068 1.79276C10.2975 -0.116585 7.2018 -0.116585 5.29246 1.79276L4.64288 2.44234C4.25236 2.83286 4.25236 3.46603 4.64288 3.85655C5.03341 4.24707 5.66657 4.24707 6.0571 3.85655L6.70667 3.20698C7.83497 2.07868 9.6643 2.07868 10.7926 3.20698C11.9209 4.33528 11.9209 6.16461 10.7926 7.29291L10.1425 7.94304C9.75195 8.33357 9.75194 8.96673 10.1425 9.35726C10.533 9.74778 11.1662 9.74778 11.5567 9.35726L12.2068 8.70712C14.1162 6.79778 14.1162 3.70211 12.2068 1.79276Z' fill='#076aff'/>
<path d='M3.85726 6.05638C4.24779 5.66586 4.24779 5.03269 3.85726 4.64217C3.46674 4.25165 2.83357 4.25165 2.44305 4.64217L1.79236 5.29286C-0.116985 7.2022 -0.116985 10.2979 1.79236 12.2072C3.70171 14.1166 6.79738 14.1166 8.70672 12.2072L9.35713 11.5568C9.74765 11.1663 9.74765 10.5331 9.35713 10.1426C8.9666 9.75207 8.33344 9.75207 7.94291 10.1426L7.29251 10.793C6.16421 11.9213 4.33488 11.9213 3.20658 10.793C2.07828 9.6647 2.07828 7.83537 3.20658 6.70707L3.85726 6.05638Z' fill='#076aff'/>
<path d='M8.20674 7.2071C8.59727 6.81658 8.59727 6.18341 8.20674 5.79289C7.81622 5.40237 7.18305 5.40237 6.79253 5.79289L5.73187 6.85355C5.34134 7.24408 5.34134 7.87724 5.73187 8.26776C6.12239 8.65829 6.75556 8.65829 7.14608 8.26776L8.20674 7.2071Z' fill='#076aff'/>
</svg>
</a>
The problem is the svg icon is a little bit higher than I expected, so I want to downward the svg downward 2 to 3 px without changing its size but change the svg`s position. How could I achieve it?

Try using flex. In this case you can omit using position: absolute; but can align your elements in this block.
.custom-link {
display: inline-flex;
align-items: center; /* align content vertically */
column-gap: 0.25rem; /* add gap between content items */
}
<p>Before using flex:</p>
<a href="#">Here is a link icon.
<svg width='14' height='14' viewBox='0 0 14 14' fill='none' xmlns='http://www.w3.org/2000/svg'>
<path d='M12.2068 1.79276C10.2975 -0.116585 7.2018 -0.116585 5.29246 1.79276L4.64288 2.44234C4.25236 2.83286 4.25236 3.46603 4.64288 3.85655C5.03341 4.24707 5.66657 4.24707 6.0571 3.85655L6.70667 3.20698C7.83497 2.07868 9.6643 2.07868 10.7926 3.20698C11.9209 4.33528 11.9209 6.16461 10.7926 7.29291L10.1425 7.94304C9.75195 8.33357 9.75194 8.96673 10.1425 9.35726C10.533 9.74778 11.1662 9.74778 11.5567 9.35726L12.2068 8.70712C14.1162 6.79778 14.1162 3.70211 12.2068 1.79276Z' fill='#076aff'/>
<path d='M3.85726 6.05638C4.24779 5.66586 4.24779 5.03269 3.85726 4.64217C3.46674 4.25165 2.83357 4.25165 2.44305 4.64217L1.79236 5.29286C-0.116985 7.2022 -0.116985 10.2979 1.79236 12.2072C3.70171 14.1166 6.79738 14.1166 8.70672 12.2072L9.35713 11.5568C9.74765 11.1663 9.74765 10.5331 9.35713 10.1426C8.9666 9.75207 8.33344 9.75207 7.94291 10.1426L7.29251 10.793C6.16421 11.9213 4.33488 11.9213 3.20658 10.793C2.07828 9.6647 2.07828 7.83537 3.20658 6.70707L3.85726 6.05638Z' fill='#076aff'/>
<path d='M8.20674 7.2071C8.59727 6.81658 8.59727 6.18341 8.20674 5.79289C7.81622 5.40237 7.18305 5.40237 6.79253 5.79289L5.73187 6.85355C5.34134 7.24408 5.34134 7.87724 5.73187 8.26776C6.12239 8.65829 6.75556 8.65829 7.14608 8.26776L8.20674 7.2071Z' fill='#076aff'/>
</svg>
</a>
<p>With using flex:</p>
<a class="custom-link" href="#">Here is a link icon.
<svg width='14' height='14' viewBox='0 0 14 14' fill='none' xmlns='http://www.w3.org/2000/svg'>
<path d='M12.2068 1.79276C10.2975 -0.116585 7.2018 -0.116585 5.29246 1.79276L4.64288 2.44234C4.25236 2.83286 4.25236 3.46603 4.64288 3.85655C5.03341 4.24707 5.66657 4.24707 6.0571 3.85655L6.70667 3.20698C7.83497 2.07868 9.6643 2.07868 10.7926 3.20698C11.9209 4.33528 11.9209 6.16461 10.7926 7.29291L10.1425 7.94304C9.75195 8.33357 9.75194 8.96673 10.1425 9.35726C10.533 9.74778 11.1662 9.74778 11.5567 9.35726L12.2068 8.70712C14.1162 6.79778 14.1162 3.70211 12.2068 1.79276Z' fill='#076aff'/>
<path d='M3.85726 6.05638C4.24779 5.66586 4.24779 5.03269 3.85726 4.64217C3.46674 4.25165 2.83357 4.25165 2.44305 4.64217L1.79236 5.29286C-0.116985 7.2022 -0.116985 10.2979 1.79236 12.2072C3.70171 14.1166 6.79738 14.1166 8.70672 12.2072L9.35713 11.5568C9.74765 11.1663 9.74765 10.5331 9.35713 10.1426C8.9666 9.75207 8.33344 9.75207 7.94291 10.1426L7.29251 10.793C6.16421 11.9213 4.33488 11.9213 3.20658 10.793C2.07828 9.6647 2.07828 7.83537 3.20658 6.70707L3.85726 6.05638Z' fill='#076aff'/>
<path d='M8.20674 7.2071C8.59727 6.81658 8.59727 6.18341 8.20674 5.79289C7.81622 5.40237 7.18305 5.40237 6.79253 5.79289L5.73187 6.85355C5.34134 7.24408 5.34134 7.87724 5.73187 8.26776C6.12239 8.65829 6.75556 8.65829 7.14608 8.26776L8.20674 7.2071Z' fill='#076aff'/>
</svg>
</a>

use the svg code for downward arrow , if you want to color change svg code path , using atter (fill) and (width).
<div class="down-arrow">
<svg xmlns="http://www.w3.org/2000/svg" fill="#000" width="30" viewBox="0 0 384 512"><path d="M374.6 310.6l-160 160C208.4 476.9 200.2 480 192 480s-16.38-3.125-22.62-9.375l-160-160c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0L160 370.8V64c0-17.69 14.33-31.1 31.1-31.1S224 46.31 224 64v306.8l105.4-105.4c12.5-12.5 32.75-12.5 45.25 0S387.1 298.1 374.6 310.6z"/></svg>
</div>
other arrow down ::
<svg xmlns="http://www.w3.org/2000/svg" fill="#000" width="25" viewBox="0 0 384 512"><path d="M192 384c-8.188 0-16.38-3.125-22.62-9.375l-160-160c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0L192 306.8l137.4-137.4c12.5-12.5 32.75-12.5 45.25 0s12.5 32.75 0 45.25l-160 160C208.4 380.9 200.2 384 192 384z"/></svg>

position:relative and a negative y-offset via bottom:-0.1em should work just fine.
.svg-inline{
display:inline-block;
position:relative;
/* add a baseline y offset */
bottom:-0.1em;
/* adjust size if needed */
font-size:0.85em;
/* icon will scale along with the parent's font-size */
height: 1em;
margin-left:0.2em;
}
In contrast to vertical-align:-0.1em bottom:-0.1emyou won't introduce any additional bottom margins, since it#s relatively positioned.
Since you want your svg icon to behave similar to an icon-font character/glyph I also recommend these optimizations:
remove width and height attributes but keep your viewBox you can instead scale you icon relative to your link's font-size
wrap your icon in a symbol element
remove path related fill attributes and add fill="currentColor" to your symbol – this way you can easily style your icons color via css
<svg class="iconAsset" style="display:none" viewBox="0 0 14 14" xmlns="http://www.w3.org/2000/svg" >
<symbol id="icon-link" viewBox="0 0 14 14" fill="currentColor">
<path d="M12.2 1.8c-1.9-1.9-5-1.9-6.9 0l-0.7 0.6c-0.4 0.4-0.4 1.1 0 1.5c0.4 0.4 1.1 0.4 1.5 0l0.6-0.7c1.1-1.1 3-1.1 4.1 0c1.1 1.1 1.1 3 0 4.1l-0.7 0.7c-0.4 0.3-0.4 1 0 1.4c0.4 0.4 1.1 0.4 1.4 0l0.7-0.7c1.9-1.9 1.9-5 0-6.9z M3.9 6.1c0.4-0.4 0.4-1 0-1.4c-0.4-0.4-1-0.4-1.4 0l-0.7 0.6c-1.9 1.9-1.9 5 0 7c1.9 1.9 5 1.9 6.9 0l0.7-0.7c0.4-0.4 0.4-1 0-1.4c-0.4-0.4-1-0.4-1.4 0l-0.7 0.6c-1.1 1.2-2.9 1.2-4.1 0c-1.1-1.1-1.1-2.9 0-4l0.7-0.7z M8.2 7.2c0.4-0.4 0.4-1 0-1.4c-0.4-0.4-1-0.4-1.4 0l-1.1 1c-0.4 0.4-0.4 1.1 0 1.5c0.4 0.4 1 0.4 1.4 0l1.1-1.1z" />
</symbol>
</svg>
Example 1: responsive inlined Icon
a{
word-break: break-all;
}
.custom-link{
display:inline-block;
}
.svg-inline{
display:inline-block;
position:relative;
/* add a baseline y offset */
bottom:-0.1em;
/* adjust size if needed */
font-size:0.85em;
/* icon will scale along with the parent's font-size */
height: 1em;
color: #076aff;
margin-left:0.2em;
}
/** not recommended: will introduce bottom margins **/
.svg-inline-vertical-align{
position:static;
vertical-align:-0.75em;
}
/** if icon have a square 1/1 aspect ratio **/
.svg-inline-square{
width: 1em;
}
<style>
body{
font-size:2vw;
font-family: 'Segoe UI', sans-serif;
transition:0.3s;
}
a{
text-decoration-color: #076aff;
text-decoration-color: #ccc;
color:inherit;
font-weight:bold;
}
.layout{
width:50vw;
border:1px solid #ccc;
position:relative;
margin: 0 auto;
overflow:auto;
resize: both;
}
</style>
<svg class="iconAsset" style="display:none" viewBox="0 0 14 14" xmlns="http://www.w3.org/2000/svg" >
<symbol id="icon-link" viewBox="0 0 14 14" fill="currentColor">
<path d="M12.2 1.8c-1.9-1.9-5-1.9-6.9 0l-0.7 0.6c-0.4 0.4-0.4 1.1 0 1.5c0.4 0.4 1.1 0.4 1.5 0l0.6-0.7c1.1-1.1 3-1.1 4.1 0c1.1 1.1 1.1 3 0 4.1l-0.7 0.7c-0.4 0.3-0.4 1 0 1.4c0.4 0.4 1.1 0.4 1.4 0l0.7-0.7c1.9-1.9 1.9-5 0-6.9z M3.9 6.1c0.4-0.4 0.4-1 0-1.4c-0.4-0.4-1-0.4-1.4 0l-0.7 0.6c-1.9 1.9-1.9 5 0 7c1.9 1.9 5 1.9 6.9 0l0.7-0.7c0.4-0.4 0.4-1 0-1.4c-0.4-0.4-1-0.4-1.4 0l-0.7 0.6c-1.1 1.2-2.9 1.2-4.1 0c-1.1-1.1-1.1-2.9 0-4l0.7-0.7z M8.2 7.2c0.4-0.4 0.4-1 0-1.4c-0.4-0.4-1-0.4-1.4 0l-1.1 1c-0.4 0.4-0.4 1.1 0 1.5c0.4 0.4 1 0.4 1.4 0l1.1-1.1z" />
</symbol>
</svg>
<div class="layout">
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor.
<a class="custom-link" href="#">
link icon (position:relative)<svg class="svg-inline svg-inline-square" >
<use href="#icon-link" />
</svg>
</a>
Aenean massa. Cum sociis natoque penatibus et
<a class="custom-link" href="#">
link icon (vertical-align)<svg class="svg-inline svg-inline-square svg-inline-vertical-align" >
<use href="#icon-link" />
</svg>
</a>
magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis,
</p>
</div>
Example 2: multiple icons with different sizes
let range = document.querySelector("#range");
range.addEventListener("change", function (e) {
let val = e.currentTarget.value;
document.body.style.fontSize = 1*val+'vw'
});
body{
font-size:2vw;
font-family: 'Segoe UI', sans-serif;
transition:0.3s;
}
a{
text-decoration-color: #076aff;
text-decoration-color: #ccc;
color:inherit;
font-weight:bold;
}
.layout{
width:50vw;
border:1px solid #ccc;
position:relative;
margin: 0 auto;
overflow:auto;
resize: both;
}
.custom-link{
display:inline-block;
}
.svg-inline{
display:inline-block;
font-size:0.85em;
height: 1em;
position:relative;
bottom:-0.1em;
color: #076aff;
margin-left:0.2em;
}
.svg-inline-square{
width: 1em;
}
<p style="text-align:center; font-size:12px;">Font size:<input type="range" value="2" id="range" min="1" max="2" step="0.1"></p>
<svg class="iconAsset" style="display:none" viewBox="0 0 14 14" xmlns="http://www.w3.org/2000/svg" >
<symbol id="icon-link" viewBox="0 0 14 14" fill="currentColor">
<path d="M12.2 1.8c-1.9-1.9-5-1.9-6.9 0l-0.7 0.6c-0.4 0.4-0.4 1.1 0 1.5c0.4 0.4 1.1 0.4 1.5 0l0.6-0.7c1.1-1.1 3-1.1 4.1 0c1.1 1.1 1.1 3 0 4.1l-0.7 0.7c-0.4 0.3-0.4 1 0 1.4c0.4 0.4 1.1 0.4 1.4 0l0.7-0.7c1.9-1.9 1.9-5 0-6.9z M3.9 6.1c0.4-0.4 0.4-1 0-1.4c-0.4-0.4-1-0.4-1.4 0l-0.7 0.6c-1.9 1.9-1.9 5 0 7c1.9 1.9 5 1.9 6.9 0l0.7-0.7c0.4-0.4 0.4-1 0-1.4c-0.4-0.4-1-0.4-1.4 0l-0.7 0.6c-1.1 1.2-2.9 1.2-4.1 0c-1.1-1.1-1.1-2.9 0-4l0.7-0.7z M8.2 7.2c0.4-0.4 0.4-1 0-1.4c-0.4-0.4-1-0.4-1.4 0l-1.1 1c-0.4 0.4-0.4 1.1 0 1.5c0.4 0.4 1 0.4 1.4 0l1.1-1.1z" />
</symbol>
<symbol id="icon-comments" viewBox="0 0 640 512" fill="currentColor">
<path d="M208 0C322.9 0 416 78.8 416 176C416 273.2 322.9 352 208 352C189.3 352 171.2 349.7 153.9 345.8C123.3 364.8 79.13 384 24.95 384C14.97 384 5.93 378.1 2.018 368.9C-1.896 359.7-.0074 349.1 6.739 341.9C7.26 341.5 29.38 317.4 45.73 285.9C17.18 255.8 0 217.6 0 176C0 78.8 93.13 0 208 0zM164.6 298.1C179.2 302.3 193.8 304 208 304C296.2 304 368 246.6 368 176C368 105.4 296.2 48 208 48C119.8 48 48 105.4 48 176C48 211.2 65.71 237.2 80.57 252.9L104.1 277.8L88.31 308.1C84.74 314.1 80.73 321.9 76.55 328.5C94.26 323.4 111.7 315.5 128.7 304.1L145.4 294.6L164.6 298.1zM441.6 128.2C552 132.4 640 209.5 640 304C640 345.6 622.8 383.8 594.3 413.9C610.6 445.4 632.7 469.5 633.3 469.9C640 477.1 641.9 487.7 637.1 496.9C634.1 506.1 625 512 615 512C560.9 512 516.7 492.8 486.1 473.8C468.8 477.7 450.7 480 432 480C350 480 279.1 439.8 245.2 381.5C262.5 379.2 279.1 375.3 294.9 369.9C322.9 407.1 373.9 432 432 432C446.2 432 460.8 430.3 475.4 426.1L494.6 422.6L511.3 432.1C528.3 443.5 545.7 451.4 563.5 456.5C559.3 449.9 555.3 442.1 551.7 436.1L535.9 405.8L559.4 380.9C574.3 365.3 592 339.2 592 304C592 237.7 528.7 183.1 447.1 176.6L448 176C448 159.5 445.8 143.5 441.6 128.2H441.6z" />
</symbol>
</svg>
<div class="layout">
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor.
<a class="custom-link" href="#">
link icon<svg class="svg-inline svg-inline-square" >
<use href="#icon-link" />
</svg>
</a>
Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis,
<a class="custom-link" href="#">link icon<svg class="svg-inline" viewBox="0 0 640 512" style="font-size:0.95em">
<use href="#icon-comments" />
</svg>
</a>
ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate</p>
</div>
<p style="text-align:center; font-size:12px;">resize</p>

Related

Icon display with different color on Iphone and on other devices

i have a problem with some icon color displaying on Iphone.
Here the html code :
<button type="submit" aria-label="Start Searching">
<i className={`icon-search`} aria-hidden="true" />
</button>
Here the svg of the icon :
<!-- Generated by IcoMoon.io -->
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="1024" height="1024" viewBox="0 0 1024 1024">
<title>Search</title>
<g id="icomoon-ignore">
</g>
<path fill="#666" d="M637.117 637.117c81.229-81.229 81.229-212.928 0-294.157s-212.928-81.228-294.157 0c-81.228 81.229-81.228 212.928 0 294.157s212.928 81.229 294.157 0zM653.322 687.229c-100.573 83.475-250.045 78.086-344.302-16.17-99.974-99.974-99.974-262.067 0-362.040 99.975-99.974 262.065-99.974 362.039 0 94.256 94.258 99.648 243.73 16.17 344.302 0.272 0.25 0.538 0.502 0.8 0.765l90.509 90.512c9.373 9.373 9.373 24.566 0 33.939s-24.566 9.373-33.939 0l-90.512-90.509c-0.262-0.262-0.515-0.531-0.765-0.8z"></path>
</svg>
The icon color is correctly displayed ( that to say dark gray ) on Android or any desktop ( including Safari ) but he is fully white on Iphone ( Iphone 8, IOS 15.1 )
Does any one have a solution ?
I was investigating and version feature is deprecated in some browsers, maybe can be that:
See the compatibility table:
Extracted from: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/version#browser_compatibility
I recommend you to use and icon from: https://fontawesome.com/v5.15/icons?d=gallery&p=2
As #A Haworth pointed out: it might be ralated to some css rule in your global css.
Browser specific default styles
Since your icon already contains a hard coded fill attribute, my suspicion is your icon is colored white due to a safari default button style.
You could try to disable default button styling by applying an appearance: none rule.
button {
font-size: 2em;
display: block;
width: 100%;
}
button svg {
display: inline-block;
height: 1em;
}
.btn-default {
appearance: none;
background: #fff;
border: 1px solid #000;
}
.btn-default-use {
color: #666;
}
button svg {
display: inline-block;
width: 1em;
}
.svgAssetHiddden {
position: absolute;
width: 0;
height: 0;
overflow: hidden;
}
<p>button</p>
<button type="submit" aria-label="Start Searching">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="1024" height="1024" viewBox="0 0 1024 1024">
<title>Search</title>
<path fill="#666" d="M637.117 637.117c81.229-81.229 81.229-212.928 0-294.157s-212.928-81.228-294.157 0c-81.228 81.229-81.228 212.928 0 294.157s212.928 81.229 294.157 0zM653.322 687.229c-100.573 83.475-250.045 78.086-344.302-16.17-99.974-99.974-99.974-262.067 0-362.040 99.975-99.974 262.065-99.974 362.039 0 94.256 94.258 99.648 243.73 16.17 344.302 0.272 0.25 0.538 0.502 0.8 0.765l90.509 90.512c9.373 9.373 9.373 24.566 0 33.939s-24.566 9.373-33.939 0l-90.512-90.509c-0.262-0.262-0.515-0.531-0.765-0.8z"></path>
</svg>
</button>
<p>button appearance none</p>
<button class="btn-default" type="submit" aria-label="Start Searching">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="1024" height="1024" viewBox="0 0 1024 1024">
<title>Search</title>
<path fill="#666" d="M637.117 637.117c81.229-81.229 81.229-212.928 0-294.157s-212.928-81.228-294.157 0c-81.228 81.229-81.228 212.928 0 294.157s212.928 81.229 294.157 0zM653.322 687.229c-100.573 83.475-250.045 78.086-344.302-16.17-99.974-99.974-99.974-262.067 0-362.040 99.975-99.974 262.065-99.974 362.039 0 94.256 94.258 99.648 243.73 16.17 344.302 0.272 0.25 0.538 0.502 0.8 0.765l90.509 90.512c9.373 9.373 9.373 24.566 0 33.939s-24.566 9.373-33.939 0l-90.512-90.509c-0.262-0.262-0.515-0.531-0.765-0.8z"></path>
</svg>
</button>
<p>button use</p>
<button class="btn-default btn-default-use" type="submit" aria-label="Start Searching">
<svg viewBox="0 0 1024 1024">
<use href="#searchIcon" />
</svg>
</button>
<svg class="svgAssetHiddden" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" aria-hidden="true">
<symbol id="searchIcon" fill="currentColor">
<path d="M637.117 637.117c81.229-81.229 81.229-212.928 0-294.157s-212.928-81.228-294.157 0c-81.228 81.229-81.228 212.928 0 294.157s212.928 81.229 294.157 0zM653.322 687.229c-100.573 83.475-250.045 78.086-344.302-16.17-99.974-99.974-99.974-262.067 0-362.040 99.975-99.974 262.065-99.974 362.039 0 94.256 94.258 99.648 243.73 16.17 344.302 0.272 0.25 0.538 0.502 0.8 0.765l90.509 90.512c9.373 9.373 9.373 24.566 0 33.939s-24.566 9.373-33.939 0l-90.512-90.509c-0.262-0.262-0.515-0.531-0.765-0.8z" />
</symbol>
</svg>
Eventually, it might also be related to a Dark mode setting overriding your original fill to ensure a sufficient contrast.

On scroll transform the element from bottom to center of the screen and remains center until the section's bottom touch the viewport's bottom

I want to animate a element on scroll which is already tranlateY to 400% using CSS, now when the user scroll to that section it will come's up on 10% of scroll and when it's reached to the center of page it remains center until the section has completed scrolled.
In this fiddle you can see the svg image code but it's not working properly i want both circle and svg animation at the same time i have commented the fiddle url
$(window).scroll(function() {
inViewport();
});
$(window).resize(function() {
inViewport();
});
function getCurrentScroll() {
return window.pageYOffset - $('section.section2').offset().top;
};
function inViewport() {
$('section.section2').each(function() {
var divPos = $(this).offset().top;
var divHeight = $(this).height() * 1.4;
var topOfWindow = $(window).scrollTop();
if (divPos < topOfWindow + 50) {
var scrolls = getCurrentScroll() / 4;
$(this).find('.circle').css('width',scrolls+'%');
$(this).find('.circle').css('height',scrolls*2+'%');
$(this).find('.img-box').css('transform','translateY('+(topOfWindow / (15))+'%)');
}
if (divPos + 100 < topOfWindow ) {
$(this).find('.desc').css('transform','translateY('+(-topOfWindow / (10))+'%)');
$(this).find('.img-box').css('transform','translateY('+(topOfWindow / (10))+'%)');
}
});
}
section.section1{
height:500px;
width:100%
}
section.section2 {
padding: 150px 0;
position: relative;
height: 170vh;
overflow: hidden;
}
section.section2 .circle{
position: fixed;
height: 0%;
width: 0%;
left: -50%;
top: 0;
bottom: 0;
right: -50%;
margin:auto;
background:#000;
border-radius: 100%;
transition:ease all 0.25s;
margin:auto;
z-index:-1
}
section.section2 .desc p {
max-width: 50%;
margin: auto;
font-size: 16px;
font-family: arial,sans-serif;
color: rgb(70, 70, 70);
line-height: 1.563;
text-align: center;
}
section.section2 .desc{
transition: ease all 0.25s;
}
section.section2 .img-box {
text-align: center;
margin-top: 50px;
margin-bottom: -110px;
transition: ease all 0.25s;
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
margin: auto;
display: flex;
justify-content: center;
align-items: center;
transform:translateY(400%);
}
section.section2 .img-box svg {
width: 100px;
display: block;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<section class="section1">
</section>
<section class="section2">
<div class="container">
<div class="desc">
<p>This is dummy copy. It is not meant to be read. It has been placed here solely to demonstrate the look and feel of finished, typeset text. Only for show. He who searches for meaning here will be sorely disappointed. These words are here to the reader.</p>
</div>
<div class="img-box">
<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 195.8 190" viewBox="0 0 195.8 190">
<path
d="m68.7 111.3v-35h3.5l16.3 29.2v-29.2h2.5v35h-3.5l-16.3-29v29zm40.3-23.9c-.4 1-.9 1.9-1.5 2.7-.6.7-1.4 1.3-2.4 1.8-.9.5-1.9.7-2.9.7s-2.1-.2-2.9-.7-1.8-1.2-2.3-1.8c-.7-.9-1.2-1.8-1.6-2.7-.4-1.1-.6-2.2-.6-3.4s.2-2.3.6-3.4c.4-.9.9-1.8 1.6-2.7.5-.8 1.4-1.4 2.3-1.8.9-.5 1.9-.6 2.9-.6 1.1 0 2.1.2 2.9.6.9.5 1.8 1.1 2.4 1.8.6.8 1.2 1.7 1.5 2.7.4 1.1.6 2.2.6 3.4s-.2 2.3-.6 3.4zm-13.4 12.9v-2.8h13.4v2.8zm2.2-16.3c0 2 .4 3.4 1.2 4.4.9 1 1.9 1.5 3.2 1.5s2.4-.5 3.2-1.6c.8-1 1.2-2.5 1.2-4.5s-.4-3.5-1.2-4.5c-.8-1.1-1.9-1.6-3.2-1.6s-2.4.5-3.1 1.5c-.8 1-1.2 2.5-1.2 4.4z"
fill="#fff" />
<path d="m123.7 76.3v35h-3.8v-30.3c-2 1.8-4.3 3.6-6.2 5.3l-1.1-2.1 8.7-7.8z" fill="#fff" />
<g fill="none" stroke="#fff" stroke-miterlimit="10">
<path d="m0 85.8h36.3" />
<path d="m0 102.9h36.3" />
<path d="m159.5 85.8h36.3" />
<path d="m159.5 102.9h36.3" />
</g>
<g fill="#fff">
<path d="m162.8 96.6h1.6v-4.5c0-.2 0-.4 0-.4s-.1.2-.3.4l-.7.6-.6-.6 1.7-1.6h.9v6.2h1.5v.9h-4.1z" />
<path
d="m170.3 96.5c.2.1.6.2 1 .2 1.3 0 2-1.2 2.1-2.4-.3.4-.9.7-1.6.7-1.3 0-2.2-1-2.2-2.3 0-1.4.9-2.4 2.3-2.4 1.5 0 2.6 1.3 2.6 3.3 0 1.8-1 4-3.2 4-.5 0-.9-.1-1.4-.3zm3.2-3.3c0-.9-.7-1.9-1.6-1.9-.8 0-1.3.6-1.3 1.4 0 .9.5 1.5 1.4 1.5s1.5-.5 1.5-1z" />
<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4 1.2 2.5 2.9 2.8 4.9l-2.2.6c-.1-1.2-.9-2.6-1.9-3.5-2.4-2.1-5.1-1.6-6.9.4-2 2.3-1.8 5.2.2 7 1 .9 2.3 1.3 3.6 1.3l1.1-1.2-1.6-1.4 1.5-1.7 3.4 3-5 5.6-1.6-1.5.5-.5c.2-.2.4-.4.4-.4-1.3.1-2.9-.5-4.1-1.6-2.8-2.5-3.3-6.8-.3-10.1 2.5-3.4 6.9-3.7 10.1-.9z" />
<path
d="m164.2 41.6 3.7-8.8 1.8 2.3-2 4.3c-.4.9-1 1.8-1 1.8s1.1-.3 2-.5l4.7-.8 1.8 2.3-9.4 1.2-4.7 3.6-1.6-2z" />
</g>
</svg>
</div>
<div class="circle">
</div>
</div>
</section>

CSS Grid: collapse width of just 1 column

I have a grid with 3 columns: I need the first 1 column to always take the smallest amount of space possible, so the second column is tight with the text. I also need to cover a situation where the text of the first column can be huge:
Here I want the CSS to be exactly as is, since it's perfect. The CSS is really simple:
.container {
display: grid;
}
.children {
grid-row: 1;
}
How can I achieve the desired result with css grid?
Codepen link for minimal case: https://codepen.io/ilia-reingold/pen/RwrdELR
Update: adding code ->
.margin-top {
margin-top: 1rem;
}
.row {
display: flex;
flex-direction: row;
flex: 1;
align-items: center;
}
.title-container {
display: grid;
// grid-template-columns: auto 10% 10%;
}
.title {
grid-row: 1;
font-family: Poppins;
font-style: normal;
font-weight: 600;
font-size: 24px;
line-height: 36px;
color: #000000;
}
.container {
grid-row: 1;
}
.buttons {
grid-row: 1;
}
.description {
font-family: Rubik;
font-style: normal;
font-weight: normal;
font-size: 16px;
line-height: 19px;
color: #404A56;
}
.end {
justify-content: flex-end;
}
.container {
display: flex;
-webkit-box-orient: horizontal;
-webkit-box-direction: normal;
-ms-flex-direction: row;
flex-direction: row;
margin: 0 0.5rem;
align-items: center;
}
<div data-v-31045a46="" class="pagetop row margin-top">
<div data-v-31045a46="" class="title-container row">
<div data-v-31045a46="" class="text-ellipsis title"> Hardik's Favourite </div>
<div data-v-52c45aaf="" data-v-31045a46="" class="container">
<div data-v-52c45aaf="" class="status-button read-only">
<svg data-v-52c45aaf="" width="16" height="22" viewBox="0 0 16 22" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M13 7.5H14C15.1 7.5 16 8.4 16 9.5V19.5C16 20.6 15.1 21.5 14 21.5H2C0.9 21.5 0 20.6 0 19.5V9.5C0 8.4 0.9 7.5 2 7.5H3V5.5C3 2.74 5.24 0.5 8 0.5C10.76 0.5 13 2.74 13 5.5V7.5ZM8 2.5C6.34 2.5 5 3.84 5 5.5V7.5H11V5.5C11 3.84 9.66 2.5 8 2.5ZM2 19.5V9.5H14V19.5H2ZM10 14.5C10 15.6 9.1 16.5 8 16.5C6.9 16.5 6 15.6 6 14.5C6 13.4 6.9 12.5 8 12.5C9.1 12.5 10 13.4 10 14.5Z" fill="black" fill-opacity="0.54"></path>
</svg>
<span data-v-52c45aaf="">Read-only</span>
</div>
<div data-v-52c45aaf="" class="status-button shared pointer">
<svg data-v-52c45aaf="" width="20" height="14" viewBox="0 0 20 14" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M7 7C8.93 7 10.5 5.43 10.5 3.5C10.5 1.57 8.93 0 7 0C5.07 0 3.5 1.57 3.5 3.5C3.5 5.43 5.07 7 7 7ZM0 12.25C0 9.92 4.66 8.75 7 8.75C9.34 8.75 14 9.92 14 12.25V14H0V12.25ZM7 10.75C5.21 10.75 3.18 11.42 2.34 12H11.66C10.82 11.42 8.79 10.75 7 10.75ZM8.5 3.5C8.5 2.67 7.83 2 7 2C6.17 2 5.5 2.67 5.5 3.5C5.5 4.33 6.17 5 7 5C7.83 5 8.5 4.33 8.5 3.5ZM14.04 8.81C15.2 9.65 16 10.77 16 12.25V14H20V12.25C20 10.23 16.5 9.08 14.04 8.81ZM16.5 3.5C16.5 5.43 14.93 7 13 7C12.46 7 11.96 6.87 11.5 6.65C12.13 5.76 12.5 4.67 12.5 3.5C12.5 2.33 12.13 1.24 11.5 0.35C11.96 0.13 12.46 0 13 0C14.93 0 16.5 1.57 16.5 3.5Z" fill="#6E6F73"></path>
</svg>
<span data-v-52c45aaf="">Shared with team</span>
</div>
</div>
<div data-v-31045a46="" class="buttons row end">
<button data-v-5ea9ad22="" data-v-31045a46="" data-testid="button" class="button">
<div data-v-5ea9ad22="" class="centered">
<svg data-v-31045a46="" width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-5ea9ad22="">
<rect x="7" y="7" width="14" height="14" rx="2" stroke="black" stroke-width="2"></rect>
<path fill-rule="evenodd" clip-rule="evenodd" d="M3 2H13C13.5523 2 14 2.44772 14 3V6H16V3C16 1.34315 14.6569 0 13 0H3C1.34315 0 0 1.34315 0 3V13C0 14.6569 1.34315 16 3 16H6V14H3C2.44772 14 2 13.5523 2 13V3C2 2.44772 2.44772 2 3 2Z" fill="black"></path>
</svg>
<span data-v-5ea9ad22=""> Copy </span>
</div>
</button>
<button data-v-5ea9ad22="" data-v-31045a46="" data-testid="button" class="disabled button">
<div data-v-5ea9ad22="" class="centered">
<svg data-v-31045a46="" width="14" height="12" viewBox="0 0 14 12" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-5ea9ad22="">
<path d="M13.7728 4.22774L8.96019 0.15672C8.53894 -0.199663 7.875 0.0896491 7.875 0.643255V2.78753C3.4828 2.83679 0 3.6991 0 7.77658C0 9.42231 1.08229 11.0527 2.27864 11.9051C2.65196 12.1711 3.18402 11.8373 3.04637 11.4061C1.80649 7.52179 3.63445 6.4906 7.875 6.43084V8.7857C7.875 9.34016 8.53946 9.62819 8.96019 9.27223L13.7728 5.20081C14.0755 4.94469 14.0759 4.48421 13.7728 4.22774Z" fill="#8d8f93"></path>
</svg>
<span data-v-5ea9ad22=""> Share </span>
</div>
</button>
<div data-v-31045a46="" role="listbox" tabindex="0" class="ui dropdown dropdown icon disabled-grey-btn" compact="compact">
<i aria-hidden="true" class="ellipsis horizontal icon"></i><span class="sizer"></span>
<div tabindex="-1" class="menu transition"></div>
</div>
</div>
</div>
</div>
You can achieve that by using grid-template-columns property.
.container {
display: grid;
grid-template-columns:20% 40% 40%; //It's just a hit, try on your own
}
You can add this to your CSS
.text-ellipsis {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
Result:

How can I change the color of the check mark in this svg?

1) Is there a way to change the color of the checkmark in this svg?
2) Why is fill:rgb(71,131,48); working but fill:#478530; not?
3) If I want to create other symbols inside of the cloud, are there any tools out there to do that?
.icon {
background: url('data:image/svg+xml;utf8,<svg id="icon-cloud-check" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"><path style="fill:rgb(71,131,48);" d="M27.883 16.078c0.076-0.347 0.117-0.708 0.117-1.078 0-2.761-2.239-5-5-5-0.445 0-0.875 0.058-1.285 0.167-0.775-2.417-3.040-4.167-5.715-4.167-2.73 0-5.033 1.823-5.76 4.318-0.711-0.207-1.462-0.318-2.24-0.318-4.418 0-8 3.582-8 8s3.582 8 8 8h19c2.761 0 5-2.239 5-5 0-2.46-1.777-4.505-4.117-4.922zM13 24l-5-5 2-2 3 3 7-7 2 2-9 9z"></path></svg>') no-repeat;
}
<svg class="icon"></svg>
And idea is to use another background as a bottom layer:
.icon {
background:
url('data:image/svg+xml;utf8,<svg id="icon-cloud-check" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"><path style="fill:rgb(71,131,48);" d="M27.883 16.078c0.076-0.347 0.117-0.708 0.117-1.078 0-2.761-2.239-5-5-5-0.445 0-0.875 0.058-1.285 0.167-0.775-2.417-3.040-4.167-5.715-4.167-2.73 0-5.033 1.823-5.76 4.318-0.711-0.207-1.462-0.318-2.24-0.318-4.418 0-8 3.582-8 8s3.582 8 8 8h19c2.761 0 5-2.239 5-5 0-2.46-1.777-4.505-4.117-4.922zM13 24l-5-5 2-2 3 3 7-7 2 2-9 9z"></path></svg>') no-repeat,
linear-gradient(red,red)50% 60%/50% 40% no-repeat;
display:inline-block;
width:150px;
height:150px;
}
<svg class="icon"></svg>
<svg class="icon" style="width:100px;height:100px;"></svg>
You need to url encode the # symbol
Use fill: %23478530
.icon {
background: url('data:image/svg+xml;utf8,<svg id="icon-cloud-check" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"><path style="fill:%23478530;" d="M27.883 16.078c0.076-0.347 0.117-0.708 0.117-1.078 0-2.761-2.239-5-5-5-0.445 0-0.875 0.058-1.285 0.167-0.775-2.417-3.040-4.167-5.715-4.167-2.73 0-5.033 1.823-5.76 4.318-0.711-0.207-1.462-0.318-2.24-0.318-4.418 0-8 3.582-8 8s3.582 8 8 8h19c2.761 0 5-2.239 5-5 0-2.46-1.777-4.505-4.117-4.922zM13 24l-5-5 2-2 3 3 7-7 2 2-9 9z"></path></svg>') no-repeat;
}
<svg class="icon"></svg>

SVG logo doesn't look good in Bootstrap navbar

Designer has sent me a new logo as a SVG.
I want to use it inline in my HTML but I could not get it to display without setting min-width.
However now I am using min-width to get logo to desired size, the bottom of the logo is lower than the bottom of the navbar.
How do I get the SVG to use more space above the logo, and less space under, so that the logo is neatly positioned within the navbar and looks good?
Code
.navbar-brand {
min-width: 250px;
}
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/">
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Creator: CorelDRAW X6 -->
<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" version="1.1" style="shape-rendering:geometricPrecision; text-rendering:geometricPrecision; image-rendering:optimizeQuality; fill-rule:evenodd; clip-rule:evenodd" viewBox="0 0 7090 1628" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<style type="text/css">
<![CDATA[
.fil1 {fill:#FEFEFE}
.fil3 {fill:#FEFEFE;fill-rule:nonzero}
.fil2 {fill:#033C73;fill-rule:nonzero}
.fil0 {fill:url(#id0)}
]]>
</style>
<linearGradient id="id0" gradientUnits="userSpaceOnUse" x1="800.768" y1="1267.59" x2="932.867" y2="1645.01">
<stop offset="0" style="stop-color:#C5C6C6"/>
<stop offset="0.639216" style="stop-color:#FDFDFD"/>
<stop offset="1" style="stop-color:#FEFEFE"/>
</linearGradient>
</defs>
<g id="Layer_x0020_1">
<metadata id="CorelCorpID_0Corel-Layer"/>
<polygon class="fil0" points="1098,1285 1098,1628 636,1325 "/>
<path class="fil1" d="M1184 96c274,194 275,949 37,1156 -189,164 -846,166 -1038,8 -246,-203 -245,-950 10,-1150 181,-142 805,-146 991,-14z"/>
<path class="fil2" d="M1132 694c2,1 4,3 5,5 57,56 91,134 91,219l0 97 -177 0 0 -97c0,-37 -15,-70 -39,-94 -24,-24 -57,-39 -93,-39l0 -1 -131 0 0 142 0 88 -89 0 -222 0 0 1c-85,0 -163,-35 -219,-92 -57,-56 -92,-134 -92,-219l0 -314 178 0 0 314c0,36 15,69 39,94 24,24 58,39 94,39l0 0 134 0 0 -447 177 0 0 213 131 0 0 -1c36,0 69,-15 93,-39 24,-24 39,-57 39,-94l0 -79 177 0 0 79c0,85 -34,163 -91,219 -1,2 -3,4 -5,6z"/>
<path class="fil3" d="M1990 870c-90,0 -152,-67 -152,-158 0,-92 62,-159 152,-159 72,0 121,43 136,112l140 0c-17,-142 -125,-239 -275,-239 -166,0 -291,120 -291,286 0,165 125,285 291,285 150,0 258,-97 275,-239l-140 0c-15,69 -64,112 -136,112zm843 -433l-136 0 0 220 -224 0 0 -220 -136 0 0 549 136 0 0 -206 224 0 0 206 136 0 0 -549zm459 455l37 94 145 0 -233 -552 -130 0 -233 552 145 0 37 -94 232 0zm-45 -117l-142 0 71 -182 71 182zm640 -216l0 -122 -486 0 0 122 175 0 0 427 137 0 0 -427 174 0zm483 268l118 159 164 0 -141 -186c66,-33 105,-93 105,-170 0,-119 -91,-193 -227,-193l-240 0 0 549 136 0 0 -159 85 0zm-85 -123l0 -147 101 0c53,0 95,29 95,73 0,45 -42,74 -95,74l-101 0zm668 -278c-165,0 -291,126 -291,286 0,159 126,285 291,285 166,0 291,-126 291,-285 0,-160 -125,-286 -291,-286zm0 445c-89,0 -153,-73 -153,-159 0,-87 64,-159 153,-159 89,0 152,72 152,159 0,86 -63,159 -152,159zm639 -445c-165,0 -290,126 -290,286 0,159 125,285 290,285 167,0 292,-126 292,-285 0,-160 -125,-286 -292,-286zm0 445c-88,0 -152,-73 -152,-159 0,-87 64,-159 152,-159 89,0 153,72 153,159 0,86 -64,159 -153,159zm955 -434l-102 0 -194 293 -196 -293 -101 0 0 549 137 0 -1 -277 123 190 0 1 75 0 0 -1 122 -188 0 275 137 0 0 -549zm307 -12c-129,0 -218,69 -218,179 0,87 51,138 159,162l91 20c47,9 58,28 58,47 0,29 -27,48 -78,48 -64,0 -106,-29 -115,-77l-136 0c13,135 124,193 247,193 138,0 228,-68 228,-178 0,-95 -65,-135 -165,-157l-77 -17c-41,-9 -63,-22 -63,-52 0,-36 31,-55 78,-55 56,0 82,28 89,69l137 0c-14,-147 -146,-182 -235,-182z"/>
</g>
</svg>
</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li class="active">Home</li>
</ul>
</div>
</div>
</nav>
.navbar-brand {
width: 35vw;
}
use VW ( viewport width) it is used to resize the image based on window size
Do not use the svg code. I hope the designer has provided you a file with the extension .svg. Use that file as source of image.
<img class="logo" src="your-path/logo.svg" />
Then add you desired width using css.
.logo { width: 150px; }