html5 - SVG responsive design -


my svg logo responsive, i'm unsure why working, expecting far more complicated , feel i'm missing here

here html logo:

-the width of logo container defined bootstrap class col-xs-6

-all images set max-width {100%} in css

-header height set auto

<div id="logo" class="col-xs-6 clearfix">   <img src="images/logo.svg" alt="the website logo"> </div> 

here xml logo:

<svg version="1.1" id="layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"      viewbox="0 0 57.8 15" enable-background="new 0 0 57.8 15" xml:space="preserve"> <rect x="0.5" y="0.7" fill="#ffffff" stroke="#000000" stroke-miterlimit="10" width="56.8" height="13.8"/> <text transform="matrix(1 0 0 1 15.0075 10.044)" font-family="'myriadpro-regular'" font-size="12">logo</text> <g>     <g>         <path fill="#1e6e30" d="m-0.2,3.8c17.7,0.4,35.3,0.5,53,0.3c1.4,0,3.7-2.9,3.8-2.9c39,1.4,21.3,1.3,3.6,0.9             c2.3,0.9-0.1,3.8-0.2,3.8l-0.2,3.8z"/>     </g> </g> </svg> 

my questions

do need add delete xml? , should use css below? looks svg working other image, should make adjustments?

#logo img  {  width: 100%;  height: 100%;    } 

many time

since no width/height parameter in svg container, hence doesn't know params fixed width/height.try this

<svg version="1.1" id="layer_1" xmlns="http://www.w3.org/2000/svg" width="640" height="480" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"      viewbox="0 0 57.8 15" enable-background="new 0 0 57.8 15" xml:space="preserve"> <rect x="0.5" y="0.7" fill="#ffffff" stroke="#000000" stroke-miterlimit="10" width="56.8" height="13.8"/> <text transform="matrix(1 0 0 1 15.0075 10.044)" font-family="'myriadpro-regular'" font-size="12">logo</text> <g>     <g>         <path fill="#1e6e30" d="m-0.2,3.8c17.7,0.4,35.3,0.5,53,0.3c1.4,0,3.7-2.9,3.8-2.9c39,1.4,21.3,1.3,3.6,0.9             c2.3,0.9-0.1,3.8-0.2,3.8l-0.2,3.8z"/>     </g> </g> </svg> 

i added width/height params svg.


Comments

Popular posts from this blog

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

How to show in django cms breadcrumbs full path? -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -