Materialise CSS:在移动设备中将水平卡片更改为垂直卡片

Materialize CSS: Change horizontal cards into vertical cards in mobile

我有一张 material 设计卡片,在桌面视图中最初是水平的。问题是我在 card-content 中有大量文本。因此,在移动设备中,水平卡片左侧的图像仍然很小,而大文本会扩展卡片,这看起来很奇怪。

<div class="card horizontal">
    <div class="card-image">
      <img src="src/lib/svg/undraw_science_fqhl.png">
    </div>
    <div class="card-stacked">
      <div class="card-content">
       <p>Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham.</p>
    </div>
    <div class="card-action">
     <a href="#">This is a link</a>
    </div>
  </div>
</div>

What I want is to make this horizontal is to change into vertical card in mobile like this:

我该如何解决这个问题?

您需要使用materialize grid 卡:

以下是您的代码解决方案: Code

Materialize card documentation

<div class="row">
    <div class="col s12 m7">
        <div class="card">
            <div class="card-image">
                <img src="images/sample-1.jpg">
                <span class="card-title">Card Title</span>
            </div>
            <div class="card-content">
                <p>I am a very simple card. I am good at containing small bits of information.
                I am convenient because I require little markup to use effectively.</p>
            </div>
            <div class="card-action">
                <a href="#">This is a link</a>
            </div>
        </div>
    </div>
</div>