/* img {
    top: 0;
    right: 0;
    position: absolute;
    padding: 10px;
} */
#box {
    width: 745px;
    height: 505px;
    top: 10px;
    right: 10px;
    background-color: white;
    position: absolute;
}
#box::after {
    content: '';
    position: absolute;
    background-image: url(image.jpg);
    width: 100%;
    height: 100%;
    opacity: 0.2;
    transition: 0.5s;
}
#box:hover::after {
    opacity: 1;
}
@media screen and (max-width: 900px) {
    #box {
        top: 100px;
        left: 10px;
    }
 }