├── 1px.css ├── 1px.html ├── 1px.less └── README.md /1px.css: -------------------------------------------------------------------------------- 1 | /** 2 | * https://github.com/yscoder/border-1px 3 | */ 4 | .bd-t { 5 | border-width: 0; 6 | border-color: #ccc; 7 | border-style: solid; 8 | border-top-width: 1px; 9 | } 10 | .bd-r { 11 | border-width: 0; 12 | border-color: #ccc; 13 | border-style: solid; 14 | border-right-width: 1px; 15 | } 16 | .bd-b { 17 | border-width: 0; 18 | border-color: #ccc; 19 | border-style: solid; 20 | border-bottom-width: 1px; 21 | } 22 | .bd-l { 23 | border-width: 0; 24 | border-color: #ccc; 25 | border-style: solid; 26 | border-left-width: 1px; 27 | } 28 | .bd-all { 29 | border-width: 0; 30 | border-color: #ccc; 31 | border-style: solid; 32 | border-width: 1px; 33 | } 34 | .bd-radius { 35 | border-width: 0; 36 | border-color: #ccc; 37 | border-style: solid; 38 | border-width: 1px; 39 | border-radius: 4px; 40 | } 41 | .bd-dashed { 42 | border-style: dashed!important; 43 | } 44 | hr { 45 | border: none; 46 | } 47 | hr, 48 | .hr { 49 | margin: .7em 0; 50 | width: 100%; 51 | height: 1px; 52 | background: #ccc; 53 | overflow: hidden; 54 | } 55 | @media screen and (-webkit-min-device-pixel-ratio: 1.5) { 56 | .ratina-bd { 57 | position: relative; 58 | border: none!important; 59 | } 60 | .ratina-bd::before { 61 | content: ''; 62 | position: absolute; 63 | top: 0; 64 | left: 0; 65 | border-width: 0; 66 | border-color: #ccc; 67 | border-style: solid; 68 | -webkit-transform-origin: 0 0; 69 | transform-origin: 0 0; 70 | pointer-events: none; 71 | } 72 | .ratina-bd::before { 73 | width: 150%; 74 | height: 150%; 75 | -webkit-transform: scale(0.66666667); 76 | transform: scale(0.66666667); 77 | } 78 | .ratina-bd.bd-t::before { 79 | border-top-width: 1px; 80 | } 81 | .ratina-bd.bd-r::before { 82 | border-right-width: 1px; 83 | } 84 | .ratina-bd.bd-b::before { 85 | border-bottom-width: 1px; 86 | } 87 | .ratina-bd.bd-l::before { 88 | border-left-width: 1px; 89 | } 90 | .ratina-bd.bd-all::before { 91 | border-width: 1px; 92 | } 93 | .ratina-bd.bd-radius::before { 94 | border-width: 1px; 95 | border-radius: 6px; 96 | } 97 | .ratina-bd.bd-dashed::before { 98 | border-style: dashed!important; 99 | } 100 | hr, 101 | .hr { 102 | width: 150%; 103 | -webkit-transform: scale(0.66666667); 104 | transform: scale(0.66666667); 105 | -webkit-transform-origin: 0 0; 106 | transform-origin: 0 0; 107 | } 108 | } 109 | @media screen and (-webkit-min-device-pixel-ratio: 2) { 110 | .ratina-bd::before { 111 | width: 200%; 112 | height: 200%; 113 | -webkit-transform: scale(0.5); 114 | transform: scale(0.5); 115 | } 116 | .ratina-bd.bd-radius::before { 117 | border-radius: 8px; 118 | } 119 | hr, 120 | .hr { 121 | width: 200%; 122 | -webkit-transform: scale(0.5); 123 | transform: scale(0.5); 124 | } 125 | } 126 | @media screen and (-webkit-min-device-pixel-ratio: 3) { 127 | .ratina-bd::before { 128 | width: 300%; 129 | height: 300%; 130 | -webkit-transform: scale(0.33333333); 131 | transform: scale(0.33333333); 132 | } 133 | .ratina-bd.bd-radius::before { 134 | border-radius: 12px; 135 | } 136 | hr, 137 | .hr { 138 | width: 300%; 139 | -webkit-transform: scale(0.33333333); 140 | transform: scale(0.33333333); 141 | } 142 | } 143 | -------------------------------------------------------------------------------- /1px.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 |上边框
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 |hr
67 |