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>
When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks.
```
Your code goes here
```
You can also use the “preformatted text” tool in the editor ( </> ) to add backticks around text.
I did link styles.css I just didn’t include it in the post.
I didn’t realize I was selecting -img-caption and im-div as class when they were ids. I switched them to class and it worked. I just had to resize the picture to fit its parent div element.