max-height从底部裁剪图像,如何从顶部裁剪?

时间:2016-07-29 03:00:35

标签: html css twitter-bootstrap height carousel

有这个html / css代码:

var startTime = new Date(yourDate);
startTime.setHours(yourHours); // string or int
startTime.setMinutes(yourMinutes); // string or int

我们有这个结果

enter image description here

像这样修改css:

<!DOCTYPE html>
<html>
<head>    <style>
img {
max-height: 100px;
overflow: auto;
}
</style>
</head>
<body>

<img src="http://www.wwwwwww.com//photos/foto.PNG" />

</body>
</html>

我们有这个结果

enter image description here

我需要做些什么来获得这个结果?:

enter image description here

我找到了剪辑属性,但我使用的是Bootstrap轮播,我想在这个元素上实现这个必需的方法,你知道它是否可能?

1 个答案:

答案 0 :(得分:-1)

我不确定它是否正是您正在寻找的,但通过将其包装在具有少量css属性的<div>标记中,您可以实现此效果。

我不喜欢尺寸的静态性质,所以如果你需要更有活力的东西,请继续寻找,但这应该让你开始。

https://jsfiddle.net/e9jmrkkn/25/