How to style default confirm box with only css?

情到浓时终转凉″ 提交于 2019-11-26 14:43:03
solendil

It is not possible. This window is displayed by the browser using the platform's UI kit. It's not in the DOM, not visible from the CSS or Javascript, there's nothing you can do.

However, some very simple jQuery code can do the trick. How about $('a').confirm(); ?

confirm(); alerts cannot be styled, they are generic to the browser. If you want to style an alert, try alternatives such as boxy, or the jQuery dialog box.

Here is a tutorial about how a custom confirm alert can be created in jQuery and styled with CSS.

This is a very old question. But I felt the need to pass this info here. I noticed that you can "style" the confirm with special characters, such as \n, \t, \r, ... so on.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!