html5中如何导入图片

html-css020

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加背景图片可以通过: 1.首先可以去写一个div,然后这个div当然宽高是一定要有,然后在div中去设置要的背景图片,是否重复等属性,repaet这个来设置,no-repeat(是不重复)、repeat-x(沿着x轴重复)、repeat-y(沿着Y轴重复)这里我提交一段代码:<div id = 'test'></div><style>#test{width:300px height:400px background:url('图片的地址')no-repeat}</style>这样背景图片就设置好了!