> 웹 프론트엔드 > HTML 튜토리얼 > HTML 체크박스와 라디오 스타일 미화의 간단한 예

HTML 체크박스와 라디오 스타일 미화의 간단한 예

高洛峰
풀어 주다: 2017-02-21 13:11:55
원래의
1699명이 탐색했습니다.

下面小编就为大家带来一篇HTML 체크박스와 라디오 스타일 미화의 간단한 예。小编觉得挺不错的,现在就分享给大家,也给大家做个参考。一起跟随小编过来看看吧

HTML 체크박스와 라디오 스타일 미화의 간단한 예

checkbox:

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

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

<style type="text/css"

    input[type="checkbox"]  

    {  

        display: none;  

    }  

   

        input[type="checkbox"] + label  

        {  

            display: inline-block;  

            position: relative;  

            border: solid 2px #99a1a7;  

            width: 35px;  

            height: 35px;  

            line-height: 35px;  

            border-radius: 4px;  

        }  

   

        input[type="checkbox"]:checked + label:after  

        {  

            content: &#39;\2714&#39;;  

            font-size: 25px;  

            color: #99a1a7;  

            width: 35px;  

            height: 35px;  

            line-height: 35px;  

            position: absolute;  

            text-align: center;  

            background-color: #e9ecee;  

        }  

   

    .tab  

    {  

        margin-top: 20px;  

        margin-bottom: 20px;  

        width: 100%;  

    }  

   

        .tab td  

        {  

            border: solid 1px #f99;  

            font-size: 25px;  

            line-height: 39px;  

        }  

</style> 

   

<table class="tab" cellpadding="0" cellspacing="0" style="border-collapse: collapse;"

    <tr> 

        <td> 

            <p align="center" style="float: left; height: 39px; width: 39px;"

                <input id="ck101" type="checkbox" /> 

                <label for="ck101"></label> 

            </p> 

            <p style="float: left; height: 39px; line-height: 39px; font-size: 25px; margin-left: 10px; margin-right: 20px;"

                测试101  

            </p> 

            <p align="center" style="float: left; height: 39px; width: 39px;"

                <input id="ck102" type="checkbox" /> 

                <label for="ck102"></label> 

            </p> 

            <p style="float: left; height: 39px; line-height: 39px; font-size: 25px; margin-left: 10px; margin-right: 20px;"

                测试102  

            </p> 

            测试  

        </td> 

        <td></td> 

    </tr> 

    <tr> 

        <td style="text-align: center;"

            <p style="display: inline-block;"

                <p align="center" style="float: left; height: 39px; width: 39px;"

                    <input id="ck103" type="checkbox" /> 

                    <label for="ck103"></label> 

                </p> 

                <p style="float: left; height: 39px; line-height: 39px; font-size: 25px; margin-left: 10px; margin-right: 20px;"

                    测试103  

                </p> 

                <p align="center" style="float: left; height: 39px; width: 39px;"

                    <input id="ck104" type="checkbox" /> 

                    <label for="ck104"></label> 

                </p> 

                <p style="float: left; height: 39px; line-height: 39px; font-size: 25px; margin-left: 10px; margin-right: 20px;"

                    测试104  

                </p> 

                测试  

            </p> 

        </td> 

        <td>测试  

        </td> 

    </tr> 

</table> 

   

<p style="border: solid 1px #f99; height: 39px; margin-top: 20px; margin-bottom: 20px;"

    <p align="center" style="float: left; height: 39px; width: 39px;"

        <input id="ck201" type="checkbox" /> 

        <label for="ck201"></label> 

    </p> 

    <p style="float: left; height: 39px; line-height: 39px; font-size: 25px; margin-left: 10px; margin-right: 20px;"

        测试201  

    </p> 

    <p align="center" style="float: left; height: 39px; width: 39px;"

        <input id="ck202" type="checkbox" /> 

        <label for="ck202"></label> 

    </p> 

    <p style="float: left; height: 39px; line-height: 39px; font-size: 25px; margin-left: 10px;"

        测试202  

    </p> 

</p>

로그인 후 복사


radio:

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

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

110

111

112

113

114

<style type="text/css"

    input[type="radio"]  

    {  

        display: none;  

    }  

   

        input[type="radio"] + label  

        {  

            display: inline-block;  

            position: relative;  

            border: solid 2px #99a1a7;  

            width: 25px;  

            height: 25px;  

            line-height: 25px;  

            padding: 5px;  

            border-radius: 19.5px;  

        }  

   

        input[type="radio"]:checked + label:after  

        {  

            content: &#39; &#39;;  

            font-size: 25px;  

            color: #99a1a7;  

            width: 25px;  

            height: 25px;  

            line-height: 25px;  

            position: absolute;  

            text-align: center;  

            background-color: #99a1a7;  

            border-radius: 12.5px;  

        }  

   

        input[type="radio"]:checked + label  

        {  

            background-color: #e9ecee;  

        }  

   

    .tab  

    {  

        margin-top: 20px;  

        margin-bottom: 20px;  

        width: 100%;  

    }  

   

        .tab td  

        {  

            border: solid 1px #f99;  

            font-size: 25px;  

            line-height: 39px;  

        }  

</style> 

   

<table class="tab" cellpadding="0" cellspacing="0" style="border-collapse: collapse;"

    <tr> 

        <td> 

            <p align="center" style="float: left; height: 39px; width: 39px;"

                <input id="rd101" name="rd" type="radio" /> 

                <label for="rd101"></label> 

            </p> 

            <p style="float: left; height: 39px; line-height: 39px; font-size: 25px; margin-left: 10px; margin-right: 20px;"

                测试101  

            </p> 

            <p align="center" style="float: left; height: 39px; width: 39px;"

                <input id="rd102" name="rd" type="radio" /> 

                <label for="rd102"></label> 

            </p> 

            <p style="float: left; height: 39px; line-height: 39px; font-size: 25px; margin-left: 10px; margin-right: 20px;"

                测试102  

            </p> 

            测试  

        </td> 

        <td></td> 

    </tr> 

    <tr> 

        <td style="text-align: center;"

            <p style="display: inline-block;"

                <p align="center" style="float: left; height: 39px; width: 39px;"

                    <input id="rd103" name="rd" type="radio" /> 

                    <label for="rd103"></label> 

                </p> 

                <p style="float: left; height: 39px; line-height: 39px; font-size: 25px; margin-left: 10px; margin-right: 20px;"

                    测试103  

                </p> 

                <p align="center" style="float: left; height: 39px; width: 39px;"

                    <input id="rd104" name="rd" type="radio" /> 

                    <label for="rd104"></label> 

                </p> 

                <p style="float: left; height: 39px; line-height: 39px; font-size: 25px; margin-left: 10px; margin-right: 20px;"

                    测试104  

                </p> 

                测试  

            </p> 

        </td> 

        <td>测试  

        </td> 

    </tr> 

</table> 

   

<p style="border: solid 1px #f99; height: 39px; margin-top: 20px; margin-bottom: 20px;"

    <p align="center" style="float: left; height: 39px; width: 39px;"

        <input id="rd201" name="rd" type="radio" /> 

        <label for="rd201"></label> 

    </p> 

    <p style="float: left; height: 39px; line-height: 39px; font-size: 25px; margin-left: 10px; margin-right: 20px;"

        测试201  

    </p> 

    <p align="center" style="float: left; height: 39px; width: 39px;"

        <input id="rd202" name="rd" type="radio" /> 

        <label for="rd202"></label> 

    </p> 

    <p style="float: left; height: 39px; line-height: 39px; font-size: 25px; margin-left: 10px;"

        测试202  

    </p> 

</p>

로그인 후 복사


 效果图:

HTML 체크박스와 라디오 스타일 미화의 간단한 예

HTML 체크박스와 라디오 스타일 미화의 간단한 예

以上这篇HTML 체크박스와 라디오 스타일 미화의 간단한 예就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持PHP中文网。

更多HTML 체크박스와 라디오 스타일 미화의 간단한 예相关文章请关注PHP中文网!


관련 라벨:
본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
인기 튜토리얼
더>
최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿