- W3.CSS - Home
- W3.CSS - Overview
- W3.CSS - Environment Setup
- W3.CSS - Containers
- W3.CSS - Code Coloring
- W3.CSS - Cards
- W3.CSS - Responsive Design
- W3.CSS - Grids
- W3.CSS - Forms
- W3.CSS - Buttons
- W3.CSS - Tooltips
- W3.CSS - Modal Dialog
- W3.CSS - Tables
- W3.CSS - Lists
- W3.CSS - Images
- W3.CSS - Icons
- W3.CSS - Colors
- W3.CSS - Navigation
- W3.CSS - Utilities
- W3.CSS Useful Resources
- W3.CSS - Quick Guide
- W3.CSS - Useful Resources
- W3.CSS - Discussion
W3.CSS - Modal Dialog
W3.CSS can be used to display a customizable modal dialog box instead of the standard JavaScript alert.
It uses w3-row and w3-col style classes to define rows and columns respectively.
| Sr. No. | Class Name & Description |
|---|---|
| 1 |
modal-dialog Represents the main parent window to define a dialog box. |
| 2 |
w3-modal-dialog Represents the dialog content container. |
| 3 |
w3-modal-content Represents dialog contents. |
Example
w3css_modal_dialog.htm
<html>
<head>
<title>The W3.CSS Modal dialog</title>
<meta name = "viewport" content = "width = device-width, initial-scale = 1">
<link rel = "stylesheet" href = "https://www.w3schools.com/lib/w3.css">
</head>
<body class = "w3-container">
<h2>Modal dialog Demo</h2>
<a class = "w3-btn w3-teal" href = "#model-dialog">Open a Modal dialog</a>
<div id = "model-dialog" class = "w3-modal">
<div class = "w3-modal-dialog">
<div class = "w3-modal-content w3-card-8">
<header class = "w3-container w3-teal">
<a href = "#" class = "w3-closebtn"></a>
<h2>TutorialsPoint</h2>
</header>
<div class = "w3-container">
<p>Hello World!</p>
</div>
<footer class = "w3-container w3-teal">
<p>@TutorialsPoint.COM</p>
</footer>
</div>
</div>
</div>
</body>
</html>
Result
Verify the result.
Advertisements