Bulma - 使用is-desktop类在平板电脑模式下仍然应用了列大小的一半

问题描述 投票:0回答:2

我有两个列(一个有is-half类),我希望在移动和平板电脑模式下“堆叠”(一个在彼此之上)。

从我使用<div class="columns is-desktop"></div>的文档中可以看出它没有正常工作..在平板电脑上,列是堆叠的,但第一列有is-half类,仍然是一半大小。

这是一个说明问题的片段:

<link href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.6.1/css/bulma.css" rel="stylesheet"/>
<div class="container">
  <div class="columns is-desktop">
    <div class="column is-half">
    Lorem, ipsum dolor sit amet consectetur adipisicing elit. Eligendi nostrum voluptatum porro maiores animi dignissimos amet consectetur cumque sapiente eos, explicabo, accusamus modi mollitia labore corporis inventore eveniet esse quam?
    </div>
    <div class="column">
    Lorem ipsum dolor sit amet consectetur adipisicing elit. Iusto alias necessitatibus doloremque magni minima nobis facere, quibusdam autem eveniet voluptatum amet explicabo voluptates, laudantium praesentium? Ab repellat eius doloremque labore.
    </div>
  </div>
</div>

或者JSFiddle Example

我希望qazxsw poi列在平板电脑模式下为全宽。

html css bulma
2个回答
2
投票

这不是一个bug。这是预期的行为。

is-half

<div class="columns is-desktop"></div>直到桌面

display: block

@media screen and (min-width:1024px){.columns.is-desktop{display:-webkit-box;display:-ms-flexbox;display:flex}} .is-half

width: 50%

就像是

.column.is-half,.column.is-half-tablet{-webkit-box-flex:0;-ms-flex:none;flex:none;width:50%}
div {
  border: 1px solid;
}

.half {
  width: 50%;
}

<div class="half">half</div> <div>fullwidth</div>768px之间。

(不要设置1024px

.is-half

如果您想要其他尺码,例如对于桌面,使用<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.6.1/css/bulma.min.css"> <div class="container"> <div class="columns is-desktop"> <div class="column"> Lorem, ipsum dolor sit amet consectetur adipisicing elit. Eligendi nostrum voluptatum porro maiores animi dignissimos amet consectetur cumque sapiente eos, explicabo, accusamus modi mollitia labore corporis inventore eveniet esse quam? </div> <div class="column"> Lorem ipsum dolor sit amet consectetur adipisicing elit. Iusto alias necessitatibus doloremque magni minima nobis facere, quibusdam autem eveniet voluptatum amet explicabo voluptates, laudantium praesentium? Ab repellat eius doloremque labore. </div> </div> </div>

.is-x-desktop

2
投票

将班级名称<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.6.1/css/bulma.min.css"> <div class="container"> <div class="columns is-desktop"> <div class="column is-8-desktop"> Lorem, ipsum dolor sit amet consectetur adipisicing elit. Eligendi nostrum voluptatum porro maiores animi dignissimos amet consectetur cumque sapiente eos, explicabo, accusamus modi mollitia labore corporis inventore eveniet esse quam? </div> <div class="column"> Lorem ipsum dolor sit amet consectetur adipisicing elit. Iusto alias necessitatibus doloremque magni minima nobis facere, quibusdam autem eveniet voluptatum amet explicabo voluptates, laudantium praesentium? Ab repellat eius doloremque labore. </div> </div> </div>更改为is-half

is-half-desktop

<div class="container"> <div class="columns is-desktop"> <div class="column is-half-desktop"> Lorem, ipsum dolor sit amet consectetur adipisicing elit. Eligendi nostrum voluptatum porro maiores animi dignissimos amet consectetur cumque sapiente eos, explicabo, accusamus modi mollitia labore corporis inventore eveniet esse quam? </div> <div class="column is-half-desktop"> Lorem ipsum dolor sit amet consectetur adipisicing elit. Iusto alias necessitatibus doloremque magni minima nobis facere, quibusdam autem eveniet voluptatum amet explicabo voluptates, laudantium praesentium? Ab repellat eius doloremque labore. </div> </div> </div>

© www.soinside.com 2019 - 2024. All rights reserved.