简体   繁体   English

移动设备上的 SweetAlert 小,并调整 SweetAlert 图标的大小

[英]SweetAlert small on mobile devices, and Resize SweetAlert icons

I am linking to this SweetAlert library https://unpkg.com/sweetalert/dist/sweetalert.min.js , and when I display an alert on mobile, it displays very small.我正在链接到这个 SweetAlert 库https://unpkg.com/sweetalert/dist/sweetalert.min.js ,当我在移动设备上显示警报时,它显示的很小。 I have increased the text size, but the success, error, warning animations are very small.我增加了文本大小,但成功、错误、警告动画非常小。 How can I resize these animations, or make the alert mobile friendly?如何调整这些动画的大小,或使警报移动友好?

This is without CSS这是没有 CSS 没有 CSS

使用 CSS

And with CSS和 CSS

Found the same thing....发现一样的东西....

2 options: Add this in CSS: 2 个选项:在 CSS 中添加:

.swal2-popup {
font-size: 2rem;
}

or

Use these links for your cdn... and it will work....(but its sweet alert1)将这些链接用于您的 CDN ......它会起作用......(但它的甜蜜警报1)

https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert-dev.js https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert-dev.js

https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.css https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.css

Here are links for CDN for SweetAlert2:以下是 SweetAlert2 的 CDN 链接:

<script src="https://cdn.jsdelivr.net/npm/sweetalert2@7.12.15/dist/sweetalert2.all.min.js"></script>

<link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/sweetalert2@7.12.15/dist/sweetalert2.min.css'>

I got these links from here .我从这里得到了这些链接。

I got the same problem, because i forgot to include meta viewport tag...我遇到了同样的问题,因为我忘记包含元视口标签......

try inserting this into head of your page尝试将其插入页面的head

<meta name="viewport" content="width=device-width, initial-scale=1.0">

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM