Yes you can do it by over-riding the default
window.alert
method of a browser.
Check
Custom Alert Demonstration[
^] for learning it in details.
The css used to color and change format is as below...
#modalContainer {
background-color: transparent;
background-image: url("tp.png");
height: 100%;
left: 0;
position: absolute;
top: 0;
width: 100%;
z-index: 10000;
}
#alertBox {
background-color: #F2F5F6;
background-image: url("alert.png");
background-position: 20px 30px;
background-repeat: no-repeat;
border: 2px solid #000000;
margin-top: 50px;
min-height: 100px;
position: relative;
width: 300px;
}
#modalContainer > #alertBox {
position: fixed;
}
#alertBox h1 {
background-color: #78919B;
border-bottom: 1px solid #000000;
color: #FFFFFF;
font: bold 0.9em verdana,arial;
margin: 0;
padding: 2px 0 2px 5px;
}
#alertBox p {
font: 0.7em verdana,arial;
height: 50px;
margin-left: 55px;
padding-left: 5px;
}
#alertBox #closeBtn {
background-color: #78919B;
border: 2px solid #000000;
color: #FFFFFF;
display: block;
font: 0.7em verdana,arial;
margin: 5px auto;
padding: 3px;
position: relative;
text-align: center;
text-decoration: none;
text-transform: uppercase;
width: 70px;
}
#mContainer {
border-bottom: 2px solid #000000;
border-top: 2px solid #000000;
font: 0.7em verdana,arial;
margin: auto;
padding: 5px;
position: relative;
width: 600px;
}
h1, h2 {
border-bottom: 1px solid #000000;
font: bold 1.5em verdana;
margin: 0;
padding: 4px;
}
code {
color: #006699;
font-size: 1.2em;
}
#credits {
border-bottom: 1px solid #000000;
border-top: 1px solid #000000;
font: 0.7em verdana;
height: 90px;
margin: 25px auto 0;
padding-top: 4px;
position: relative;
width: 350px;
}
#credits img {
border: 1px solid #000000;
float: left;
height: 79px;
margin: 5px 10px 5px 0;
width: 80px;
}
.important {
background-color: #F5FCC8;
padding: 2px;
}
code span {
color: green;
}
And the code for over-riding the default
window.alert
method of a browser is demonstrated there.
Thanks...