N
N
Nikolay Semenov2017-06-11 17:21:08
HTML
Nikolay Semenov, 2017-06-11 17:21:08

Why does svg behave like this?

Guys hello everyone. Help me to understand. Do you have an svg sprite? here is his code

<?xml version="1.0" encoding="utf-8"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><symbol viewBox="0 0 34 32" id="cart" xmlns="http://www.w3.org/2000/svg"><title>cart</title><path d="M3.951 12.55c.055.018.109 0 .164-.018.055-.036.091-.073.091-.127h.018l.473-1.711.055-.237h22.813a.206.206 0 0 0 .146-.055.232.232 0 0 0 .073-.164c0-.055-.036-.109-.073-.146s-.091-.055-.146-.055H4.879l.109-.401 1.839-6.627v-.018l.018-.018c.146-.364.346-.583.564-.71.237-.146.492-.182.783-.182h1.056a.206.206 0 0 0 .146-.055c.036-.036.055-.091.055-.164a.206.206 0 0 0-.055-.146.208.208 0 0 0-.146-.055H8.192c-.273 0-.619.018-.929.182s-.601.455-.838.983v.018l-.018.018-2.604 9.413c-.018.055-.018.127.018.164.018.055.073.091.127.109zm8.43-9.413h9.431c.346 0 .655-.146.892-.382a1.25 1.25 0 0 0 .364-.892c0-.346-.146-.655-.364-.892a1.318 1.318 0 0 0-.892-.364h-9.431c-.346 0-.655.146-.892.364a1.318 1.318 0 0 0-.364.892c0 .364.146.674.364.892.237.237.546.382.892.382zm0-2.094h9.431c.218 0 .437.091.583.237a.842.842 0 0 1 .237.583.886.886 0 0 1-.237.601.842.842 0 0 1-.583.237h-9.431a.843.843 0 0 1-.583-.237c-.146-.164-.255-.364-.255-.601a.842.842 0 0 1 .838-.82zm-6.719 17.57c0 .073.036.127.073.164s.091.055.146.055h2.822l.018.291.255 3.132.036.346H6.39c-.073 0-.127.018-.164.055a.208.208 0 0 0-.055.146c0 .073.018.127.055.164.036.036.091.055.164.055h2.658l.018.291.255 3.132.036.346H6.936c-.073 0-.127.018-.164.055a.208.208 0 0 0-.055.146c0 .073.018.127.055.164.036.036.091.055.164.055h2.458l.018.291.146 1.602c0 .073.018.109.055.146s.091.055.146.055h.018c.073 0 .127-.036.146-.073.036-.036.055-.091.055-.164l-.127-1.511-.018-.346h4.424v1.875a.23.23 0 0 0 .073.164c.036.036.091.055.146.055s.109-.018.164-.055c.036-.036.055-.091.055-.164V27.21h4.807v1.875c0 .073.018.127.055.164.036.036.091.055.164.055a.206.206 0 0 0 .146-.055c.036-.036.055-.091.055-.164V27.21h4.442l-.018.346-.127 1.511c-.018.073 0 .127.036.164s.091.073.146.073h.018c.073 0 .109-.018.146-.055.055-.036.073-.073.073-.146l.146-1.602.018-.291h2.476c.073 0 .127-.018.164-.055s.055-.091.055-.164c0-.055-.018-.109-.055-.146s-.091-.055-.164-.055h-2.44l.018-.346.273-3.132.018-.291h2.658a.206.206 0 0 0 .146-.055c.055-.036.073-.091.073-.164a.166.166 0 0 0-.073-.146.208.208 0 0 0-.146-.055h-2.622l.036-.346.255-3.132.018-.291h2.877c.073 0 .127-.018.164-.055s.055-.091.055-.164c0-.055-.018-.109-.055-.146s-.091-.055-.164-.055h-2.84l.036-.346.127-1.529c0-.055-.018-.109-.055-.146s-.091-.073-.146-.073c-.055-.018-.127 0-.164.036s-.073.091-.073.146l-.127 1.62-.036.291H19.92v-1.893c0-.055-.018-.109-.055-.146s-.091-.055-.146-.055c-.073 0-.127.018-.164.055s-.055.091-.055.146v1.893h-4.807v-1.893a.206.206 0 0 0-.055-.146h-.018c-.036-.036-.091-.055-.146-.055s-.109.018-.146.055c-.036.036-.073.091-.073.146v1.893H9.084l-.018-.291-.127-1.62a.359.359 0 0 0-.073-.146c-.055-.036-.109-.055-.164-.036-.055 0-.109.036-.146.073s-.055.091-.055.146l.127 1.529.036.346H5.878c-.055 0-.109.018-.146.055s-.073.091-.073.146zm14.566.218h4.843l-.036.346-.255 3.132-.036.291h-4.825v-3.769h.309zm0 4.188h4.479l-.018.346-.273 3.132-.018.291h-4.479v-3.769h.309zm-5.226-4.188h4.497V22.6h-4.807v-3.769h.309zm0 4.188h4.497v3.769h-4.807v-3.769h.309zm-1.056 3.769H9.795l-.036-.291-.255-3.132-.036-.346h4.788v3.769h-.309zm.31-7.647V22.6H9.449l-.036-.291-.255-3.132-.036-.346h5.134v.309zm18.025-9.104h-2.513l-.073-.237-1.912-6.937-.018-.018v-.018c-.237-.528-.528-.819-.837-.983-.328-.164-.655-.182-.929-.182h-1.056a.206.206 0 0 0-.146.055c-.036.036-.073.091-.073.146a.23.23 0 0 0 .073.164.208.208 0 0 0 .146.055h1.056c.291 0 .546.036.783.182.218.127.419.346.564.71l.018.018v.018l2.604 9.395c.018.036.055.073.091.109.018.018.073.036.127.036h.054c.055-.018.109-.055.127-.109.036-.036.036-.109.018-.164l-.401-1.42-.109-.401h2.185v1.875c0 .073.018.127.055.164.036.036.091.055.164.055a.206.206 0 0 0 .146-.055.232.232 0 0 0 .073-.164v-2.094c0-.055-.036-.109-.073-.146a.208.208 0 0 0-.146-.055zm-1.056 4.188H2.131v-3.769h.601a.206.206 0 0 0 .146-.055c.055-.036.073-.091.073-.164a.166.166 0 0 0-.073-.146.208.208 0 0 0-.146-.055h-.819c-.055 0-.109.018-.146.055s-.073.091-.073.146v4.188a.23.23 0 0 0 .073.164.208.208 0 0 0 .146.055h29.076l-.055.364-2.021 14.056v.018c0 .528-.2 1.001-.546 1.329a1.856 1.856 0 0 1-1.329.564H7.156a1.825 1.825 0 0 1-1.329-.564 1.825 1.825 0 0 1-.564-1.329v-.018L3.497 16.501c0-.055-.036-.109-.073-.146-.055-.036-.109-.055-.164-.036-.055 0-.109.036-.146.073-.036.055-.055.109-.036.164v.036l1.766 12.49v.036c0 .637.273 1.202.692 1.62.419.401.983.655 1.62.655h19.882c.637 0 1.202-.255 1.62-.655.419-.419.692-.983.692-1.62v-.036l2.094-14.62v-.091c-.018-.018-.036-.055-.055-.073-.018-.036-.036-.055-.073-.055-.018-.018-.055-.018-.091-.018z"/></symbol></svg>

despite the fact that the viewbox is 32 by 34,
if I don't set the width to auto, then it stretches to 300px,
why say not to 500
parents with a size of 300 no, go beyond the "a" tag

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question