Home >Web Front-end >HTML Tutorial >css3 Set background image size (reduced in thumbnail form)_html/css_WEB-ITnose
Of course no nonsense. Go directly to the code
<style> #mycon { background:url('Tpl/1.jpg'); background-size:400px 400px; background-repeat:no-repeat; border-radius: 4px; border: 1px solid #ccc; width: 400px; height: 400px; }</style><div id="mycon"> 原来背景图大小:970*630 这里才是战场,以缩略图的形式来将背景图设置</div>
background-size:400px 400px;followed by setting the thumbnail width and height.
The effect is as shown below: