How can I remove the space around the SVG?


awkward sight

I know there are many posts related to this, I have checked all of them but couldn't find a proper solution for my problem, that's why I am posting this question.

I have an SVG like this:

enter image description here

As you can see, this SVG has no spaces on the top left and top, but has some spaces on the top right and bottom. How can I remove the spaces at the bottom and right?

SVG's source code: stackoverflow's body can only contain up to 30000 characters, but SVG's source code has more characters than the limit. For reasons I had to upload the code on this Gist . Sorry for any inconveniences caused:(

Alexander TT

To see the border of the SVG canvas, I added a red border style to the header of the SVG file

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 768" version="1.1" 
 style="border:1px solid red;">

Your image is shifted left and right so there is white space on the right and bottom

jsfiddle

Image shifting is performed by the following commands:

<g id="girl" transform="translate(-35.000000, -89.000000)">
Remove this command or set the coordinates to zero

<g id="girl" transform="translate(0, 0)">

jsfiddle

As a result, the white space will disappear and the image will occupy the entire SVG canvas.

Related


How can I remove the space around the SVG?

awkward sight I know there are many posts related to this, I have checked all of them but couldn't find a proper solution for my problem, that's why I am posting this question. I have an SVG like this: As you can see, this SVG has no spaces on the top left and

How can I remove the space around the SVG?

awkward sight I know there are many posts related to this, I have checked all of them but couldn't find a proper solution for my problem, that's why I am posting this question. I have an SVG like this: As you can see, this SVG has no spaces on the top left and

How can I remove the space around the SVG?

awkward sight I know there are many posts related to this, I have checked all of them but couldn't find a proper solution for my problem, that's why I am posting this question. I have an SVG like this: As you can see, this SVG has no spaces on the top left and

How can I remove the space around the SVG?

awkward sight I know there are many posts related to this, I have checked all of them but couldn't find a proper solution for my problem, that's why I am posting this question. I have an SVG like this: As you can see, this SVG has no spaces on the top left and

How can I remove the border around the toolbar?

Axl In my app I'm using the toolbar and it seems I want to get rid of the border around it: Then I create it like this: <android.support.design.widget.AppBarLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:bac

How can I remove the border around the toolbar?

Axl In my app I'm using the toolbar and it seems I want to get rid of the border around it: Then I create it like this: <android.support.design.widget.AppBarLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:bac

How can I remove the border around the image?

username How can I remove the border around the square? Exterior: my HTML: <input id="black" type="image" src="html5-canvas-drawing-app/images/color-swatch-brown.png" onClick="changeColorBlack()"> my css: #black{ border:none; outline:none; background:none; pa

How can I remove the border around the toolbar?

Axl In my app I'm using the toolbar and it seems I want to get rid of the border around it: Then I create it like this: <android.support.design.widget.AppBarLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:bac

How to remove whitespace around SVG

Vogog I'm displaying an SVG on a simple webpage, but when I resize the image beyond a certain size (height: ~65vh), there is an invisible space around the SVG that makes the page bigger and the scrollbar goes down . There is also a large white space at the top

How can I remove the extra space in this table?

ocomfd I want to create a traffic indicator bar in the following form: Step 1 > Step 2 > Step 3 , I use table to do this, and the following html does almost exactly what I want: .concave{ border-left:1em solid transparent; border-top:1em solid orange; b

How can I remove the space to the right of the div?

beer here I created a column structure using bootstrap 4. It looks like this, it has 1 row and 2 columns: <div class="left"> <hr class="container hline"> <div id="main" class="container border"> <div class="row"> <

How can I remove this space? (HTML, CSS)

Dino Grunt I'm a beginner in web development and I don't understand why there are blanks here (check the screenshots), I'll remove them... PS: I use electron framework to make a desktop app * { border: 2px solid black; } #Icon { height: 30px; width: 30p

How can I remove the extra space in the navbar?

Naveen Niraula Ok, I'm making a navbar and I'm doing fine, but one thing that's bothering me is how to get rid of the small space between the first li and the left margin. HTML: <div id="nav"> <ul> <li><a href="#">Home</a></li><li> <a href="#">Resum

How can I remove the extra space in this table?

ocomfd I want to create a traffic indicator bar in the following form: Step 1 > Step 2 > Step 3 , I use table to do this, and the following html does almost exactly what I want: .concave{ border-left:1em solid transparent; border-top:1em solid orange; b

How can I remove the space to the right of the div?

beer here I created a column structure using bootstrap 4. It looks like this, it has 1 row and 2 columns: <div class="left"> <hr class="container hline"> <div id="main" class="container border"> <div class="row"> <

How can I remove the extra space in the navbar?

Naveen Niraula ok i'm making a navbar and i'm doing fine, but one thing is bothering me, and that is how to get rid of the small space between the first li and the left margin. HTML: <div id="nav"> <ul> <li><a href="#">Home</a></li><li> <a href="#">

How to remove white space around pictures in Android?

Manzotine Given an image with an alpha channel (transparency), I would like to remove any white space between the borders of the image and the actual image. This should be done in a background task or loading screen and within an acceptable runtime so as not t

How to remove white space around pictures in Android?

Manzotine Given an image with an alpha channel (transparency), I would like to remove any white space between the borders of the image and the actual image. This should be done in a background task or loading screen and within an acceptable runtime so as not t

How to remove space around card in flutter

Riven Christopher Coutinho In this screenshot, there is space around the card, I have tried many ways but can't remove it, please can anyone help. this is my code class StepOneView extends StatefulWidget { StepOneView({Key key}) : super(key: key); @overri

How to remove white space around pictures in Android?

Manzotine Given an image with an alpha channel (transparency), I would like to remove any white space between the borders of the image and the actual image. This should be done in a background task or loading screen and within an acceptable runtime so as not t

How to remove white space around pictures in Android?

Manzotine Given an image with an alpha channel (transparency), I would like to remove any white space between the borders of the image and the actual image. This should be done in a background task or loading screen and within an acceptable runtime so as not t

How can I remove the padding around the background image?

Vincent How can I remove the "padding" around the background image? Here is a demo : https://jsbin.com/dobucizaqi/edit?html,css,output .foo { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox=