squareImage { border: 1px solid #ddd; /* thickness and color of border */ border-radius: 4px; /* edge rounding of border */ width: 150px; /* width of image (px or % or auto) */ height: auto; /* height of image (px or % or auto) */ }
.element { background-image: url("imageFile.png"); }
background-image: url('images/my-image.png');
img { width: width; height: height; }
background-image: url(file name or url); background-repeat: no-repeat; background-position: center;
.parent { position: relative; top: 0; left: 0; } .image1 { position: relative; top: 0; left: 0; border: 1px red solid; } .image2 { position: absolute; top: 30px; left: 30px; border: 1px green solid; }