css - 调整 ionic 卡中的图像大小

标签 css angularjs image ionic-framework

我想显示一组图像,并在下面添加描述。我选择使用 Ionic 卡。 我得到了这个结果(第一张图片):

enter image description here

虽然我想保留现在的相同布局,并添加描述。

这是我的代码:

 <ion-content ng-controller="cityController">

    <div class="row">

        <div class="col col-33">
      <div class="list card">
        <div class="item item-body">
            <img  class="full-image"src="img/images/opera.jpg"/>
          This is a "Facebook" styled Card..
        </div>
      </div>
        </div>

        <div class="col col-33">
            <img src="img/images/basilique.jpg"/>
        </div>
        <div class="col col-33">
            <img src="img/images/hoteldeville.jpg"/>
        </div>
    </div>


    .center {
  text-align: center;

}

.col {

  overflow: hidden;
}

.row {

  overflow: hidden;
  height: 180px;
}

.fullscreen {
    width: 100%;
    height: 100%;
}

我该如何解决这个问题?

更新

picture

最佳答案

你必须稍微改变你的来源。 HTML 示例:

<div class="row">

  <div class="col col-33">
          <img  class="full-image" src="http://www.w3schools.com/css/img_fjords.jpg"/>
          <div class="card-description">This is a "Facebook" styled Card..</div>
  </div>
  <div class="col col-33">
    <img  class="full-image" src="http://www.w3schools.com/css/img_forest.jpg"/>
    <div class="card-description">This is a "Facebook" styled Card..</div>
  </div>
  <div class="col col-33">
    <img  class="full-image" src="http://www.w3schools.com/css/img_mountains.jpg"/>
    <div class="card-description">This is a "Facebook" styled Card..</div>
  </div>
</div> 

CSS 示例:

.col-33 {
  width: 33%;
  float:left;
}

.full-image {
  width: 100%;
  height: 100%;
}

.card-description {
  text-align: center;
}

现场演示 here 这只是它如何工作的一个示例。

更新:

要获得完整尺寸的图像,您需要将说明放在其上。 在这种情况下,需要此 CSS。

.col-33 {
  width: 33%;
  float:left;
  position: relative;
}

.full-image {
  width: 100%;
  height: 100%;
}

.card-description {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  text-align: center;
  padding: 5px;
  line-height: 1.5;
  background-color: rgba(255, 255, 255, 0.6);
}

关于css - 调整 ionic 卡中的图像大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36698925/

相关文章:

html - 如果 flex 子项的宽度加起来达到容器的 100%,如何在它们之间添加空间

javascript - 单选按钮在 wordpress 中显示和隐藏 div

css - Twitter Bootstrap 跨度类是否适合设置表格列宽?

javascript - 如何在 ng-repeat 中正确执行函数

javascript - Md-content 的宽度在 cordova 的应用程序中不是 100%

python - 值错误: operands could not be broadcast together with shapes (10) (11)

html - 为什么不使用多个 css 文件?

javascript - 隐藏在 Angular Bootstrap Accordion 中的动态内容

关于绘图和图像( Canvas 、SVG)的 HTML5 建议

ios - iOS-我们可以在运行时将矢量pdf转换为png吗?