如何设置适用于所有分辨率屏幕的图像大小?

时间:2015-08-28 13:19:59

标签: html css wordpress

如何制作像this这样的图片? 我的图像不适用于较大的桌面屏幕。 这是我的图片大小代码:

style="width:100%;height:100%;"

1 个答案:

答案 0 :(得分:0)

你可以做的是,你可以给<img />以下的CSS:

position: fixed;
z-index: 1;
width: 100%;
height: 100%;
left: 0;
top: 0;

<强>段

&#13;
&#13;
img {
  position: fixed;
  z-index: 1;
  width: 100%;
  height: 100%;
  left: 0;
  top: 0;
}
&#13;
<img src="http://lorempixel.com/400/400" />
&#13;
&#13;
&#13;