简体   繁体   English

我有一个由5张图片组成的表格,该如何为该表格设置样式,以便在多种浏览器尺寸上按比例缩放?

[英]I have a table composed of 5 images, how can i style this table so that it will scale proportionally on multiple browser sizes?

The image table looks fine except when you shrink the browser size and then the table expands past the window size. 图像表看起来不错,除非您缩小浏览器大小,然后该表扩展到窗口大小以外。 I don't need the table to be responsive (it is only 5 images), I need the table to scale with the browser size. 我不需要表格进行响应(只有5张图像),我需要表格随浏览器大小进行缩放。

Here is the JSFiddle link 这是JSFiddle链接

http://jsfiddle.net/gacujuvx/ http://jsfiddle.net/gacujuvx/

this is how i styled one image in the stylesheet. 这就是我在样式表中设置一个图像样式的方式。

.comfyone    { 
  width:570px;
      height:214px;
      background:url(http://104.131.100.112/wp-content/uploads/2015/01/1stad1.jpg);
  background-size:cover;
   }

You can see the html table in the JSfiddle example I provided. 您可以在我提供的JSfiddle示例中看到html表。

If somebody could provide an answer that works, I would be very appreciative. 如果有人可以提供一个可行的答案,我将不胜感激。

If you need the table to scale then you do need the table to be responsive. 如果您需要表格缩放,那么您确实需要表格做出响应。 What do you think responsiveness is if not scaling depending on browser size? 如果不根据浏览器的大小进行缩放,您认为响应性是什么?

.comfyone    { 
      width:20%;
   }

set your width and height in percentages so their size is based on the size of the screen 以百分比设置您的宽度和高度,以便它们的大小基于屏幕的大小

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

相关问题 如何按比例将图像缩放到最大宽度? - How can I proportionally scale images to max-width? 如何使图像与Web浏览器窗口的大小成比例缩放? - How do I make images scale proportionally to the resizing of a web browser window? 如何根据容器高度按比例缩放多个图像? - How can I make a number of images scale proportionally based on its container height? 如何定位图像以便它们使用html重叠表格? - How can I position images so that they overlap a table using html? 如何在不同的视口尺寸下按比例缩放幻灯片图像? - how can I make slideshow images scale proportionately at different viewport sizes? 如何让表格 td 具有 1:1 的比例,以便当我增加宽度时,它可以增加高度? - How to get the table td have 1:1 ratio so that when I increase width, it can have increasing heigt? 如何解析表中不仅由单元格组成的行 <td> 但偶尔 <th> 细胞? - How can I parse rows in a table that are composed of cells that aren't just <td> but an occasional <th> cell? 如何按比例缩小 <img> WxH中的较短者设置为固定数字? - How can I proportionally scale down an <img> element with the shorter of its WxH set to a fixed number? 如何获得桌子外的图像? - How can I get the images outside the table? 如何在表格单元格中将按钮样式设置为具有完整大小? - How can I set a button style in table cell to have full size?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM