Alerts can be used to get the alert messages which can be displayed with the strong colors The perfect alert can be displayed by using the
w3-panel and
w3-container. The image below demonstrates the Alerts with strong colors as shown below.
The code below demonstrates to display the alerts with strong colors by using the w3-panel as shown.
[html]
<!DOCTYPE html>
<html>
<title>W3.CSS</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://www.w3schools.com/lib/w3.css">
<body>
<div class="w3-container">
<h2>Displaying Alerts</h2>
<p>The w3-panel class can be used to display alerts:</p>
<div class="w3-panel w3-red">
<h3>Danger!</h3>
<p>Red indicates a dangerous or negative situation.</p>
</div>
<div class="w3-panel w3-yellow">
<h3>Warning!</h3>
<p>Yellow or orange indicates a warning then need to be attention.</p>
</div>
<div class="w3-panel w3-green">
<h3>Success!</h3>
<p>Green indicates something successful or positive.</p>
</div>
<div class="w3-panel w3-blue">
<h3>Info!</h3>
<p>Blue indicates a neutral informative change or action.</p>
</div>
</div>
</body>
</html>
[/html]
Result
By running the above code in a preferred browser user can get the following output as shown in below image.
The code below demonstrated to display the alerts with strong color by using the w3-container as shown.
[html]
<!DOCTYPE html>
<html>
<title>W3.CSS</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://www.w3schools.com/lib/w3.css">
<body>
<div class="w3-container">
<h2>Displaying Alerts</h2>
<p>The w3-container class can also be used to display alerts:</p>
<div class="w3-container w3-red">
<h3>Danger!</h3>
<p>Red indicates a dangerous or potentially negative action.</p>
</div>
<div class="w3-container w3-yellow">
<h3>Warning!</h3>
<p>Yellow or orange indicates a warning then need to be attention.</p>
</div>
<div class="w3-container w3-green">
<h3>Success!</h3>
<p>Green indicates something successful or positive.</p>
</div>
<div class="w3-container w3-blue">
<h3>Info!</h3>
<p>Blue indicates a neutral informative change or action.</p>
</div>
</div>
</body>
</html>
[/html]
Result
By running the above code in a preferred browser user can get the following output as shown in below image.
[/post_flow_step]
Description
User can get the alert messages in required boxes which can be rectangular box either rounded corner boxes by using the
w3-round class. The code below demonstrates to get the alert boxes with round corners as shown below.
[html]
<!DOCTYPE html>
<html>
<title>W3.CSS</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://www.w3schools.com/lib/w3.css">
<body>
<div class="w3-container">
<h2>Rounded Alerts</h2>
<p>Use the w3-round classes if you want rounded alerts:</p>
<div class="w3-panel w3-blue w3-round">
<h3>Info!</h3>
<p>Here w3-round is used.</p>
</div>
<div class="w3-panel w3-blue w3-round-large">
<h3>Info!!</h3>
<p>Here w3-round-large is used.</p>
</div>
<div class="w3-panel w3-blue w3-round-xxlarge">
<h3>Info!</h3>
<p>Here w3-round-xxlarge is used.</p>
</div>
</div>
</body>
</html>
[/html]
Result
By running the above code in a preferred browser user can get the following output as shown in below image.