Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Move a div in HTML

I am a beginner of HTML and i want to know how to move a div to the right of another div here is the code i currently have:

.tile {
  background: rgb(80, 80, 80);
  width: 300px;
  height: 300px;
  border-radius: 15px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-right: auto;
}

.tile img {
  width: 50px;
}

a {
  color: #fff;
  text-decoration: none;
  padding: 50% 0;
}
<a href="https://classroom.google.com/u/0/h" target="blank_">
        <div class="tile">
            <img src="icons/classes.png" alt="Classroom Image">
      <p>Google Classroom</p>
    </div></a><br>
  <a href="https://wakeid2.wcpss.net/ui/applications" target="blank_">
        <div class="tile">
            <img src="icons/portal.png" alt="WakeID Portal Image">
      <p>WakeID Portal</p>
    </div></a><br>

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

If you want two boxes side by side then remove the br then wrap with a div and make it as flex.

Updated code :

.tile {
    background: rgb(80, 80, 80);
    width: 300px;
    height: 300px;
    border-radius: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: auto;

}

.tile img {
    width: 50px;
}

a {
    color: #fff;
    text-decoration: none;
}

.container {
    display: flex;
}
    <div class="container">
        <a href="https://classroom.google.com/u/0/h" target="blank_">
            <div class="tile">
                <img src="icons/classes.png" alt="Classroom Image">
                <p>Google Classroom</p>
            </div>
        </a>
        <a href="https://wakeid2.wcpss.net/ui/applications" target="blank_">
            <div class="tile">
                <img src="icons/portal.png" alt="WakeID Portal Image">
                <p>WakeID Portal</p>
            </div>
        </a><br>
    </div>
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading