亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

很難嘗試用彩色線條和元素制作一張桌子

很難嘗試用彩色線條和元素制作一張桌子

眼眸繁星 2023-06-09 17:33:31
這是我有疑問和我必須做的這是我到目前為止所做的我很難解決這個問題,我懷疑我如何才能在元素之間留出這個空間,還有這個用灰色和紅色著色的邊框以及它們兩者之間的垂直線,我只能用純 HTML、CSS 和 JS 來做到這一點沒有任何框架/lib/api。我嘗試過類似的方法,但仍然無法按我想要的方式工作,如果有人可以提供幫助,我將不勝感激    .table {    display: inline-flex;    margin-top: 0rem;       margin-left: 5rem;         }.fgraphs {    position: relative;    height: 20px;    width: 100px;  }  .fgraphs:before,  .fgraphs:after {    content: "";    position: absolute;    top: 50%;    right: 0;    transform: translateY(-50%);  }  .fgraphs:before {    border-bottom: 2px dashed #979797;    width: 100%;  }  .fgraphs:after {    border-bottom: 3.5px solid #F03D24;    width: 50%;    border-radius: 4px 0 0 4px;  }    <table class="table">            <tbody>                <tr>                    <td>Domingo</td>                    <td>Icone</td>                    <td>54%</td>                    <td><img src="./images/cloudy-day-3.svg" alt=""></td>                    <td>20oC</td>                    <td class="fgraphs"></td>                    <td>32oC</td>                </tr>                <tr>                    <td>Segunda</td>                    <td>Icone</td>                    <td>54%</td>                    <td><img src="./images/cloudy-day-3.svg" alt=""></td>                    <td>20oC</td>                    <td class="fgraphs"></td>                    <td>32oC</td>                </tr>                <tr>                    <td>Ter?a</td>                    <td>Icone</td>                    <td>54%</td>                    <td><img src="./images/cloudy-day-3.svg" alt=""></td>                    <td>20oC</td>                    <td class="fgraphs"></td>                    <td>32oC</td>                </tr>
查看完整描述

1 回答

?
開心每一天1111

TA貢獻1836條經驗 獲得超13個贊

我已經看到您已經為這種布局苦苦掙扎了幾天。以為我會有所幫助并向您展示 flexbox 的基本概念以及使用前后元素。


header,

.row {

  display: flex;

}


.col {

  flex: 1;

  padding: 1.2rem 0;

}


.barLeft {

  position:relative;

  border-right: 3px dashed #CCC;

  text-align: right;

}


.barRight {

  position:relative;

}


.barLeft::before, .barRight::before {

  position:absolute;

  content: '';

  top:50%;

  margin-top: -1px; /* half of the border */

  border-top: 2px dotted #CCC;

  left: 0;

  width: 100%;

  height:50%;

  z-index: -1;

}


.barRight span{

  position: relative;

  background-color: red;

  display: inline-block;

  height: 10px;

  margin-left: -1.5px; /* half the vert border */

  z-index: 1;

  border-radius: 0 5px 5px 0;

}


.barLeft span{

  position: relative;

  background-color: blue;

  display: inline-block;

  height: 10px;

  margin-left: -1.5px; /* half the vert border */

  z-index: 1;

  border-radius: 5px 0 0 5px;

  margin-right: -1.5px;

}

<section>

  <div class="row">

    <div class="col">FOOO</div>

    <div class="col">BAR</div>

    <div class="col">GOO</div>

    <div class="col">World</div>

    <div class="col barLeft"><span style="width:10%"></span></div>

    <div class="col barRight"><span style="width:50%"></span></div>

    <div class="col">100</div>

  </div>

  <div class="row">

    <div class="col">1</div>

    <div class="col">2</div>

    <div class="col">3</div>

    <div class="col">4</div>

    <div class="col barLeft"><span style="width:20%"></span></div>

    <div class="col barRight"><span style="width:30%"></span></div>

    <div class="col">7</div>

  </div>  

</section>


查看完整回答
反對 回復 2023-06-09
  • 1 回答
  • 0 關注
  • 139 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號