- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我如何获得下面的 svg 图像以将 40 像素缩放到 40 像素。
我试过更改 viewBox
以及高度和宽度,但似乎不太正确
<html>
<body>
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" width="1000px" height="1000px" viewBox="0 0 1000 1000" enable-background="new 0 0 1000 1000"><g class="cow__container"><path fill-rule="evenodd" clip-rule="evenodd" d="M884,329.64c-1.122,5.369-2.196,10.749-3.374,16.105 c-5.812,26.44-14.017,52.028-27.338,75.751c-8.967,15.969-19.913,30.313-34.847,41.242c-17.124,12.532-36.314,17.801-57.453,16.278 c-15.802-1.139-30.767-5.478-45.043-12.084c-5.87-2.717-11.806-3.102-17.942-2.617c-3.539,0.28-7.031,1.141-10.631,1.754 c0.009,0.118-0.085-0.121-0.007-0.265c10.652-19.542,8.98-38.777-1.587-57.698c-1.23-2.204-1.374-3.731-0.087-5.998 c4.313-7.596,6.408-15.77,5.273-24.585c-0.039-0.302-0.005-0.613-0.005-0.933c12.388-4.38,22.498-12.23,30.922-21.735 c21.579-24.352,48.968-38.988,79.189-49.157c13.771-4.634,27.94-7.222,42.558-6.92c9.435,0.195,18.555,1.809,27.24,5.592 c6.401,2.788,10.529,7.59,12.593,14.226c0.106,0.344,0.355,0.644,0.538,0.965C884,322.92,884,326.28,884,329.64z M813.712,411.235 c13.214-11.448,24.157-24.656,31.979-40.3c4.986-9.976,8.731-20.378,9.758-31.577c0.747-8.158-3.785-15.235-11.115-17.18 c-3.213-0.852-6.578-1.426-9.895-1.544c-12.256-0.437-23.887,2.734-35.259,6.86c-25.36,9.203-48.545,22.578-70.963,37.389 c-0.212,0.14-0.518,0.137-0.779,0.201c0.172,0.167,0.344,0.334,0.516,0.501c6.907-3.452,13.771-6.995,20.731-10.338 c17.256-8.287,34.713-16.104,53.276-21.07c8.582-2.296,17.264-4.059,26.248-2.629c7.499,1.193,12.295,5.485,13.14,13.042 c0.468,4.186,0.021,8.641-0.887,12.783c-2.658,12.12-8.274,23.077-14.427,33.733C822.103,397.917,817.831,404.532,813.712,411.235z M116.48,320.52c0.283-0.723,0.615-1.431,0.841-2.172c1.925-6.315,5.841-10.919,11.843-13.68 c10.928-5.028,22.511-6.349,34.371-5.811c22.41,1.016,43.156,8.08,63.146,17.713c13.792,6.646,26.886,14.458,38.425,24.604 c3.887,3.418,7.336,7.338,10.943,11.07c7.019,7.262,14.383,14.125,23.115,19.307c3.339,1.982,6.924,3.551,10.595,5.408 c-1.522,9.651,1.301,18.615,6.165,27.146c0.339,0.594,0.078,1.818-0.324,2.504c-4.226,7.232-7.299,14.867-8.674,23.173 c-2.099,12.683-0.024,24.606,6.26,35.809c0.116,0.207,0.203,0.43,0.246,0.521c-3.407-0.581-6.848-1.36-10.333-1.719 c-6.48-0.667-12.69-0.128-18.843,2.743c-13.077,6.103-26.845,10.176-41.255,11.635c-27.48,2.782-51.181-5.511-71.055-24.695 c-16.231-15.667-27.08-34.831-35.658-55.405c-9.213-22.099-15.302-45.104-19.335-68.676c-0.077-0.452-0.312-0.878-0.474-1.316 C116.48,325.96,116.48,323.24,116.48,320.52z M272.693,365.663c0.082-0.15,0.163-0.301,0.245-0.452 c-2.861-1.863-5.702-3.759-8.589-5.583c-20.825-13.152-42.271-25.105-65.679-33.097c-11.907-4.065-24.03-7.013-36.839-5.579 c-11.376,1.273-17.435,7.567-16.425,18.974c0.575,6.498,2.402,13.023,4.573,19.218c7.084,20.224,19.782,36.685,35.429,51.033 c0.284,0.261,0.689,0.39,1.654,0.917c-0.957-1.467-1.555-2.3-2.068-3.183c-5.619-9.649-11.527-19.146-16.747-29.006 c-4.939-9.332-8.863-19.184-9.322-29.932c-0.343-8.028,2.437-14.054,10.39-16.621c2.32-0.749,4.836-1.119,7.281-1.219 c10.545-0.43,20.566,2.308,30.458,5.508c21.311,6.895,41.392,16.63,61.287,26.777C269.795,364.16,271.243,364.915,272.693,365.663z M663.008,669.929c-0.57-6.571-0.819-13.115-1.764-19.557c-1.846-12.592-6.015-24.323-14.439-34.166 c-8.361-9.77-19.219-14.847-31.82-16.344c-11.665-1.386-23.322-0.167-34.94,0.729c-11.3,0.872-22.556,2.314-33.824,3.57 c-8.967,1-17.9,2.408-26.892,3.038c-5.608,0.394-11.294-0.401-16.948-0.509c-2.742-0.052-5.514,0.076-8.234,0.424 c-8.098,1.036-16.116,0.118-24.14-0.764c-18.413-2.021-36.807-4.222-55.24-6.034c-7.539-0.741-15.158-0.889-22.743-0.921 c-23.11-0.101-40.845,12.222-49.031,33.803c-3.836,10.115-5.649,20.597-5.755,31.392c-0.017,1.744-0.002,3.489-0.002,5.548 c-4.864-1.54-8.998-3.864-12.838-6.717c-9.7-7.205-14.901-17.091-16.823-28.821c-2.638-16.104,0.222-31.7,5.145-46.927 c2.886-8.929,6.822-17.515,10.166-26.3c0.529-1.39,0.774-3.069,0.563-4.53c-4.173-28.935-0.409-56.709,12.433-83.037 c13.871-28.438,34.403-50.76,62.111-66.282c12.372-6.932,25.758-10.52,39.782-12.147c20.579-2.388,40.963-1.236,61.273,2.623 c2.06,0.391,4.374-0.458,6.554-0.828c16.933-2.874,33.938-3.865,51.081-2.336c14.256,1.271,28.075,4.083,40.99,10.548 c18.312,9.166,33.66,22.004,46.606,37.747c15.749,19.153,26.357,40.818,31.112,65.23c3.099,15.908,3.408,31.886,0.85,47.902 c-0.32,2.008-0.121,3.79,0.807,5.725c7.428,15.472,12.966,31.583,15.206,48.656c1.541,11.742,1.423,23.426-3.074,34.694 c-4.804,12.035-13.703,19.76-25.494,24.496C663.406,669.946,663.072,669.921,663.008,669.929z M605.628,421.397 c0.963,4.05,2.046,7.475,2.561,10.983c1.789,12.183-2.256,21.521-15.65,24.141c-4.38,0.856-8.461,2.359-11.879,5.298 c-8.065,6.935-10.746,16.04-9.978,26.251c0.537,7.135,3.031,13.625,8.943,18.149c7.012,5.365,14.798,4.856,22.577,2.128 c19.232-6.746,29.46-26.586,24.763-47.405c-2.858-12.667-9.106-23.591-16.774-33.836 C608.833,425.295,607.366,423.566,605.628,421.397z M394.049,421.417c-6.855,8.215-12.873,16.908-17.128,26.736 c-3.265,7.541-5.247,15.325-5.182,23.644c0.136,17.333,10.931,32.072,27.48,37.161c10.059,3.093,18.936,0.843,24.504-6.399 c3.563-4.635,5.015-10.017,5.354-15.833c0.734-12.635-5.88-27.413-22.268-30.356c-11.702-2.102-17.405-10.878-15.455-22.681 C392.024,429.63,393.109,425.64,394.049,421.417z M385.188,614.35c-30.602,9.913-44.266,43.738-29.744,70.788 c13.506,25.16,32.758,44.557,58.68,56.919c16.505,7.872,33.85,10.102,51.838,6.574c11.664-2.287,22.316-7.104,32.274-13.49 c1.28-0.82,2.135-0.883,3.381-0.029c1.975,1.351,4.068,2.535,6.165,3.692c20.894,11.528,42.822,14.716,65.889,7.9 c14.798-4.372,27.73-12.192,39.306-22.259c13.833-12.029,25.468-25.849,33.104-42.676c8.517-18.77,3.709-41.744-11.356-55.673 c-12.316-11.388-27.147-15.468-43.479-14.71c-12.123,0.562-24.212,1.836-36.332,2.469c-15.026,0.785-30.035,0.18-45.006-1.363 c-3.883-0.4-7.802-1.142-11.661-0.929c-9.802,0.541-19.571,2.066-29.368,2.215c-13.484,0.203-26.987-0.346-40.471-0.874 c-7.413-0.29-14.802-1.199-19.317-1.584C399.026,611.195,392.012,612.139,385.188,614.35z M614.046,304.22 c-4.441-7.552-10.675-12.843-19.206-15.215c-5.954-1.655-12.028-1.494-18.089-0.922c-6.198,0.584-12.37,1.462-18.569,2.041 c-8.708,0.813-16.924-1.104-24.966-4.422c-5.063-2.089-10.335-3.744-15.624-5.186c-2.317-0.632-4.934-0.479-7.377-0.265 c-3.544,0.31-5.785,2.279-6.321,6.167c-0.924,6.702-1.378,13.469-2.005,20.211c-0.079,0.852-0.011,1.717-0.011,3.075 c-2.08-3.633-3.823-6.902-5.774-10.042c-4.486-7.22-10.406-12.706-18.816-15.042c-6.247-1.735-12.613-1.932-19.017-1.34 c-10.881,1.004-21.744,2.226-32.638,3.057c-6.35,0.484-12.85-0.287-19.098,0.692c-12.795,2.004-22.984,8.451-29.298,20.121 c-4.257,7.869-1.296,17.128,6.733,21.185c2.62,1.324,5.428,2.295,8.193,3.309c9.971,3.655,15.402,10.976,17.087,21.237 c0.75,4.566,3.28,7.726,7.163,9.913c6.563,3.695,13.806,4.717,21.17,5.343c2.07,0.176,4.465,0.445,6.056,1.585 c4.102,2.939,3.749,9.51-0.764,11.916c-2.781,1.482-6.159,2.074-9.346,2.527c-23.123,3.288-43.874,12.207-62.387,26.303 c-17.72,13.492-31.283,30.301-39.339,51.223c-1.911,4.962-3.122,10.194-4.659,15.3c-0.151,0.5-0.333,0.992-0.671,1.987 c-14.79-25.739-11.593-50.302,2.654-74.574c-7.669-6.593-10.705-15.2-10.515-25.115c0.199-10.346,5.33-17.771,13.816-23.23 c0.802-0.516,1.736-1.586,1.767-2.43c0.872-24.068,13.771-39.763,34.372-50.502c8.469-4.415,16.503-9.679,24.643-14.708 c8.296-5.126,16.499-10.51,26.149-12.688c6.912-1.56,13.954-2.592,20.975-3.604c9.8-1.413,18.569-4.963,26.196-11.385 c4.704-3.961,9.538-7.889,15.574-9.669c8.622-2.543,16.993-1.01,24.948,2.575c6.902,3.111,13.532,6.823,20.328,10.176 c10.314,5.09,21.436,7.675,32.565,10.14c10.117,2.241,20.345,3.996,30.433,6.356C603.153,283.308,610.116,292.33,614.046,304.22z M341.396,397.209c6.927,1.933,15.42-3.808,18.002-10.533c3.484-9.078-0.717-19.207-9.632-22.887 c-8.248-3.404-18.796,0.382-21.805,7.826c9.91-5.26,18.346-3.502,22.554,4.615C353.767,382.505,352.773,392.788,341.396,397.209z M333.249,382.019c2.373,0.034,4.197-1.644,4.25-3.911c0.056-2.4-1.807-4.32-4.182-4.311c-2.231,0.009-4.102,1.875-4.136,4.127 C329.145,380.24,330.878,381.985,333.249,382.019z M605.976,285.565c6.292,2.87,12.091,5.283,17.679,8.112 c12.737,6.448,24.342,14.432,33.104,25.961c7.495,9.863,11.641,20.86,10.715,33.422c-0.134,1.817,0.703,2.704,1.981,3.673 c8.49,6.434,13.247,14.796,12.889,25.667c-0.26,7.891-2.972,14.8-8.544,20.498c-0.494,0.505-0.962,1.036-1.38,1.487 c14.257,24.308,17.445,48.856,2.726,74.484c-1.533-5.072-2.716-9.767-4.365-14.293c-6.201-17.022-16.648-31.178-29.779-43.48 c-11.345-10.627-24.26-19.025-37.901-26.304c-8.729-4.657-18.408-6.692-27.949-8.955c-6.36-1.508-12.817-2.604-19.194-4.045 c-1.91-0.431-3.869-1.135-5.508-2.181c-5.003-3.195-5.851-7.113-2.87-12.218c3.534-6.053,8.322-10.506,15.719-10.576 c3.701-0.035,7.417,0.868,11.117,1.409c2.602,0.38,5.173,1.09,7.783,1.254c5.353,0.336,7.924-1.375,10.057-6.313 c1.296-3.001,2.515-6.035,3.785-9.047c2.637-6.249,7.107-10.496,13.625-12.553c1.821-0.575,3.605-1.282,5.378-2 c10.631-4.306,14.215-14.344,8.737-24.482c-3.886-7.191-9.742-12.597-16.043-17.592c-0.374-0.296-0.767-0.569-1.135-0.874 C606.496,286.533,606.45,286.376,605.976,285.565z M641.396,371.752c9.896-5.434,18.505-3.728,22.723,4.503 c4.164,8.126,0.637,16.222-9.132,20.958c5.196,1.796,14.711-2.42,17.915-10.289c3.563-8.745-0.271-18.921-8.859-22.804 C655.484,360.251,645.177,363.724,641.396,371.752z M646.895,382.019c2.46,0.021,4.282-1.746,4.246-4.115 c-0.034-2.191-1.926-4.08-4.114-4.106c-2.364-0.029-4.233,1.838-4.214,4.207C642.831,380.308,644.551,381.999,646.895,382.019z"></path></g></svg>
</body>
</html>
最佳答案
你只需要一个包装器:
.svg-control {
width: 40px;
display: inline-block;
}
.svg-control svg {
width: 100%;
height: auto;
}
.svg-control {
width: 40px;
display: inline-block;
}
.svg-control svg {
width: 100%;
height: auto;
}
<span class="svg-control">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" width="1000px" height="1000px" viewBox="0 0 1000 1000" enable-background="new 0 0 1000 1000"><g class="cow__container"><path fill-rule="evenodd" clip-rule="evenodd" d="M884,329.64c-1.122,5.369-2.196,10.749-3.374,16.105 c-5.812,26.44-14.017,52.028-27.338,75.751c-8.967,15.969-19.913,30.313-34.847,41.242c-17.124,12.532-36.314,17.801-57.453,16.278 c-15.802-1.139-30.767-5.478-45.043-12.084c-5.87-2.717-11.806-3.102-17.942-2.617c-3.539,0.28-7.031,1.141-10.631,1.754 c0.009,0.118-0.085-0.121-0.007-0.265c10.652-19.542,8.98-38.777-1.587-57.698c-1.23-2.204-1.374-3.731-0.087-5.998 c4.313-7.596,6.408-15.77,5.273-24.585c-0.039-0.302-0.005-0.613-0.005-0.933c12.388-4.38,22.498-12.23,30.922-21.735 c21.579-24.352,48.968-38.988,79.189-49.157c13.771-4.634,27.94-7.222,42.558-6.92c9.435,0.195,18.555,1.809,27.24,5.592 c6.401,2.788,10.529,7.59,12.593,14.226c0.106,0.344,0.355,0.644,0.538,0.965C884,322.92,884,326.28,884,329.64z M813.712,411.235 c13.214-11.448,24.157-24.656,31.979-40.3c4.986-9.976,8.731-20.378,9.758-31.577c0.747-8.158-3.785-15.235-11.115-17.18 c-3.213-0.852-6.578-1.426-9.895-1.544c-12.256-0.437-23.887,2.734-35.259,6.86c-25.36,9.203-48.545,22.578-70.963,37.389 c-0.212,0.14-0.518,0.137-0.779,0.201c0.172,0.167,0.344,0.334,0.516,0.501c6.907-3.452,13.771-6.995,20.731-10.338 c17.256-8.287,34.713-16.104,53.276-21.07c8.582-2.296,17.264-4.059,26.248-2.629c7.499,1.193,12.295,5.485,13.14,13.042 c0.468,4.186,0.021,8.641-0.887,12.783c-2.658,12.12-8.274,23.077-14.427,33.733C822.103,397.917,817.831,404.532,813.712,411.235z M116.48,320.52c0.283-0.723,0.615-1.431,0.841-2.172c1.925-6.315,5.841-10.919,11.843-13.68 c10.928-5.028,22.511-6.349,34.371-5.811c22.41,1.016,43.156,8.08,63.146,17.713c13.792,6.646,26.886,14.458,38.425,24.604 c3.887,3.418,7.336,7.338,10.943,11.07c7.019,7.262,14.383,14.125,23.115,19.307c3.339,1.982,6.924,3.551,10.595,5.408 c-1.522,9.651,1.301,18.615,6.165,27.146c0.339,0.594,0.078,1.818-0.324,2.504c-4.226,7.232-7.299,14.867-8.674,23.173 c-2.099,12.683-0.024,24.606,6.26,35.809c0.116,0.207,0.203,0.43,0.246,0.521c-3.407-0.581-6.848-1.36-10.333-1.719 c-6.48-0.667-12.69-0.128-18.843,2.743c-13.077,6.103-26.845,10.176-41.255,11.635c-27.48,2.782-51.181-5.511-71.055-24.695 c-16.231-15.667-27.08-34.831-35.658-55.405c-9.213-22.099-15.302-45.104-19.335-68.676c-0.077-0.452-0.312-0.878-0.474-1.316 C116.48,325.96,116.48,323.24,116.48,320.52z M272.693,365.663c0.082-0.15,0.163-0.301,0.245-0.452 c-2.861-1.863-5.702-3.759-8.589-5.583c-20.825-13.152-42.271-25.105-65.679-33.097c-11.907-4.065-24.03-7.013-36.839-5.579 c-11.376,1.273-17.435,7.567-16.425,18.974c0.575,6.498,2.402,13.023,4.573,19.218c7.084,20.224,19.782,36.685,35.429,51.033 c0.284,0.261,0.689,0.39,1.654,0.917c-0.957-1.467-1.555-2.3-2.068-3.183c-5.619-9.649-11.527-19.146-16.747-29.006 c-4.939-9.332-8.863-19.184-9.322-29.932c-0.343-8.028,2.437-14.054,10.39-16.621c2.32-0.749,4.836-1.119,7.281-1.219 c10.545-0.43,20.566,2.308,30.458,5.508c21.311,6.895,41.392,16.63,61.287,26.777C269.795,364.16,271.243,364.915,272.693,365.663z M663.008,669.929c-0.57-6.571-0.819-13.115-1.764-19.557c-1.846-12.592-6.015-24.323-14.439-34.166 c-8.361-9.77-19.219-14.847-31.82-16.344c-11.665-1.386-23.322-0.167-34.94,0.729c-11.3,0.872-22.556,2.314-33.824,3.57 c-8.967,1-17.9,2.408-26.892,3.038c-5.608,0.394-11.294-0.401-16.948-0.509c-2.742-0.052-5.514,0.076-8.234,0.424 c-8.098,1.036-16.116,0.118-24.14-0.764c-18.413-2.021-36.807-4.222-55.24-6.034c-7.539-0.741-15.158-0.889-22.743-0.921 c-23.11-0.101-40.845,12.222-49.031,33.803c-3.836,10.115-5.649,20.597-5.755,31.392c-0.017,1.744-0.002,3.489-0.002,5.548 c-4.864-1.54-8.998-3.864-12.838-6.717c-9.7-7.205-14.901-17.091-16.823-28.821c-2.638-16.104,0.222-31.7,5.145-46.927 c2.886-8.929,6.822-17.515,10.166-26.3c0.529-1.39,0.774-3.069,0.563-4.53c-4.173-28.935-0.409-56.709,12.433-83.037 c13.871-28.438,34.403-50.76,62.111-66.282c12.372-6.932,25.758-10.52,39.782-12.147c20.579-2.388,40.963-1.236,61.273,2.623 c2.06,0.391,4.374-0.458,6.554-0.828c16.933-2.874,33.938-3.865,51.081-2.336c14.256,1.271,28.075,4.083,40.99,10.548 c18.312,9.166,33.66,22.004,46.606,37.747c15.749,19.153,26.357,40.818,31.112,65.23c3.099,15.908,3.408,31.886,0.85,47.902 c-0.32,2.008-0.121,3.79,0.807,5.725c7.428,15.472,12.966,31.583,15.206,48.656c1.541,11.742,1.423,23.426-3.074,34.694 c-4.804,12.035-13.703,19.76-25.494,24.496C663.406,669.946,663.072,669.921,663.008,669.929z M605.628,421.397 c0.963,4.05,2.046,7.475,2.561,10.983c1.789,12.183-2.256,21.521-15.65,24.141c-4.38,0.856-8.461,2.359-11.879,5.298 c-8.065,6.935-10.746,16.04-9.978,26.251c0.537,7.135,3.031,13.625,8.943,18.149c7.012,5.365,14.798,4.856,22.577,2.128 c19.232-6.746,29.46-26.586,24.763-47.405c-2.858-12.667-9.106-23.591-16.774-33.836 C608.833,425.295,607.366,423.566,605.628,421.397z M394.049,421.417c-6.855,8.215-12.873,16.908-17.128,26.736 c-3.265,7.541-5.247,15.325-5.182,23.644c0.136,17.333,10.931,32.072,27.48,37.161c10.059,3.093,18.936,0.843,24.504-6.399 c3.563-4.635,5.015-10.017,5.354-15.833c0.734-12.635-5.88-27.413-22.268-30.356c-11.702-2.102-17.405-10.878-15.455-22.681 C392.024,429.63,393.109,425.64,394.049,421.417z M385.188,614.35c-30.602,9.913-44.266,43.738-29.744,70.788 c13.506,25.16,32.758,44.557,58.68,56.919c16.505,7.872,33.85,10.102,51.838,6.574c11.664-2.287,22.316-7.104,32.274-13.49 c1.28-0.82,2.135-0.883,3.381-0.029c1.975,1.351,4.068,2.535,6.165,3.692c20.894,11.528,42.822,14.716,65.889,7.9 c14.798-4.372,27.73-12.192,39.306-22.259c13.833-12.029,25.468-25.849,33.104-42.676c8.517-18.77,3.709-41.744-11.356-55.673 c-12.316-11.388-27.147-15.468-43.479-14.71c-12.123,0.562-24.212,1.836-36.332,2.469c-15.026,0.785-30.035,0.18-45.006-1.363 c-3.883-0.4-7.802-1.142-11.661-0.929c-9.802,0.541-19.571,2.066-29.368,2.215c-13.484,0.203-26.987-0.346-40.471-0.874 c-7.413-0.29-14.802-1.199-19.317-1.584C399.026,611.195,392.012,612.139,385.188,614.35z M614.046,304.22 c-4.441-7.552-10.675-12.843-19.206-15.215c-5.954-1.655-12.028-1.494-18.089-0.922c-6.198,0.584-12.37,1.462-18.569,2.041 c-8.708,0.813-16.924-1.104-24.966-4.422c-5.063-2.089-10.335-3.744-15.624-5.186c-2.317-0.632-4.934-0.479-7.377-0.265 c-3.544,0.31-5.785,2.279-6.321,6.167c-0.924,6.702-1.378,13.469-2.005,20.211c-0.079,0.852-0.011,1.717-0.011,3.075 c-2.08-3.633-3.823-6.902-5.774-10.042c-4.486-7.22-10.406-12.706-18.816-15.042c-6.247-1.735-12.613-1.932-19.017-1.34 c-10.881,1.004-21.744,2.226-32.638,3.057c-6.35,0.484-12.85-0.287-19.098,0.692c-12.795,2.004-22.984,8.451-29.298,20.121 c-4.257,7.869-1.296,17.128,6.733,21.185c2.62,1.324,5.428,2.295,8.193,3.309c9.971,3.655,15.402,10.976,17.087,21.237 c0.75,4.566,3.28,7.726,7.163,9.913c6.563,3.695,13.806,4.717,21.17,5.343c2.07,0.176,4.465,0.445,6.056,1.585 c4.102,2.939,3.749,9.51-0.764,11.916c-2.781,1.482-6.159,2.074-9.346,2.527c-23.123,3.288-43.874,12.207-62.387,26.303 c-17.72,13.492-31.283,30.301-39.339,51.223c-1.911,4.962-3.122,10.194-4.659,15.3c-0.151,0.5-0.333,0.992-0.671,1.987 c-14.79-25.739-11.593-50.302,2.654-74.574c-7.669-6.593-10.705-15.2-10.515-25.115c0.199-10.346,5.33-17.771,13.816-23.23 c0.802-0.516,1.736-1.586,1.767-2.43c0.872-24.068,13.771-39.763,34.372-50.502c8.469-4.415,16.503-9.679,24.643-14.708 c8.296-5.126,16.499-10.51,26.149-12.688c6.912-1.56,13.954-2.592,20.975-3.604c9.8-1.413,18.569-4.963,26.196-11.385 c4.704-3.961,9.538-7.889,15.574-9.669c8.622-2.543,16.993-1.01,24.948,2.575c6.902,3.111,13.532,6.823,20.328,10.176 c10.314,5.09,21.436,7.675,32.565,10.14c10.117,2.241,20.345,3.996,30.433,6.356C603.153,283.308,610.116,292.33,614.046,304.22z M341.396,397.209c6.927,1.933,15.42-3.808,18.002-10.533c3.484-9.078-0.717-19.207-9.632-22.887 c-8.248-3.404-18.796,0.382-21.805,7.826c9.91-5.26,18.346-3.502,22.554,4.615C353.767,382.505,352.773,392.788,341.396,397.209z M333.249,382.019c2.373,0.034,4.197-1.644,4.25-3.911c0.056-2.4-1.807-4.32-4.182-4.311c-2.231,0.009-4.102,1.875-4.136,4.127 C329.145,380.24,330.878,381.985,333.249,382.019z M605.976,285.565c6.292,2.87,12.091,5.283,17.679,8.112 c12.737,6.448,24.342,14.432,33.104,25.961c7.495,9.863,11.641,20.86,10.715,33.422c-0.134,1.817,0.703,2.704,1.981,3.673 c8.49,6.434,13.247,14.796,12.889,25.667c-0.26,7.891-2.972,14.8-8.544,20.498c-0.494,0.505-0.962,1.036-1.38,1.487 c14.257,24.308,17.445,48.856,2.726,74.484c-1.533-5.072-2.716-9.767-4.365-14.293c-6.201-17.022-16.648-31.178-29.779-43.48 c-11.345-10.627-24.26-19.025-37.901-26.304c-8.729-4.657-18.408-6.692-27.949-8.955c-6.36-1.508-12.817-2.604-19.194-4.045 c-1.91-0.431-3.869-1.135-5.508-2.181c-5.003-3.195-5.851-7.113-2.87-12.218c3.534-6.053,8.322-10.506,15.719-10.576 c3.701-0.035,7.417,0.868,11.117,1.409c2.602,0.38,5.173,1.09,7.783,1.254c5.353,0.336,7.924-1.375,10.057-6.313 c1.296-3.001,2.515-6.035,3.785-9.047c2.637-6.249,7.107-10.496,13.625-12.553c1.821-0.575,3.605-1.282,5.378-2 c10.631-4.306,14.215-14.344,8.737-24.482c-3.886-7.191-9.742-12.597-16.043-17.592c-0.374-0.296-0.767-0.569-1.135-0.874 C606.496,286.533,606.45,286.376,605.976,285.565z M641.396,371.752c9.896-5.434,18.505-3.728,22.723,4.503 c4.164,8.126,0.637,16.222-9.132,20.958c5.196,1.796,14.711-2.42,17.915-10.289c3.563-8.745-0.271-18.921-8.859-22.804 C655.484,360.251,645.177,363.724,641.396,371.752z M646.895,382.019c2.46,0.021,4.282-1.746,4.246-4.115 c-0.034-2.191-1.926-4.08-4.114-4.106c-2.364-0.029-4.233,1.838-4.214,4.207C642.831,380.308,644.551,381.999,646.895,382.019z"></path></g></svg>
</span>
现在控制 <svg>
的宽度通过调整 wrapper 的宽度。
至于为什么更改 viewBox 不起作用,这是因为 <svg>
是一个文档,理论上它的大小是无限的,而 viewBox 只是你观看这个文档的窗口。 <svg>
不是图像。这是一个文档。
引用:为什么它需要 viewBox
(在评论中)。
答:它需要一个viewBox
因此您可以定义在您的上下文中打印的内容的大小,以便对其进行控制。如果你有 viewBox
然后使用 CSS 调整 <svg>
的大小您将根据 viewBox
之间的比率转换打印的内容和 <svg>
尺寸。没有 viewBox,您无法控制 svg 的内容。它始终以相同的尺寸打印,svg 单位和文档像素之间的比例为 1:1,并且 <svg>
在您的文档中充当 viewBox
.当更大时,您会看到所有内容,但它们不会拉伸(stretch)以适合。当较小时,内容将被裁剪。没有viewBox
您无法控制 <svg>
内容的大小.这就是为什么你需要 viewBox
.
关于html - 使用 viewBox 缩小 svg 图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48600276/
关闭。这个问题不满足Stack Overflow guidelines .它目前不接受答案。 想改善这个问题吗?更新问题,使其成为 on-topic对于堆栈溢出。 7年前关闭。 Improve thi
有两个 SVG 元素( SVG1 和 SVG2 ),其中 SVG1 是一个包含各种元素的大区域,会不时添加、删除和重新定位。另一方面,SVG2 需要用作 图标化表示(小) SVG1 的版本,非常小,但
我知道我们可以使用 document.createElementNS("http://www.w3.org/2000/svg","line"); 创建一个嵌入到html页面。 但是,这种方法似乎不适用
我正在尝试使用 Flutter SVG 依赖项,我将 svg 放入 Assets 中,在 pubspec.yaml 中设置,并在我的小部件中设置,但是,使用黑色容器加载 svg 我已经尝试过更改 sv
为什么这样的演示:http://jsbin.com/ejorus/2/edit,将元素嵌套在另一个元素内? JS
很难说出这里问的是什么。这个问题是含糊的、模糊的、不完整的、过于宽泛的或修辞性的,无法以目前的形式得到合理的回答。如需帮助澄清此问题以便重新打开它,visit the help center 。 已关
我正在尝试在 SVG 中做一些非常简单的事情: 将整个视口(viewport)分成两个矩形 每个矩形的宽度应为视口(viewport)宽度的 50% 每个矩形的高度应为视口(viewport)高度的
我试图将 play svg 居中放置在 SVG 圆圈的中间,但似乎不知道该怎么做。 垂直和水平。 https://jsfiddle.net/c0qshm0t/17/ 最
是否可以使用一个 SVG 形状作为另一个形状的填充? 最佳答案 您想使用 SVG Pattern .见 this example : 注意
我在 SVG 中有一个非常简单的路径。 (预览:https://i.imgur.com/nVnxcRg.png) 我想要
我可以通过以下方式创建多边形: #!/usr/bin/env python from shapely.geometry import Polygon area = Polygon(((52, 13),
我使用 require 的 SVG 没有显示。 在我的终端中,svg Assets 被发出并且路径在我的 html 中正确设置。 但是,SVG 不会显示,而其他格式(如 jpg 或 png)可以显示
我在 SVG 混合模式中遇到了问题。我在 SVG 中有四个路径,我想用公式组合它们:(1*2) + (3*4),即路径 1 和路径 2 应该使用乘法模式混合,类似地路径 3 和路径 4 应该使用混合相
我无法超过 2 个级别。 (在 Iceweasel 和 Chromium 上尝试过。) 作为测试,我尝试了 this earlier reply 中提供的代码的变体。 .这个由 3 个单独的文件组成,
请引用以下组中的clip-path 组 ID -> “container_svg_symbolGroup1_0(即圆圈符号)在我删除图表中可见的剪辑路径时不可见。 问题是什么?为什么
使用联合 js 在 svg 中创建了一个文本区域。但是,我无法在文本区域中输入任何文本。如何使文本区域可编辑? 代码: var graph = new joint.dia.Graph;
您可以不受限制地停止和重复动画,但如果您重新启动一个不确定的动画,它将失去其累积值并从初始值开始。 也许我应该用一个例子来澄清;拿这个动画: 如果我停止此动画,并开始影响同一对象旋转的不同动画(
如果我在浏览器中显示常规 SVG(作为独立文件或嵌入在 HTML 中),在拥有大量单独的路径元素和一个巨大的路径元素之间在效率上是否有任何理论上的差异? 我正在考虑将某种动画从一张图片变成一张完全不同
logo的turtlegraphics的svg路径中是否有等价物? 而不是硬编码的 x 和 y 坐标,这也迫使我在移动更相对的“增量”方法时调整控制点。 我的解决方案应该适用于 FOCS(Firefo
目前正在使用 SVG 元素与一堆 元素将使它具有一种逐渐变细的边缘。我尝试了很多不同的 CSS 样式来解决这个问题,但没有任何效果。这是一个带有针迹的圆圈的代码:
我是一名优秀的程序员,十分优秀!