SVG logo doesn't look good in Bootstrap navbar - html

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; }

Related

How can I stack my hyperlink images on top of each other in HTML/CSS [duplicate]

This question already has answers here:
How to make an inline element appear on new line, or block element not occupy the whole line?
(9 answers)
Links on New Line
(10 answers)
How to line-break 2 anchors
(3 answers)
Move <a> tag to a new line without <br>
(5 answers)
Closed 1 year ago.
It's my first time creating a website and I want to add these images as hyperlinks stacked on top of each other. However, they're stacked horizontally even though I was following a tutorial.
This is my HTML code:
.socials {
padding-bottom: 200px;
padding-right: 16px;
}
.social {
margin: 10px;
}
<div class="socials">
<a href="http://www.linkedin.com" class="social">
<svg xmlns="http://www.w3.org/2000/svg" fill="#ffffff" width="50" height="50" viewBox="0 0 24 24"><path d="M4.98 3.5c0 1.381-1.11 2.5-2.48 2.5s-2.48-1.119-2.48-2.5c0-1.38 1.11-2.5 2.48-2.5s2.48 1.12 2.48 2.5zm.02 4.5h-5v16h5v-16zm7.982 0h-4.968v16h4.969v-8.399c0-4.67 6.029-5.052 6.029 0v8.399h4.988v-10.131c0-7.88-8.922-7.593-11.018-3.714v-2.155z"/></svg> </a>
</a>
<a href="http://www.github.com" class="social">
<svg xmlns="http://www.w3.org/2000/svg" fill="#ffffff" width="50" height="50" viewBox="0 0 24 24"><path d="M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"/></svg>
</a>
<a href="http://www.instagram.com" class="social">
<svg xmlns="http://www.w3.org/2000/svg" fill="#ffffff" width="50" height="50" viewBox="0 0 24 24"><path d="M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zm0-2.163c-3.259 0-3.667.014-4.947.072-4.358.2-6.78 2.618-6.98 6.98-.059 1.281-.073 1.689-.073 4.948 0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98 1.281.058 1.689.072 4.948.072 3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98-1.281-.059-1.69-.073-4.949-.073zm0 5.838c-3.403 0-6.162 2.759-6.162 6.162s2.759 6.163 6.162 6.163 6.162-2.759 6.162-6.163c0-3.403-2.759-6.162-6.162-6.162zm0 10.162c-2.209 0-4-1.79-4-4 0-2.209 1.791-4 4-4s4 1.791 4 4c0 2.21-1.791 4-4 4zm6.406-11.845c-.796 0-1.441.645-1.441 1.44s.645 1.44 1.441 1.44c.795 0 1.439-.645 1.439-1.44s-.644-1.44-1.439-1.44z"/></svg>
</a>
</div>
To demonstrate, I replaced your SVG's with Images. You can use flex-box with flex-direction: column; to have your images stack. Also, for good measures, I positioned it in the center. See below.
.socials {
display: flex;
flex-direction: column;
align-items: center;
}
<div class="socials">
<a href="http://www.linkedin.com" class="social">
<img src="https://dummyimage.com/50/000/fff">
</a>
<a href="http://www.github.com" class="social">
<img src="https://dummyimage.com/50/000/fff">
</a>
<a href="http://www.instagram.com" class="social">
<img src="https://dummyimage.com/50/000/fff">
</a>
</div>
with CSS GRID
css grid automatically puts everything in row mode :)
...few lines and your work is complete!
-or with flex-box it automatically transforms everything into columns, so you need to write an extra CSS property flex-direction
so go for display: grid; I think is the best, simplest solution :)
.socials {
display: grid;
gap: 1rem;
}
.social svg {
fill: blue;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="socials">
<a href="http://www.linkedin.com" class="social">
<svg xmlns="http://www.w3.org/2000/svg" fill="#ffffff" width="50" height="50" viewBox="0 0 24 24"><path d="M4.98 3.5c0 1.381-1.11 2.5-2.48 2.5s-2.48-1.119-2.48-2.5c0-1.38 1.11-2.5 2.48-2.5s2.48 1.12 2.48 2.5zm.02 4.5h-5v16h5v-16zm7.982 0h-4.968v16h4.969v-8.399c0-4.67 6.029-5.052 6.029 0v8.399h4.988v-10.131c0-7.88-8.922-7.593-11.018-3.714v-2.155z"/></svg>
</a>
<a href="http://www.github.com" class="social">
<svg xmlns="http://www.w3.org/2000/svg" fill="#ffffff" width="50" height="50" viewBox="0 0 24 24"><path d="M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"/></svg>
</a>
<a href="http://www.instagram.com" class="social">
<svg xmlns="http://www.w3.org/2000/svg" fill="#ffffff" width="50" height="50" viewBox="0 0 24 24"><path d="M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zm0-2.163c-3.259 0-3.667.014-4.947.072-4.358.2-6.78 2.618-6.98 6.98-.059 1.281-.073 1.689-.073 4.948 0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98 1.281.058 1.689.072 4.948.072 3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98-1.281-.059-1.69-.073-4.949-.073zm0 5.838c-3.403 0-6.162 2.759-6.162 6.162s2.759 6.163 6.162 6.163 6.162-2.759 6.162-6.163c0-3.403-2.759-6.162-6.162-6.162zm0 10.162c-2.209 0-4-1.79-4-4 0-2.209 1.791-4 4-4s4 1.791 4 4c0 2.21-1.791 4-4 4zm6.406-11.845c-.796 0-1.441.645-1.441 1.44s.645 1.44 1.441 1.44c.795 0 1.439-.645 1.439-1.44s-.644-1.44-1.439-1.44z"/></svg>
</a>
</div>
</body>
</html>
if you want to learn more about grid: https://www.freecodecamp.org/learn/responsive-web-design/css-grid/create-your-first-css-grid
this really help me a lot to understand it

How do I center the dots (SVG) with the class .stroke1

This is the needed code
.strokes {
display: flex;
width: 100%;
}
.stroke1 {
position: absolute;
z-index: 1002;
justify-content: center;
text-align: center;
align-items: center;
}
<section class="home" id="home">
<div class="max-width">
<div class="star star1"></div>
<div class="home-content">
<div class="text-1">Hello, my name is</div>
<div class="text-2">Hadi Zouhbi</div>
<div class="text-3">And I'm a <span class="txt-rotate"
data-period="2000"
data-rotate='[ "Developer.", "UX Designer.", " Programmer.", "Full-Stack Dev.", "Marketer" ]'
id="headSpan"></span></div>
Hire Me
</div>
</div>
</section>
</header>
<div class="strokes">
<svg class="stroke1" stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 1024 1024" height="3em" width="3em" xmlns="http://www.w3.org/2000/svg"><path d="M456 231a56 56 0 1 0 112 0 56 56 0 1 0-112 0zm0 280a56 56 0 1 0 112 0 56 56 0 1 0-112 0zm0 280a56 56 0 1 0 112 0 56 56 0 1 0-112 0z"></path></svg>
</div>
I want the stroke to be in the middle of the page but nothing is working , it always stays on the left side , am I doing anything wrong ?
If all you're trying to do is center the <svg> then there were a couple issues with your code. First, justify-content and align-items need to be set on the flex container itself (i.e. the same element that has the display: flex rule applied to it), not its children. Second, anything that is absolutely positioned will override any inherent flex positioning applied to it, so I don't think you want that in this case.
Here's an updated code snippet that addresses the above points and thus centers the dots.
.strokes {
display: flex;
justify-content: center;
text-align: center;
align-items: center;
width: 100%;
}
.stroke1 {
z-index: 1002;
}
<section class="home" id="home">
<div class="max-width">
<div class="star star1"></div>
<div class="home-content">
<div class="text-1">Hello, my name is</div>
<div class="text-2">Hadi Zouhbi</div>
<div class="text-3">And I'm a <span class="txt-rotate"
data-period="2000"
data-rotate='[ "Developer.", "UX Designer.", " Programmer.", "Full-Stack Dev.", "Marketer" ]'
id="headSpan"></span></div>
Hire Me
</div>
</div>
</section>
</header>
<div class="strokes">
<svg class="stroke1" stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 1024 1024" height="3em" width="3em" xmlns="http://www.w3.org/2000/svg"><path d="M456 231a56 56 0 1 0 112 0 56 56 0 1 0-112 0zm0 280a56 56 0 1 0 112 0 56 56 0 1 0-112 0zm0 280a56 56 0 1 0 112 0 56 56 0 1 0-112 0z"></path></svg>
</div>

svg img only loads after text tag(h1/h2/h3/p)?

Context
I'm trying to create a standard navbar using tailwind css framework.
Blocker
Whenever I try to load the svg logo without a h/p tag, in the example below - "Temp", it doesn't load.
body {
background-image: url('https://image.tmdb.org/t/p/original/rAiYTfKGqDCRIIqo664sY9XZIvQ.jpg');
background-size: cover;
}
a {
text-decoration: none;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>MovieApp</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/5.0.0-alpha1/css/bootstrap.min.css">
<link rel="stylesheet" href="../static/css/css.css">
<link href="https://unpkg.com/tailwindcss#^2/dist/tailwind.min.css" rel="stylesheet">
</head>
<body>
<header class="mx-96 flex items-center justify-between">
<div>
<h1>temp</h1>
<a href="#">
<img src="../static/img/tmdb.svg" alt="">
</a>
</div>
<div>
<h1>Temporary text</h1>
</div>
</header>
</body>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap#5.0.2/dist/css/bootstrap.min.css" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
</html>
SVG:
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 407.34 160.81"><defs><style>.cls-1{fill:#01d277}</style></defs><title>PoweredByRectangle_Green</title><path class="cls-1" d="M50.38 102.47h6.94V74.71h8.64v-6.89H41.74v6.89h8.64v27.76zM88.53 102.47h6.94v-34.7h-6.94v13.88H78.14V67.77H71.2v34.7h6.94V88.59h10.39v13.88zM121.25 95.53h-13.02v-6.94h11.12v-6.94h-11.12v-6.94h12.43v-6.94h-19.38v34.7h19.97v-6.94zM157.79 82.54L144.1 67.3h-2.23v35.24h7.03V83.17l8.89 9.32 8.88-9.32-.05 19.37h7.04V67.3h-2.19l-13.68 15.24z"/><path class="cls-1" d="M3309.1 1841.93c-23.88 0-23.88 35.77 0 35.77s23.9-35.77 0-35.77zm0 28.59c-13.88 0-13.88-21.45 0-21.45s13.9 21.45 0 21.45z" transform="translate(-3111.93 -1774.68)"/><path class="cls-1" d="M254.5 67.83h6.94v34.7h-6.94zM274.19 95.6v-6.94h11.13v-6.94h-11.13v-6.94h12.44v-6.95h-19.38v34.71h19.96V95.6h-13.02z"/><path class="cls-1" d="M3429.48 1842.91h-10.34v34.7h10.34c23.1 0 23.1-34.7 0-34.7zm0 27.76h-3.4v-20.82h3.4c13.52 0 13.52 20.82 0 20.82z" transform="translate(-3111.93 -1774.68)"/><path class="cls-1" d="M3472.7 1860.23c2.18-1.5 3.11-4.22 3.2-6.84.15-6.12-3.69-10.53-9.85-10.53h-13.74v34.75H3466a10.32 10.32 0 0 0 10.24-10.44 8.43 8.43 0 0 0-3.54-6.94zm-13.4-10.44h6.17a3.51 3.51 0 0 1 0 7h-6.17v-7zm6.17 20.87h-6.17v-6.94h6.17a3.41 3.41 0 0 1 3.49 3.45 3.45 3.45 0 0 1-3.49 3.5z" transform="translate(-3111.93 -1774.68)"/><path class="cls-1" d="M233.13 86.57L224 67.83h-8.01l16.37 35.44h1.55l16.37-35.44h-8.01l-9.14 18.74z"/><path class="cls-1" d="M3494.78 1920.93c14.6 0 24.48-9.88 24.48-24.48v-97.28c0-14.6-9.88-24.48-24.48-24.48h-358.37c-14.6 0-24.48 9.88-24.48 24.48v136.33l12.56-14.56v-121.77a11.94 11.94 0 0 1 11.92-11.92h358.37a11.94 11.94 0 0 1 11.92 11.92v97.28a11.94 11.94 0 0 1-11.92 11.92H3155l-12.56 12.56-.08-.1z" transform="translate(-3111.93 -1774.68)"/><path class="cls-1" d="M3154.3 1827.53v-15h5.9c5.84 0 5.82 9.26 0 9.26h-2.9v5.73h-3zm5.65-8.65c2 0 2-3.36 0-3.36h-2.65v3.36h2.65zM3176.07 1812.27c10.33 0 10.33 15.47 0 15.47s-10.33-15.47 0-15.47zm0 3.09c-6 0-6 9.28 0 9.28s6.01-9.29 0-9.29zM3193.12 1827.85l-6.15-15.33h3.38l3 7.66 2.94-7.52h.15l2.94 7.52 3-7.66h3.38l-6.13 15.26h-.55l-2.75-6.66-2.73 6.72h-.52zM3209.53 1827.53v-15h7.47v3h-4.51v3h3.95v3h-3.95v3h4.77v3h-7.77zM3229.47 1827.53l-3-5.73H3225v5.73h-3v-15h5.92c5.35 0 5.88 7.54 1.47 8.82l3.49 6.19h-3.4zm-4.47-8.65h2.65c2 0 2-3.36 0-3.36H3225v3.36zM3236.76 1827.53v-15h7.52v3h-4.51v3h3.95v3h-3.95v3h4.77v3h-7.77zM3253.71 1827.53h-4.47v-15h4.47c9.99-.01 9.99 15 0 15zm-1.47-12v9h1.47c5.84 0 5.84-9 0-9h-1.47zM3291.89 1820.77l-5.23-8.25h3.65l3.07 5.17 3.07-5.17h3.67l-5.25 8.25v6.76h-3v-6.76zM3282.58 1820.18a3.68 3.68 0 0 0 1.39-3 4.13 4.13 0 0 0-4.26-4.56h-5.94v15h5.94a4.46 4.46 0 0 0 4.43-4.51 3.65 3.65 0 0 0-1.56-2.93zm-5.79-4.51h2.67a1.52 1.52 0 0 1 0 3h-2.67v-3zm2.67 9h-2.67v-3h2.67a1.47 1.47 0 0 1 1.51 1.49 1.49 1.49 0 0 1-1.52 1.54z" transform="translate(-3111.93 -1774.68)"/></svg>
The problem with this is that you have to consider setting a with and height to the image so that it gets a real displaying space if it is not a child of any other tag like hs or p.

How do i make a modal disappear after button has been clicked?

I need to add a exit button to the top left corner of the modal, also I would like for the modal to disappear after the link has been copied. How would i go about doing this ?
<div>
<svg xmlns="http://www.w3.org/2000/svg" class="h-10 w-100" viewBox="21 21" fill="currentColor">
<path fill-rule="evenodd" d="M12.586 4.586a2 2 0 112.828 2.828l-3 3a2 2 0 01-2.828 0 1 1 0 00-1.414 1.414 4 4 0 005.656 0l3-3a4 4 0 00-5.656-5.656l-1.5 1.5a1 1 0 101.414 1.414l1.5-1.5zm-5 5a2 2 0 012.828 0 1 1 0 101.414-1.414 4 4 0 00-5.656 0l-3 3a4 4 0 105.656 5.656l1.5-1.5a1 1 0 10-1.414-1.414l-1.5 1.5a2 2 0 11-2.828-2.828l3-3z" clip-rule="evenodd" />
<text x='35' y='18' style='fill:#444444' class='text-2xl'>Share Link</text>
</svg>
<br />
<div style="display: flex; flex-direction: row; justify-content: space-between;">
<h1 class="text-left" id='text' style='user-select: all'><%= #vacancy.slug %>
<h2 class="text-right" id='text' style='user-select: all'>
<button onclick= "Copy(document.querySelector('#text').innerText)('#closemodal').click(function() {$('#modalwindow').modal('hide');});">
<svg class="align:right w-30 h-9" fill="none" stroke="currentColor" viewBox="0 0 25 25" xmlns="http://www.w3.org/2000/svg">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 7v8a2 2 0 002 2h6M8 7V5a2 2 0 012-2h4.586a1 1 0 01.707.293l4.414 4.414a1 1 0 01.293.707V15a2 2 0 01-2 2h-2M8 7H6a2 2 0 00-2 2v10a2 2 0 002 2h8a2 2 0 002-2v-2"></path>
</svg>
</button>
</h2>
</h1>
</div>
</div>
<div class="text-center md:text-right mt-4 md:flex md:justify-end"></div>
<script src="//cdn.jsdelivr.net/npm/sweetalert2#11"></script>
<script type='text/javascript'>
function Copy(text) {
var elem = document.createElement('textarea');
elem.value = text;
document.body.appendChild(elem);
elem.select();
document.execCommand('copy');
document.body.removeChild(elem);
Swal.fire({
position: 'center',
icon: 'success',
showConfirmButton: false,
timer: 600
})
}
</script>
</div>
I looked at the site for the library you're using, SweetAlert2 and here is what I found...
To add a close button, add showCloseButton: true to the object passed to Swal.fire()
https://sweetalert2.github.io/#configuration
To close the modal call Swal.close()
https://sweetalert2.github.io/#methods

SVG <image> not showing on iphone

So I'm trying to link an image (rocket.svg) into my svg but when I embed it into my site the svg shows but not the rocket.svg
<svg version="1.1" xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink" style="position:fixed; top:0; left:0; height:100%; width:100%; user-select: none;">
<rect style="fill:#33425B;" width="100%" height="100%" id="background"/>
<!-- Rocket -->
<image xlink:href="rocket.svg" x="15%" y="45%" width="10vw" height="10vw" id="rocket"/>
</svg>
Using vw with your height and width attributes is what is causing the problem, changing it works:
<svg version="1.1" xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink" style="position:fixed; top:0; left:0; height:100%; width:100%; user-select: none;">
<rect style="fill:#33425B;" width="100%" height="100%" id="background"/>
<image x="0" y="0" width="100%" height="100%" xlink:href="https://upload.wikimedia.org/wikipedia/commons/a/a3/NASA_Worm_logo.svg" id="tiger" />
</svg>
Just putting this out there for future folks that have a similar problem. I'm very amateur and was using elementor with wordpress and having problems with my SVGs showing on apple devices. I found the following tool and it fixed my problems!
https://jakearchibald.github.io/svgomg/
the below code could be useful for temporary solution, we included the svg tag directly inside a div element, providing some attributes for the svg element such as width height and viewBox ('it could be diffrent based on you requirement')
the below code working on iphone 5s running 12.5.5 software version.
note: the div element have some styles it does not require to be inlcuded in your project.
<!DOCTYPE html>
<html>
<body>
<div
style="height:24px;float: left"
class="navbar-toggler-icon ">
<svg
height="24px"
width="24px"
viewBox="0 -41 512 512"
xmlns="http://www.w3.org/2000/svg"><path d="M407 0H105C47.102 0 0 47.102 0 105v168.945c0 57.899 47.102 105 105 105h15.582l36.52 46.332a15.001 15.001 0 0 0 23.563 0l36.519-46.332H407c57.898 0 105-47.101 105-105V105C512 47.102 464.898 0 407 0zm0 0" fill="#6787f5"/>
<path d="M407 0H256v378.945h151c57.898 0 105-47.101 105-105V105C512 47.102 464.898 0 407 0zm0 0" fill="#38478a"/><path d="m199.758 401.055 17.426-22.11zM512 123.254H385.879l93.883-93.883C460.875 11.195 435.222 0 407 0h-25.145l-59.613 59.613V0h-132.48v59.613L130.148 0H105C76.777 0 51.125 11.195 32.238 29.371l93.883 93.883H0v132.48h126.121l-90.36 90.356-3.503 3.504c18.887 18.168 44.531 29.351 72.742 29.351h15.582l4.234 5.371 63.336-63.34-1.027 57.97h135.113v-59.407l59.211 59.406H407c28.09 0 53.637-11.086 72.496-29.113l-3.531-3.547-90.25-90.55H512zm0 0" fill="#fff"/><path d="M512 123.254H385.879l93.883-93.883C460.875 11.195 435.222 0 407 0h-25.145l-59.613 59.613V0H256v378.945h66.238V319.54l59.211 59.406H407c28.09 0 53.637-11.086 72.496-29.113l-3.531-3.547-90.25-90.55H512zm0 0" fill="#c7d3ed"/><path d="M292.238 153.254V0h-72.476v153.254H0v72.48h219.762l-2.578 153.211h75.054v-153.21H512v-72.481zm0 0" fill="#ff337a"/><path d="M292.238 153.254V0H256v378.945h36.238v-153.21H512v-72.481zm0 0" fill="#d1005b"/><path d="M199.758 133.25v-21.21L88.945 1.226a104.169 104.169 0 0 0-31.996 10.43L178.547 133.25zm0 0" fill="#ff337a"/><path d="M455.05 11.656a104.169 104.169 0 0 0-31.995-10.43L312.242 112.04v21.211h21.211zm0 0" fill="#d1005b"/><path d="M56.977 367.305a104.307 104.307 0 0 0 32.003 10.422l110.778-110.782v-21.21h-21.211zm0 0" fill="#ff337a"/><path d="M312.242 245.734v21.274L422.641 377.78a104.279 104.279 0 0 0 32.074-10.316l-121.32-121.73zm0 0" fill="#d1005b"/>
</svg>
</div>
</body>
</html>
for server testing environments:
tested obuntu / apache2
tested windows/ xampp