Показать сообщение отдельно
  #2 (permalink)  
Старый 04.08.2020, 02:01
Профессор
Отправить личное сообщение для laimas Посмотреть профиль Найти все сообщения от laimas
 
Регистрация: 14.01.2015
Сообщений: 12,989

Вы его воткнули в документ маленькой крохой и пытаетесь масштабировать, забывая о том, что он в рамках объекта.

<style>
.box {
    width: 600px;
    border: 1px solid red;
}

.box svg {
    width: 100%;
    height: auto;
}
</style>

<input type="number" min="400" max="800" step="50" value="600" id="scale" />

<div class="box">
<svg width="117.1" height="74.3" stroke-linecap="round" stroke-linejoin="round" preserveAspectRatio="none" version="1.2" viewBox="0 0 234.2 148.6" xmlns="http://www.w3.org/2000/svg">
 <path d="m140.2 41.8 1.4-0.9 2.3 4.7 15.9 23.6 8.3 5.8 2 0.2 9.8-2.8 1.2-0.8 1.5-1.6 0.2-0.8 0.1-0.7 0.2-0.5 0.8-0.2 0.3-0.3 0.9-1.2 0.2-0.3 0.2-1.5 0.5-1.4 0.7-1.2 0.9-0.6 1.3 0.2 0.2 0.7-0.5 1.2-0.3 1.5 0.4 0.9 1 0.8 4.2 2.5 2.1 0.8 2.1-0.5 1.6-2.1 0.7-2.4 0.2-0.3 1.6-1 1.1-1.2 1.1-0.4 6.4 0.1 0.8-0.5 0.9-0.7 0.9 0.2 0.4 1-0.4 1.4h0.7l0.5-0.4 0.5-0.5 0.6-0.2 1 0.2 1.8 1.2 1.1 0.3 3.3-0.8 1.1 0.2 1.4 1.9 0.9 0.8 0.9-0.2 1-1.1 0.9-0.1 0.9 0.5 0.8 0.9 1 2.7 0.4 1.9-0.5 0.8-1.8 0.5h-0.6l-0.7-0.1-1.6-0.9-1.3-0.2-1.1 0.2-0.7 0.9-0.3 1.5 0.2 0.6 0.4 0.3 0.1 0.4-0.3 0.6-0.5 0.3-1.3 0.1-0.4 0.2-0.8 1-0.6 1.6-0.4 1.7-0.5 4.6v1.7l0.3 1.7 1.5 1.7 0.7 1.2-0.1 1.2-0.7 0.7-4 1.5-5 0.2-0.6 0.2-0.5 0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m71.1 145.3-0.5-0.1-4.1-2-0.8-0.7-0.3-1.5-0.3-0.7-1.7-2.2-0.6-0.5-1 0.1-1.2 0.3-1.2 0.1-1-0.8-0.7-0.7-6-4.2-0.4-1v-0.9l0.2 0.2 1.7-0.3 0.4-0.3 1.3-0.9 0.5-0.1h1.8l0.4-0.3 0.8-0.3h2.8l1.2-0.5-0.8-0.3-1.8-0.3-0.5-0.5-0.1-1.1 0.5-1 0.7-0.8 0.5-0.8 0.2-1.3-0.1-0.8-0.6-1.6-0.3-2.2-0.3-1.1-0.5-1 0.5-0.4 0.1-0.3 0.2-0.4 0.4-1.6 0.5-1.4 0.7-1 0.6-0.2 0.6 2.6 2 0.2 3.2 2 0.8 2.9-4.3 2.6 0.7 4.6 4.7-0.4 2.3 3.3-2.1 3.3 0.9 2.2 2.2-0.2 0.5 1.9 1.5 0.4 2.1 5.5 0.5 1.9-3.7 0.5-1 0.5-0.1 1z" fill="#d5e3ef" stroke="#4682b4" stroke-width="1.731" data-id="UKR5482" data-name="Sevastopol" name="Sevastopol"/>
</svg>
</div>

<script>
scale.oninput = (a) => document.querySelector('div.box').style.width = a.target.value + 'px';
</script>


Здесь документ имеет размер svg (изменено) и масштабирование посредством css по родителю.

Последний раз редактировалось laimas, 04.08.2020 в 03:47.
Ответить с цитированием