首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在不破坏宽度的情况下调整pikaChoose插件的高度?

如何在不破坏宽度的情况下调整pikaChoose插件的高度?
EN

Stack Overflow用户
提问于 2012-09-25 22:29:53
回答 1查看 2.3K关注 0票数 2

我忠实地遵循了这个教程:http://www.icodeya.com/2012/08/grails-creating-image-gallery-feat.html关于如何在grails中添加图片库功能。它的效果很好,但我想调整主(大)图像的高度。我成功地做到了,但当我上传超过默认宽度的图片时,它会破坏整个布局。例如,图像的一部分将从布局的其余部分溢出。我想这更多的是一个css问题..而且我的CSS也很烂。代码如下。可以在这里看到一个很好的演示:http://www.pikachoose.com/请注意,如果我将宽度更改为100%,高度就会变得不一致。:(

*如果没有图片,请上传图片,自己看看。

有人想帮我吗?:D

我提供免费的饼干。:) :)

代码语言:javascript
复制
@charset "UTF-8";
/* Just for the example. Fee free to delete these three lines */
body{font-family:Helvetica, sans-serif;}
a{color:white;}
.pikachoose {width: 800px; margin: 20px auto 20px auto;}

/* Style the thumbnails */
.pika-thumbs{ padding: 0 16px; height: 75px; margin-top: 10px; width: 100%;}
    .pika-thumbs li{ width: 144px; height:74px; margin: 5px; padding: 2px; overflow: hidden;
        float: left; list-style-type: none; background: #fafafa; border: 1px solid #e5e5e5; cursor: pointer;}
    .pika-thumbs li:last {margin: 0;}
    .pika-thumbs li .clip {position:relative;height:100%;text-align: center; vertical-align: center; overflow: hidden;}

/* The stage is the wrapper. The image fills 100% the height of the stage */
.pika-stage, .pika-textnav {width: 800px;}
.pika-stage {overflow:hidden; position: relative; background: #fafafa; border: 1px solid #e5e5e5; padding: 10px 10px 40px 10px; text-align:center; height:400px;}
.pika-stage img{height:100%;}
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-09-25 23:05:12

从演示中看,主图像的舞台看起来是800px,所以只需为出现在主舞台上的图像添加一个最大宽度:

..pika stage img {高度: 100%;最大宽度: 800px;/*与主舞台宽度相同,图像不会拉伸超过*/ }

票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/12585165

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档