In some situation we needed to apply border over the image for the particular div element id in jquery.We can set multiple css properties to border over image using jquery on pageload.
Example:
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Animated borderover image using css</title>
<script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
<script type="text/javascript">
$(function () {
$('#firstdiv').find('img').css("border", "solid 2px #2e9fff");
});
</script>
<style type="text/css">
.rect {
width: 350px;
height: 79px;
cursor: pointer;
padding: 5px;
}
</style>
</head>
<body style="border: 1px solid #DED8D8; width: 500px; height: 300px">
<h2 style="color: #FF5722;">apply border over image for aparticular div element</h2>
<div id="firstdiv" class="box">
<a href="http://www.infinetsoft.com/" title="header logo image">
<img src="http://www.infinetsoft.com/Images/logoinfi.png" class="rect" alt="header logo">
</a>
</div>
<div class="box">
<a href="http://www.infinetsoft.com/" title="footer logo image">
<img src="http://www.infinetsoft.com/Images/footer_logo1.png" class="rect" alt="footer logo">
</a>
</div>
</body>
</html>
Output:
Post your comments / questions
Recent Article
- How to add two numbers in Android Studio? | Source Code
- FindViewByID returns null in android studio -SOLVED
- Saving changes is not permitted in SQL SERVER - [SOLVED]
- Restore of database failed. File cannot be restored over the existing. -[SOLVED]
- One or more projects in the solution were not loaded correctly in Visual Studio 2019 | FIXED
- How to find Laptop's Battery Health?
- SOLVED-Related Field got invalid lookup: icontains error in Django
- How to enable Search Feature in Django admin?
Related Article