我在使用ion-slides
. 我正在使用这个 HTML 代码来创建一个简单的卡片:
<ion-header>
<ion-navbar>
<ion-title style="text-align:center;">Title</ion-title>
</ion-navbar>
</ion-header>
<ion-content class="tutorial-page">
<ion-card>
<ion-card-content>
<ion-card-title style="color:#000000;text-align:center;padding-top:10px; font-size: 24px; font-weight: bold;">
Title
</ion-card-title>
</ion-card-content>
</ion-card>
</ion-content>
正确的结果是: 正确显示卡片
但是当我尝试将这张卡嵌入ion-slides
宽度时很奇怪。它在横向上看起来很好,看起来它有一些固定的宽度。我不知道如何让它在肖像中工作。代码在这里:
<ion-header>
<ion-navbar>
<ion-title style="text-align:center;">Title</ion-title>
</ion-navbar>
</ion-header>
<ion-content class="tutorial-page">
<ion-slides>
<ion-slide>
<ion-card>
<ion-card-content>
<ion-card-title style="color:#000000;text-align:center;padding-top:10px; font-size: 24px; font-weight: bold;">
Title
</ion-card-title>
</ion-card-content>
</ion-card>
</ion-slide>
</ion-slides>
</ion-content>
结果如下所示: 奇怪的宽度
这里的 CSS:
.tutorial-page {
.toolbar-background {
background: #fff;
border-color: transparent;
}
.slide-zoom {
width: 100%;
height: 100%;
}
.slide-title {
margin-top: 2.8rem;
}
.slide-image {
max-height: 50%;
max-width: 60%;
margin: 18px 0;
}
b {
font-weight: 500;
}
p {
padding: 0 40px;
font-size: 14px;
line-height: 1.5;
color: #60646B;
b {
color: #000000;
}
}
}
感谢我能得到的任何帮助,安德烈