最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - SweetAlert small on mobile devices, and Resize SweetAlert icons - Stack Overflow

programmeradmin0浏览0评论

I am linking to this SweetAlert library .min.js, and when I display an alert on mobile, it displays very small. 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

And with CSS

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. 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

And with CSS

Share Improve this question edited Jun 20, 2020 at 9:12 CommunityBot 11 silver badge asked Feb 27, 2018 at 0:52 FrankFabregat2FrankFabregat2 3051 gold badge2 silver badges11 bronze badges 1
  • The answer above works BUT! since you use swal2-popup / font-size property have in mind that the alerts that have text on it like "warning or info" will change size too – NLZK98 Commented Nov 10, 2020 at 19:41
Add a comment  | 

3 Answers 3

Reset to default 6

Found the same thing....

2 options: Add this in CSS:

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

or

Use these links for your cdn... and it will work....(but its sweet alert1)

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

I got the same problem, because i forgot to include meta viewport tag...

try inserting this into head of your page

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

Here are links for CDN for SweetAlert2:

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/sweetalert2.all.min.js"></script>

<link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/[email protected]/dist/sweetalert2.min.css'>

I got these links from here .

发布评论

评论列表(0)

  1. 暂无评论