css怎么让图片不变形


当前第2页 返回上一页

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

<!DOCTYPE html>

<html>

  

<head>

    <meta charset="UTF-8">

    <title></title>

    <style type="text/css">

    div {

        float: left;

    }    

    .test1 img {

        width: 187.5px;

        height: 156.5px;

    }    

    .test2 img {

        width: 300px;

        height: 100px;

    }    

    .test3 img {

        max-width: 300px;

        max-height: 100px;

    }    

    .test4 img {

        max-width: 100%;

        height: 200px;

    }    

    .test5 {

        width: 300px;

        height: 200px;

    }    

    .test5 img {

        max-width: 100%;

        max-height: 100%;

    }    

    .test6 {

        width: 300px;

        height: 100px;

        /*overflow: hidden;*/

    }    

    .test6 img {

        max-width: 300px;

        max-height: 100px;

    }   

    .test7 {

        width: 300px;

        height: 100px;

        /*overflow: hidden;*/

    }    

    .test7 img {

        max-width: 300px;

    }

    </style>

</head>

<body>

    <div class="test1">

        <img src="1.jpg" />

    </div>

    <div class="test2">

        <img src="1.jpg" />

    </div>

    <div class="test3">

        <img src="1.jpg" />

    </div>

    <div class="test4">

        <img src="1.jpg" />

    </div>

    <div class="test5">

        <img src="1.jpg" />

    </div>

    <div class="test6">

        <img src="1.jpg" />

    </div>

    <div class="test7">

        <img src="1.jpg" />

</body>

</html>

效果如图:

e1e23443f0cb1e33a85c3d614b40f4d.png

【推荐学习:css视频教程】

以上就是css怎么让图片不变形的详细内容,更多文章请关注木庄网络博客

返回前面的内容

相关阅读 >>

css怎么设置背景图片的透明度

如何修改css样式

css自动换行怎么设置

css选择器可以插入图片吗

深入了解css中的will-change属性

css如何实现多行省略号

html css js是什么?

css怎么画圆

myeclipse css 不起作用怎么办

css如何剪切元素??clip属性的使用

更多相关阅读请进入《css》频道 >>




打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...