CSS-Insert Picture img and background image

Source: Internet
Author: User
1. IMG Insert image, use the most, such as Product display class
.section img {          width: 200px;/* 插入图片更改大小 width 和 height */        height: 210px;        margin-top: 30px;  /* 插入图片更改位置 可以用margin 或padding  盒模型 */        margin-left: 50px; /* 插入当图片也是一个盒子 */    }
2. Background images are generally used for small background images or large backgrounds
.aside {        width: 400px;        height: 400px;        border: 1px solid purple;        background: #fff url(images/sun.jpg) no-repeat;            background-size: 200px 210px; /*  背景图片更改大小只能用 background-size */        background-position: 30px 50px; /* 背景图片更该位置 用 background-position */    }

CSS-Insert Picture img and background image

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.