0

I wrote this element with HTML and Bootstrap.

    <div class="container" align="center">
        <h3 class="column" style="padding: 30px"> My Projects </h3>

        <div class="container" align="center" style="width: 40%; border: 2px solid #00CC11">
            <img src="./images/rectsimg.png" alt="Rects-Fight" style="float: left; width: 50%">
            <a href="./python/rects-fight.html" style="float: right; padding-right: 12%"> Rects Fight! </a>
        </div>
    </div>

What should occur is that the image and link should appear inside the div, therefore inside the borders of the div when rendered.

Instead for some reason it ends up like this, with the elements outside of the div instead of the inside:

Issue

Ive checked the HTML code and everything seems syntactically correct, what could I be doing wrong?

Mercury Platinum
  • 1,549
  • 1
  • 15
  • 28

1 Answers1

1

Just a suggestion should be correct add the ; at the end of each style

<div class="container" align="center">
    <h3 class="column" style="padding: 30px;"> My Projects </h3>

    <div class="container" align="center" style="width: 40%; border: 2px solid #00CC11;">
        <img src="./images/rectsimg.png" alt="Rects-Fight" style="float: left; width: 50%;">
        <a href="./python/rects-fight.html" style="float: right; padding-right: 12%;"> Rects Fight! </a>
    </div>
</div> 
ScaisEdge
  • 131,976
  • 10
  • 91
  • 107