u/Fun-Spare8427

▲ 2 r/HTML

https://preview.redd.it/tmpwsbxyknxg1.png?width=840&format=png&auto=webp&s=8d701605aaea9f8a7f651a0d1f7e6112d15b4d1e

I am using a three column div, which encompasses one normal div, a two column div, and another single column div containing an img. I'm wondering why the img is so close to the center as if it is in a two column div. this is forcing the center two column div to be crushed. the first single div is in the correct spot. the img and its container both float right.

HTML:

<!DOCTYPE html>
<html lang="en-US">
    
  <head>
    <meta charset="utf-8">
    <title>YouTube</title>
    <link rel="stylesheet" href="Youtube.css">
  </head>
  
  <body>
      <!--takes up 30%of the screen (horz)-->
      <div class="three_column" style="height:30%;">
          <div style="float: left;">
              <a href="www.youtube.com"><img src="YTlogo(dark).png" alt="YouTube" style="width:100%; margin-left:5%; margin-right:5%"></a>
          </div>
          <div class="two_column">
              <div class="clock">
                  <p>time</p>
                  <span id="hrs">00</span>
                  <span>:</span>
                  <span id="min">00</span>
                  <span id="hem">am</span>
              </div>
              <script>
                    document.addEventListener('DOMLoaded', function() {
                        console.log("DOM Loaded");
                    });

                    let currentTime = new Date();

                    let hrs = document.getElementById("hrs");
                    let min = document.getElementById("min");
                    let hem = document.getElementById("hem");

                    const dn = ["am", "pm"];

                    console.log(currentTime.getHours());
                    console.log(currentTime.getMinutes());

                    setInterval(()=>{
                        let currentTime = new Date();
                        hrs.innerHTML = currentTime.getHours();
                        min.innerHTML = currentTime.getMinutes();

                        if (currentTime.getHours > 12) {
                            hem.innerHTML = dn[2];
                            hrs.innerHTML = (currentTime.getHours() - 12);
                        }
                        else {
                            hem.innerHTML = dn[1];
                            hrs.innerHTML = (currentTime.getHours() - 12);
                        }
                    },1000);
              </script>
            </div>
          <div style="float: right">
              <img src="4:3.jpg" alt="Video preview on this site hos broken." style="width:80%; float:right;">
          </div>
      </div>
      <!--takes up half the screen (horz)-->
      <main>
          <!--cut into 4 segments, like an excel-->
          <!--channel segment-->
          <!--next 30 min-->
          <!--30 min after-->
          <!--one hour after-->
      </main>
      <!--takes up 20% of the screen (horz)-->
      <!--shows one ad-->
      <footer></footer>
  </body>
</html>

CSS:

html{
    background-color:#11284A;
    
    font-family:Arial;
    font-weight: bold;
    color:#D6E1E7;
}

.two_column {
    column-count: 2;
    column-gap: 3px;
}
.three_column {
    column-count: 3;
    column-gap: 3px;
}
reddit.com
u/Fun-Spare8427 — 18 days ago