//script
case "btn-download": {
html2canvas(document.getElementById("container-image")).then(function (canvas) {
var a = document.createElement("a");
a.href = canvas.toDataURL("image/png");
a.download = "New image.png";
a.click();
});
break;
}
//html
//css
#container-image {
width: fit-content;
height: fit-content;
min-height: 20px;
background-color: rgb(124, 124, 124);
text-align: center;
margin: 0 auto;
padding: 10px;
border: 2px solid rgb(255, 255, 255);
border-radius: 5px;
}
#tab-title {
font-size: 30px;
font-weight: bold;
text-align: center;
background: none;
border: none;
margin-bottom: 10px;
}
#tab-title::placeholder {
color: rgb(68, 68, 68);
}
< /code>
на странице < /p>
Загружено < /p>
Я создаю кнопку, которая захватывает Div, но когда я увеличивает размер шрифта, он вырезал верхнюю часть текста. Чтобы уменьшить размер шрифта. Как это исправить?
Подробнее здесь: https://stackoverflow.com/questions/757 ... tml2canvas
Текст обрезается при захвате div с помощью html2canvas ⇐ Html
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение