html5中如何导入图片

html5中如何导入图片,第1张

具体方法如下:

<img src="图片路径" alt="图片描述">

例:<img src="img/pro1.png" alt="">

html5中设置整页背景图片的方法是利用css3样式

  /* Set up proportionate scaling */

  width: 100%

  height: auto

  /* Set up positioning */

  position: fixed

  top: 0

  left: 0

}

@media screen and (max-width: 1024px) { /* Specific to this particular image */

  img.bg {

    left: 50%

    margin-left: -512px   /* 50% */

  }

}

html5中设置整页背景图片的方法是利用css3样式:

写法如下:

img.bg {

 /* Set rules to fill background */

 min-height: 100%

 min-width: 1024px

 /* Set up proportionate scaling */

 width: 100%

 height: auto

 /* Set up positioning */

 position: fixed

 top: 0

 left: 0

}

@media screen and (max-width: 1024px) { /* Specific to this particular image */

 img.bg {

   left: 50%

   margin-left: -512px  /* 50% */

 }

}

效果如:


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/7452176.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-04-05
下一篇 2023-04-05

发表评论

登录后才能评论

评论列表(0条)

保存