contact-form.scss 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448
  1. @media screen and (min-width: 768px) {
  2. .form {
  3. .form-item {
  4. display: -webkit-box;
  5. display: -ms-flexbox;
  6. display: flex;
  7. -webkit-box-pack: justify;
  8. -ms-flex-pack: justify;
  9. justify-content: space-between;
  10. margin-bottom: 25px;
  11. .form-label {
  12. font-size: 16px;
  13. color: #999;
  14. line-height: 40px;
  15. min-width: 100px;
  16. text-align: right;
  17. margin-right: 16px;
  18. em {
  19. color: #ff0000;
  20. margin-right: 4px;
  21. }
  22. }
  23. .form-control {
  24. -webkit-box-flex: 1;
  25. -ms-flex: 1;
  26. flex: 1;
  27. color: #505050;
  28. font-size: 16px;
  29. &.input {
  30. input {
  31. display: block;
  32. width: 100%;
  33. line-height: 40px;
  34. border: 1px solid #dedede;
  35. -webkit-box-sizing: border-box;
  36. box-sizing: border-box;
  37. padding: 0 16px;
  38. border-radius: 4px;
  39. }
  40. }
  41. &.textarea {
  42. textarea {
  43. display: block;
  44. width: 100%;
  45. line-height: 26px;
  46. border: 1px solid #dedede;
  47. -webkit-box-sizing: border-box;
  48. box-sizing: border-box;
  49. padding: 8px 16px;
  50. border-radius: 2px;
  51. resize: none;
  52. }
  53. }
  54. &.select-group {
  55. display: -webkit-box;
  56. display: -ms-flexbox;
  57. display: flex;
  58. -webkit-box-pack: justify;
  59. -ms-flex-pack: justify;
  60. justify-content: space-between;
  61. .select {
  62. width: 100%;
  63. -webkit-box-flex: 1;
  64. -ms-flex: 1;
  65. flex: 1;
  66. position: relative;
  67. margin-right: 16px;
  68. border: 1px solid #e8e8e8;
  69. border-radius: 2px;
  70. &:last-child {
  71. margin-right: 0;
  72. }
  73. select {
  74. display: block;
  75. width: 100%;
  76. border: 0;
  77. line-height: 40px;
  78. padding: 0 16px;
  79. padding-right: 40px;
  80. color: #272727;
  81. -webkit-appearance: none;
  82. -moz-appearance: none;
  83. appearance: none;
  84. border-radius: 2px;
  85. }
  86. &::after {
  87. position: absolute;
  88. right: 0;
  89. top: 0;
  90. content: '';
  91. z-index: 1;
  92. display: block;
  93. width: 40px;
  94. height: 40px;
  95. background: url(/img/icon-arrow-down.png) no-repeat center;
  96. background-size: 24px 24px;
  97. pointer-events: none;
  98. }
  99. }
  100. }
  101. &.radio {
  102. line-height: 40px;
  103. label {
  104. margin-right: 35px;
  105. }
  106. input {
  107. margin-right: 10px;
  108. }
  109. }
  110. &.upload-image {
  111. input {
  112. display: none;
  113. }
  114. .tip {
  115. width: 120px;
  116. height: 120px;
  117. border: 1px solid #dedede;
  118. margin-top: 10px;
  119. -webkit-box-sizing: border-box;
  120. box-sizing: border-box;
  121. padding-top: 80px;
  122. text-align: center;
  123. font-size: 14px;
  124. color: #999;
  125. cursor: pointer;
  126. position: relative;
  127. &::before,
  128. &::after {
  129. content: '';
  130. display: block;
  131. position: absolute;
  132. background: #dedede;
  133. width: 2px;
  134. height: 30px;
  135. left: 50%;
  136. top: 50%;
  137. }
  138. &::before {
  139. -webkit-transform: translateX(-50%) translateY(-80%);
  140. transform: translateX(-50%) translateY(-80%);
  141. }
  142. &::after {
  143. -webkit-transform: translateX(-50%) translateY(-80%) rotateZ(90deg);
  144. transform: translateX(-50%) translateY(-80%) rotateZ(90deg);
  145. }
  146. }
  147. }
  148. &.upload-file {
  149. [type='file'] {
  150. display: none;
  151. }
  152. .button {
  153. line-height: 40px;
  154. width: 207px;
  155. background: #0688d2;
  156. color: #fff;
  157. text-align: center;
  158. margin-left: 16px;
  159. cursor: pointer;
  160. -webkit-transition: all 0.4s;
  161. transition: all 0.4s;
  162. &:hover {
  163. background: #077ec4;
  164. }
  165. }
  166. }
  167. }
  168. }
  169. .form-submit {
  170. text-align: center;
  171. margin-top: 80px;
  172. button {
  173. width: 330px;
  174. height: 48px;
  175. background: transparent;
  176. -webkit-box-sizing: border-box;
  177. box-sizing: border-box;
  178. border: 0;
  179. cursor: pointer;
  180. margin: 0 24px;
  181. -webkit-transition: all 0.4s;
  182. transition: all 0.4s;
  183. }
  184. [type='reset'] {
  185. border: 1px solid #0688d2;
  186. color: #0688d2;
  187. line-height: 46px;
  188. &:hover {
  189. border-color: #0679b8;
  190. color: #0679b8;
  191. }
  192. }
  193. [type='submit'] {
  194. background: #0688d2;
  195. color: #fff;
  196. line-height: 48px;
  197. &:hover {
  198. background: #077ec4;
  199. }
  200. }
  201. }
  202. }
  203. }
  204. @media screen and (max-width: 768px) {
  205. .form {
  206. .form-item {
  207. margin-bottom: 0.32rem;
  208. &.inline {
  209. display: -webkit-box;
  210. display: -ms-flexbox;
  211. display: flex;
  212. -webkit-box-pack: justify;
  213. -ms-flex-pack: justify;
  214. justify-content: space-between;
  215. .form-label {
  216. line-height: 0.9rem;
  217. margin-right: 0.16rem;
  218. margin-bottom: 0;
  219. min-width: 1rem;
  220. }
  221. }
  222. .form-label {
  223. font-size: 0.26rem;
  224. color: #999;
  225. margin-bottom: 0.16rem;
  226. em {
  227. color: #ff0000;
  228. margin-right: 0.08rem;
  229. }
  230. }
  231. .form-control {
  232. -webkit-box-flex: 1;
  233. -ms-flex: 1;
  234. flex: 1;
  235. color: #505050;
  236. font-size: 0.24rem;
  237. &.input {
  238. input {
  239. display: block;
  240. width: 100%;
  241. line-height: 0.9rem;
  242. border: 1px solid #dedede;
  243. -webkit-box-sizing: border-box;
  244. box-sizing: border-box;
  245. padding: 0 0.24rem;
  246. border-radius: 0.04rem;
  247. }
  248. }
  249. &.textarea {
  250. textarea {
  251. display: block;
  252. width: 100%;
  253. line-height: 0.48rem;
  254. border: 0.01rem solid #dedede;
  255. -webkit-box-sizing: border-box;
  256. box-sizing: border-box;
  257. padding: 0.16rem 0.24rem;
  258. border-radius: 0.02rem;
  259. resize: none;
  260. }
  261. }
  262. &.select-group {
  263. display: -webkit-box;
  264. display: -ms-flexbox;
  265. display: flex;
  266. -webkit-box-pack: justify;
  267. -ms-flex-pack: justify;
  268. justify-content: space-between;
  269. .select {
  270. width: 100%;
  271. -webkit-box-flex: 1;
  272. -ms-flex: 1;
  273. flex: 1;
  274. position: relative;
  275. margin-right: 0.24rem;
  276. border: 0.01rem solid #e8e8e8;
  277. border-radius: 0.02rem;
  278. &:last-child {
  279. margin-right: 0;
  280. }
  281. select {
  282. display: block;
  283. width: 100%;
  284. border: 0;
  285. line-height: 0.9rem;
  286. padding: 0 0.24rem;
  287. padding-right: 0.4rem;
  288. color: #272727;
  289. -webkit-appearance: none;
  290. -moz-appearance: none;
  291. appearance: none;
  292. border-radius: 0.02rem;
  293. }
  294. &::after {
  295. position: absolute;
  296. right: 0;
  297. top: 0;
  298. content: '';
  299. z-index: 1;
  300. display: block;
  301. width: 0.9rem;
  302. height: 0.9rem;
  303. background: url(/img/icon-arrow-down.png) no-repeat center;
  304. background-size: 0.24rem 0.24rem;
  305. pointer-events: none;
  306. }
  307. }
  308. }
  309. &.radio {
  310. line-height: 0.9rem;
  311. label {
  312. margin-right: 0.35rem;
  313. }
  314. input {
  315. margin-right: 0.1rem;
  316. }
  317. }
  318. &.upload-image {
  319. input {
  320. display: none;
  321. }
  322. .tip {
  323. width: 1.62rem;
  324. height: 1.62rem;
  325. border: 0.01rem solid #dedede;
  326. margin-top: 0.2rem;
  327. -webkit-box-sizing: border-box;
  328. box-sizing: border-box;
  329. padding-top: 1.2rem;
  330. text-align: center;
  331. font-size: 0.24rem;
  332. color: #999;
  333. cursor: pointer;
  334. position: relative;
  335. &::before,
  336. &::after {
  337. content: '';
  338. display: block;
  339. position: absolute;
  340. background: #dedede;
  341. width: 2px;
  342. height: 30px;
  343. left: 50%;
  344. top: 50%;
  345. }
  346. &::before {
  347. -webkit-transform: translateX(-50%) translateY(-80%);
  348. transform: translateX(-50%) translateY(-80%);
  349. }
  350. &::after {
  351. -webkit-transform: translateX(-50%) translateY(-80%) rotateZ(90deg);
  352. transform: translateX(-50%) translateY(-80%) rotateZ(90deg);
  353. }
  354. }
  355. }
  356. &.upload-file {
  357. [type='file'] {
  358. display: none;
  359. }
  360. .button {
  361. line-height: 0.9rem;
  362. width: 2rem;
  363. background: #0688d2;
  364. color: #fff;
  365. text-align: center;
  366. margin-left: 0.24rem;
  367. cursor: pointer;
  368. -webkit-transition: all 0.4s;
  369. transition: all 0.4s;
  370. &:hover {
  371. background: #077ec4;
  372. }
  373. }
  374. }
  375. }
  376. }
  377. .form-submit {
  378. text-align: center;
  379. margin-top: 1rem;
  380. button {
  381. width: 6rem;
  382. height: 0.9rem;
  383. background: transparent;
  384. -webkit-box-sizing: border-box;
  385. box-sizing: border-box;
  386. border: 0;
  387. cursor: pointer;
  388. -webkit-transition: all 0.4s;
  389. transition: all 0.4s;
  390. font-size: 0.26rem;
  391. }
  392. [type='reset'] {
  393. border: 0.01rem solid #0688d2;
  394. color: #0688d2;
  395. line-height: 0.88rem;
  396. &:hover {
  397. border-color: #0679b8;
  398. color: #0679b8;
  399. }
  400. }
  401. [type='submit'] {
  402. background: #0688d2;
  403. color: #fff;
  404. line-height: 0.9rem;
  405. &:hover {
  406. background: #077ec4;
  407. }
  408. }
  409. }
  410. }
  411. }