Am trying to spruce up my tribute page to practice the basics of html and css styling. I’m having a hard time centering the caption text after my image. I can post the the whole html file but I’ll just include the section that include the image and the caption text after the image.
Let me know what I’m doing wrong.
Here is the html:
<div id="img-div" class="center">
<img src="file:///Users/nersesarslanian/Downloads/LudWitt.jpg" alt="Ludwig_Wittgenstein" id="image">
<div id="img-caption" ><p class="bold">Wittgenstein's Life and Work</p>
</div>
</div>
This is the CSS:
img {
display:block;
margin-left: auto;
margin-right: auto;
max-width: 100%;
padding-bottom: 15px;
}
.img-div {
margin: auto;
}
.img-caption{
font-size: 80%;
text-align: center;
}
.center {
display: block;
margin-left: auto;
margin-right: auto;
width: 50%;
}