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% */

  }

}

需要准备的材料分别有:电脑、浏览器、html编辑器

1、首先,打开html编辑器,新建html文件,例如:index.html。

2、在index.html中的<body>标签中,输入html代码:<img src="small3.png" />。

3、浏览器运行index.html页面,此时添加的本地图片的路径是相对路径。


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

原文地址: https://outofmemory.cn/zaji/7136008.html

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

发表评论

登录后才能评论

评论列表(0条)

保存