Fernandez Fernandez - 3 months ago 7
HTML Question

horizontally Aligning three divs not working with only html

I have some code, and my

stylesheet.css
is not working so I figured out can't have css. I can only include html. I have 3
divs
and I need to put them in a horizontal align. How do I do this?

Here is my code.

<div>Div 1</div>
<div>Div 2</div>
<div>Div 3</div>


And my css which isn't working.

div {
height: 100px;
width: 100px;
background-color: red;
}


I need to horizontally align these 3 divs only with html.

Answer

This is a fairly easy problem to solve, and the table tag should help. The table tag does not use css.

div {
  height: 100px;
  width: 100px;
  background-color: red;
}
<table>
  <tbody>
    <tr>
      <td>
        <div>Div 1</div>
      </td>
      <td>
        <div>Div 2</div>
      </td>
      <td>
        <div>Div 3</div>
      </td>
      <tr>
  </tbody>
</table>