As I work on building my website, I am faced with the challenge of aligning a button directly under an image. I have utilized HTML tags and assigned a class to it for CSS styling purposes. However, when it comes to setting the alignment using the 'text-align' property in CSS, I find myself limited to just 'center', 'right', or 'left'. I attempted to specify a value in pixels (e.g., 30px), but unfortunately that did not yield the desired outcome. Below is an image showcasing a portion of the website layout.
CSS:
.imgButton{
text-align:right;
}
HTML:
<img id="course-image2" src ="https://www.dhresource.com/0x0/f2/albu/g8/M00/2D/C9/rBVaVFz-C7KAY4jwAAEi8hE3J14252.jpg/men-suit-men-tuxedo-custom-made-wedding-suits.jpg" width="260" height="500" alt="guy2" class="center"/>
<div class="imgButton">
<button class="check">Gentleman</button>
</div>
Image (showcasing the 'Gentleman' button placed at the far right corner):