简体   繁体   English

如何从javaScript中以html水平显示图像

[英]how to show images in horizontally in html from javaScript

i have list of images i just want to show them horizontally in HTML ,if it reaches width limit it need to add at bottom row 我有图像列表,我只想在HTML中水平显示它们,如果达到宽度限制,则需要在底部添加

and i have very big images how can i show them small with maintaining aspect ratio 我有很大的图像,如何在保持宽高比的情况下将它们显示的很小

Using CSS3 for example: 以CSS3为例:

.90deg_image_rotation { 
    -webkit-transform: rotate(90deg); 
    -moz-transform: rotate(90deg); 
    -o-transform: rotate(90deg);
    -ms-transform: rotate(90deg); 
}

It sounds like what you want is something like Freewall. 听起来您想要的是Freewall之类的东西。 It is a JQuery based plugin to handle the creation and management of grid systems. 它是一个基于JQuery的插件,用于处理网格系统的创建和管理。

You can use CSS. 您可以使用CSS。

Float: left;

Will give you the horizontal display you want and 将为您提供所需的水平显示,

Width: 200px;

Will give you the resize you want although you may need to play with the value to get what you are after. 尽管您可能需要使用该值来获得想要的东西,但是它会为您提供所需的调整大小。

Note that you should only specify either width or height of the image because that will preserve the aspect ratio. 请注意,您只能指定图像的宽度或高度,因为这样可以保留宽高比。 Specifying them both will destroy it unless of course you have some custom js which I have seen before but that's usually very fragile 同时指定它们都将破坏它,除非您当然有一些我以前见过的自定义js,但这通常非常脆弱

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM