How to add borders to Images | Using CSS
Often adding borders to images makes it look pretty and
professional, but it is a time consuming process to open and edit images in
photo editors. CSS makes it easier to add borders, Here is an example:
<body>
<img src="mypic.jpeg" id="myImageWithoutBorder"/>
<img src="mypic.jpeg" id="myImageWithBorder"/>
</body>
CSS Code:
#myImageWithBorder {
border-width: 2px;
border-style: solid;
border-color: #000000;
}
You
can also write compact version of CSS like this
img{border:2px
solid #000000;}
Comments
Post a Comment
Thanks for Visiting for any questions or suggestions please comment below
Cheers,