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 restrict access to the page Access only for logged user in Django
- Migration admin.0001_initial is applied before its dependency admin.0001_initial on database default
- Add or change a related_name argument to the definition for 'auth.User.groups' or 'DriverUser.groups'. -Django ERROR
- Addition of two numbers in django python
- The request was aborted: Could not create SSL/TLS secure channel -Error in Asp.net
- FieldError: Cannot resolve keyword 'id' into field in Django project
- How to hide the ID field from the Django admin?
- It is impossible to add a non nullable field without specifying a default. Django error
Related Article