I have been trying to center an image both horizontally and vertically, but it seems like my code is not working properly. Here is what I have so far:
#parent {
position: relative;
float: left;
width: 700px;
height: 400px;
overflow: hidden;
background-color: black;
}
#parent img {
max-height: 400px;
max-width: 700px;
}
Keep in mind that the height and width of the image are dynamic.