我不知道如何制作这个3列布局

发布于 2025-01-24 16:58:07 字数 1265 浏览 0 评论 0 原文

我对这个3列布局有问题。我尝试了一些东西,但出了问题。 你能帮我吗?我不知道该怎么办。如果您能提供帮助,我会很高兴。Adress和开放时间之间的差距如此之大,我也不知道如何将更多的日子和开放时间移到右边。现在它不清楚,凌乱。 例子: https://i.sstatic.net/msvh7.png

我的代码:

  <div class="container">
    <div class="columnn">
    <p> 
      Ruckholt Road 28</br>
      Leyton London</br>
      United Kingdom</br>
    </p>
    </div>
    <div class="columnn">
    <p>     
      Monday</br>
      Tuesday</br>
      Wednesday</br>
      Thursday</br>
      Friday</br>
      Saturday</br>
      Sunday</br>
    </p>
    </div>
    <div class="columnn">
    <p>
      11:00 - 15:30</br>
        12:00 - 18:00</br>
        Closed</br>
        12:00 - 18:00</br>
        11:00 - 14:30</br>
      Closed</br>
        Closed</br>
    </p>
    </div>
 </div>
  .columnn {
      flex: 33.33%;
      padding: 0px;
      margin: 0px;
    }
    .container {
    font-size: 20px;
    text-align: center;
    margin: 0 30%;
       display: flex;
    }

i have problem with this 3 column layout. I have tried something but it went wrong.
Can you help me please with this. I dont know what to do anymore. I will be so happy if you can help.There is so big gaps between adress and opening time also i dont know how to move more days and opening time to the right. Now its not clear and its messy.
Example:
https://i.sstatic.net/MSvH7.png

my code:

  <div class="container">
    <div class="columnn">
    <p> 
      Ruckholt Road 28</br>
      Leyton London</br>
      United Kingdom</br>
    </p>
    </div>
    <div class="columnn">
    <p>     
      Monday</br>
      Tuesday</br>
      Wednesday</br>
      Thursday</br>
      Friday</br>
      Saturday</br>
      Sunday</br>
    </p>
    </div>
    <div class="columnn">
    <p>
      11:00 - 15:30</br>
        12:00 - 18:00</br>
        Closed</br>
        12:00 - 18:00</br>
        11:00 - 14:30</br>
      Closed</br>
        Closed</br>
    </p>
    </div>
 </div>
  .columnn {
      flex: 33.33%;
      padding: 0px;
      margin: 0px;
    }
    .container {
    font-size: 20px;
    text-align: center;
    margin: 0 30%;
       display: flex;
    }

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

阳光下慵懒的猫 2025-01-31 16:58:07

我没有完全理解您的问题,但也许是这样的?

   <div class="container">
  <div class="columnn">
    <p>
      Ruckholt Road 28</br>
      Leyton London</br>
      United Kingdom</br>
    </p>
  </div>
  <div class="columnn">
    <h3> Opening Hours </h3>
    <p>
      Monday</br>
      Tuesday</br>
      Wednesday</br>
      Thursday</br>
      Friday</br>
      Saturday</br>
      Sunday</br>
    </p>
  </div>
  <div class="columnn">
    <p>
      11:00 - 15:30</br>
      12:00 - 18:00</br>
      Closed</br>
      12:00 - 18:00</br>
      11:00 - 14:30</br>
      Closed</br>
      Closed</br>
    </p>
  </div>
</div>
    .container {
  border: 1px solid blue;
  font-size: 20px;
  text-align: left;
  margin: 0 30%;
  display: flex;
  align-items: center;
}

.columnn {
  flex: 33.33%;
  padding: 0px;
  margin: 0px;
  border: 1px solid red;
  &:last-child {
    margin: 9% 0 0 0;
    text-align: right;
  }
}

I didn't fully understand your question but perhaps something like this?
https://codepen.io/i-empty/pen/abEejeQ?editors=1100

   <div class="container">
  <div class="columnn">
    <p>
      Ruckholt Road 28</br>
      Leyton London</br>
      United Kingdom</br>
    </p>
  </div>
  <div class="columnn">
    <h3> Opening Hours </h3>
    <p>
      Monday</br>
      Tuesday</br>
      Wednesday</br>
      Thursday</br>
      Friday</br>
      Saturday</br>
      Sunday</br>
    </p>
  </div>
  <div class="columnn">
    <p>
      11:00 - 15:30</br>
      12:00 - 18:00</br>
      Closed</br>
      12:00 - 18:00</br>
      11:00 - 14:30</br>
      Closed</br>
      Closed</br>
    </p>
  </div>
</div>
    .container {
  border: 1px solid blue;
  font-size: 20px;
  text-align: left;
  margin: 0 30%;
  display: flex;
  align-items: center;
}

.columnn {
  flex: 33.33%;
  padding: 0px;
  margin: 0px;
  border: 1px solid red;
  &:last-child {
    margin: 9% 0 0 0;
    text-align: right;
  }
}

赠佳期 2025-01-31 16:58:07

也许是这样的?这是您提供的代码的基础。让我知道

.columnn {
      padding: 0px;
      margin: 0px;
    }



.col-2 {
    display: flex;
    justify-content:space-evenly; 
    grid-gap:20px;
   
    }

.col-1 {
    display: grid;
    }

.container {
    font-size: 20px;
    text-align: left;
    margin: 0 auto;
    display: flex;
    justify-content:space-evenly;
    }
<div class="container">
    <div class="columnn">
    <h2> Contact Information </h2>
     <div class="col-1">
      <p> 
      Ruckholt Road 28<br>
      Leyton London<br>
      United Kingdom
      </p>
     </div>
    </div>
    

         
    <div>
    <h2> Hours Open </h2>
      <div class="col-2">
      <p>     
      Monday<br>
      Tuesday<br>
      Wednesday<br>
      Thursday<br>
      Friday<br>
      Saturday<br>
      Sunday
      </p>

      <p>
      11:00 - 15:30<br>
      12:00 - 18:00<br>
      Closed<br>
      12:00 - 18:00<br>
      11:00 - 14:30<br>
      Closed<br>
      Closed
      </p>
    </div>
    
 </div>
  </div>

Maybe something like this?? This is base on your code provided. Let me know

.columnn {
      padding: 0px;
      margin: 0px;
    }



.col-2 {
    display: flex;
    justify-content:space-evenly; 
    grid-gap:20px;
   
    }

.col-1 {
    display: grid;
    }

.container {
    font-size: 20px;
    text-align: left;
    margin: 0 auto;
    display: flex;
    justify-content:space-evenly;
    }
<div class="container">
    <div class="columnn">
    <h2> Contact Information </h2>
     <div class="col-1">
      <p> 
      Ruckholt Road 28<br>
      Leyton London<br>
      United Kingdom
      </p>
     </div>
    </div>
    

         
    <div>
    <h2> Hours Open </h2>
      <div class="col-2">
      <p>     
      Monday<br>
      Tuesday<br>
      Wednesday<br>
      Thursday<br>
      Friday<br>
      Saturday<br>
      Sunday
      </p>

      <p>
      11:00 - 15:30<br>
      12:00 - 18:00<br>
      Closed<br>
      12:00 - 18:00<br>
      11:00 - 14:30<br>
      Closed<br>
      Closed
      </p>
    </div>
    
 </div>
  </div>

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文