Having trouble with my CSS styles not applying to a dialog modal added to my website using jQuery UI, even when using '!important'. I suspect that the predefined jQuery or UI CSS styles from a CDN link are preventing me from overriding them. The issue arises because the pop-up modal clashes with the site's CSS style. My goal is to give the modal a white background and blur the rest of the site until the user clicks outside the modal or closes it using the 'X' icon.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Hebrews 13:3 Prison Ministry</title>
<link rel="stylesheet" href="styles.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="6e0801001a0f190b1d01030b43081c0b0b2e5b405f5b405a">[email protected]</a>/css/fontawesome.min.css" integrity="sha384-jLKHWM3JRmfMU0A5x5AkjWkw/EYfGUAGagvnfryNV3F9VqM98XiIH7VBGVoxVSc7" crossorigin="anonymous">
<link href="https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,300;0,400;0,500;0,600;1,100&display=swap" rel="stylesheet">
<script src="https://code.jquery.com/jquery-3.6.0.js"></script>
<script src="https://code.jquery.com/ui/1.13.1/jquery-ui.js"></script>
<script>
$( function() {
$( "#dialog" ).dialog({
autoOpen: false,
show: {
effect: "blind",
duration: 1000
},
hide: {
effect: "fold",
duration: 1000
}
});
$( "#opener" ).on( "click", function() {
$( "#dialog" ).dialog( "open" );
});
} );
</script>
</head>
<body>
<!------ SECTION 1: HOME -- Header Class ------>
<a id="header"></a>
<section class="header">
<nav>
<a href="index.php"><img src="hb13/logo.png" /></a>
<div class="nav-links" id="navLinks">
<div class="search-login">
<div class="search">
<form action="#" method="POST">
<input type="text" placeholder="Search this site" name="search" >
<input type="submit" value="Search" for="search" class="submit">
</form>
</div>
<!------ Opens Sign in/up Modal ------>
<div class="login">
<a href="#" id="opener">Login | Register</a>
</div>
<div id="dialog" title="Basic dialog">
<p>This is an animated dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p>
</div>
</div>
<ul>
<i class="fa fa-times" onclick="hideMenu()"></i>
<li><a href="#">HOME</a></li>
<li><a href="#about">ABOUT</a></li>
<li><a href="#services">SERVICES</a></li>
<li><a href="#charity">CHARITY</a></li>
<li><a href="#updates">UPDATES</a></li>
<li><a href="#contact">CONTACT</a></li>
</ul>
<i class="fa fa-bars" onclick="showMenu()"></i>
</div>
<div class="text-box">
<h1>Hebrews 13:3</h1>
<h2>Prison Ministry</h2>
<p>"Remember those in prison, as if you were there yourself. <br>Remember also those being mistreated, as if you felt their pain in your own bodies." <br><br>- Hebrews 13:3 NLT -</p>
<a href="" class="hero-btn">Click Here to Veiw More</a>
</div>
</nav>
</section>
<hr>
<!-- SECTION 2: -->
<a id="about"></a>
<section class="about">
<h1>About the Ministry</h1>
<p>The Book of Hebrews in chapter 13 verse 3 speaks of remembering those in prison as if you were there yourself.<br> The founder of this ministry was in prison. That is where he found Christ, and that is where he saw the desparate need for Christ in the lives of those in captivity.<br> Captivity is a double edged sword, since it is possible to be a captive to no fault of your own, or to make yourself a captive. The thing is that- whether innocent or guilty- ALL people need Christ.<br><br> It is easy to to think of God as a mere crutch that get us through difficult times. It is easy for us, when things are going relativley well, to forget the need for a Source of Power.<br> </p>
<div class="row">
<div class="about-col">
<h3>Text</h3>
<p>text</p>
</div>
<div class="about-col">
<h3>Text</h3>
<p>text</p>
</div>
<div class="about-col">
<h3>Text</h3>
<p>text</p>
</div>
</div>
</section>
<a href="#header" class="align-right">Back to Top</a>
<hr>
<!-- SECTION: SERVICES -->
<a id="services"></a>
<section class="services">
<h1>Services</h1>
<p>text</p>
<div class="row">
<div class="services-col">
<img src="hb13/bible_image(5).jpg"/>
<div class="layer">
<h3>Prayer Requests and Tools</h3>
</div>
</div>
<div class="services-col">
<img src="hb13/bible_image(4).jpg"/>
<div class="layer">
<h3>Bible Studies and Bibles</h3>
</div>
</div>
<div class="services-col">
<img src="hb13/bible_image(2).jpg"/>
<div class="layer">
<h3>Other Services</h3>
</div>
</div>
</div>
</section>
<a href="#header" class="align-right">Back to Top</a>
<hr>
<!-- your content here... -->
<a id="charity"></a>
<section class="charity">
<h1>Charity</h1>
<p>text</p>
<div class="row">
<div class="charity-col">
<img src="hb13/charity(1).jpg" class="resize">
<h3>IMG</h3>
<p>text</p>
</div>
<div class="charity-col">
<img src="hb13/charity(2).jpg" class="resize">
<h3>IMG</h3>
<p>text</p>
</div>
<div class="charity-col">
<img src="hb13/charity.jpg" class="resize">
<h3>IMG</h3>
<p>text</p>
</div>
</div>
</section>
<a href="#header" class="align-right">Back to Top</a>
<hr>
<!-- your content here... -->
<a id="updates"></a>
<section class="updates">
<h1>Updates</h1>
<p>text</p>
<div class="row">
<div class="updates-col">
<img src="hb13/me_1.jpg">
<div>
<p>text</p>
<h3>IMG</h3>
</div>
</div>
<div class="updates-col">
<img src="hb13/me_3.jpg">
<div>
<p>text</p>
<h3>IMG</h3>
<!-- i class="fa fa-star"></i><i class="fa fa-star-o"></i><i class="fa fa-star-half-o"></i -->
</div>
</div>
</section>
<a href="#header" class="align-right">Back to Top</a>
<hr>
<!-- your content here... -->
<a id="contact"></a>
<section class="contact">
<h1>Contact Us</h1>
<a href="#" class="hero-btn">Contact Us</a>
</section>
<a href="#header" class="align-right">Back to Top</a>
<hr>
<!-- your content here... -->
<section class="footer">
<h4>Links</h4>
<p>footer text</p>
<div class="icons">
<a href=""><img src="hb13/fb.png"></a>
<a href=""><img src="hb13/twitter.png"></a>
<a href=""><img src="hb13/youtube.png"></a>
<a href=""><img src="hb13/in.png"></a>
</div>
<p>Made with Love by Magdi Kanaan</p>
</section>
<script type="text/javascript">
var navLinks = document.getElementById("navLinks");
function showMenu() {
navLinks.style.right = "0";
}
function hideMenu() {
navLinks.style.right = "-200px";
}
</script>
</body>
</html>
Understandably, I'm trying to address two specific issues:
1.) How to override the CSS styles for the Modal Pop-up considering the likelihood of pre-set styles from the jQuery or jQuery UI CDNs.
2.) How to implement a visual effect that blurs the remainder of the site while the Modal is active.