如何使父浮动下的子元素全宽

时间:2019-11-02 11:38:04

标签: html css

我在浮动父项下有一个子元素。如何在不扩展父元素宽度的情况下使子元素变为全角?

现在怎么样

How it's now

我希望它如何工作-虽然没有浮动

How I want it to work-- this has no float though

唯一的解决方案是将其从父div中删除,我不希望这样做!

<div class="nome-squadra " style="float: left;">
  <p class="float-xl-left text orario mb-1">15:00 </p>
  <p class="text float-xl-left h4" id="nome-squadra">Roma - Napoli</p>
</div>
<div class="quoteCon" style="float: right;">
  <div class="quoteV container">
    <div class="row flex-row flex-nowrap esito"> code</div>
    <div class="row flex-row flex-nowrap quota" id="Roma - Napoli"></div>
  </div>
  <div class="accordion pt-2" id="accordionTest0">
    <div id="quote0" class="collapse-div collapse show" role="tablist" style="">rest of code</div>

  </div>

1 个答案:

答案 0 :(得分:0)

u可以将col-12用于父级。$.ajax({ url:'/inscription', // if you can use $('#YOUR_FORM').attr('action') method: 'POST', data: $('#YOUR_FORM').serialize() .... }); 还有适合自己风格的孩子<div class="col-md-12 col-lg-12 nome-squadra " style="float: left;"> ... 并将<div class="col-md-12 col-lg-12 quoteCon" style="float: right;">用于内部元素!