parse.css 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  1. /**
  2. * author: Di (微信小程序开发工程师)
  3. * organization: WeAppDev(微信小程序开发论坛)(http://weappdev.com)
  4. * 垂直微信小程序开发交流社区
  5. *
  6. * github地址: https://github.com/icindy/wxParse
  7. *
  8. * for: 微信小程序富文本解析
  9. * detail : http://weappdev.com/t/wxparse-alpha0-1-html-markdown/184
  10. */
  11. /**
  12. * 请在全局下引入该文件,@import '/static/wxParse.css';
  13. */
  14. .wxParse {
  15. user-select: none;
  16. width: 100%;
  17. font-family: Helvetica, "PingFangSC", "Microsoft Yahei", "微软雅黑", Arial,
  18. sans-serif;
  19. color: #0c1c33;
  20. line-height: 1.5;
  21. font-size: 1em;
  22. text-align: justify; /* //左右两端对齐 */
  23. }
  24. .wxParse view,
  25. .wxParse uni-view {
  26. word-break: break-word;
  27. }
  28. .wxParse .p {
  29. padding-bottom: 0.5em;
  30. clear: both;
  31. /* letter-spacing: 0;//字间距 */
  32. }
  33. .wxParse .inline {
  34. display: inline;
  35. margin: 0;
  36. padding: 0;
  37. }
  38. .wxParse .div {
  39. margin: 0;
  40. padding: 0;
  41. display: block;
  42. }
  43. .wxParse .h1 {
  44. font-size: 2em;
  45. line-height: 1.2em;
  46. margin: 0.67em 0;
  47. }
  48. .wxParse .h2 {
  49. font-size: 1.5em;
  50. margin: 0.83em 0;
  51. }
  52. .wxParse .h3 {
  53. font-size: 1.17em;
  54. margin: 1em 0;
  55. }
  56. .wxParse .h4 {
  57. margin: 1.33em 0;
  58. }
  59. .wxParse .h5 {
  60. font-size: 0.83em;
  61. margin: 1.67em 0;
  62. }
  63. .wxParse .h6 {
  64. font-size: 0.83em;
  65. margin: 1.67em 0;
  66. }
  67. .wxParse .h1,
  68. .wxParse .h2,
  69. .wxParse .h3,
  70. .wxParse .h4,
  71. .wxParse .h5,
  72. .wxParse .h6,
  73. .wxParse .b,
  74. .wxParse .strong {
  75. font-weight: bolder;
  76. }
  77. .wxParse .i,
  78. .wxParse .cite,
  79. .wxParse .em,
  80. .wxParse .var,
  81. .wxParse .address {
  82. font-style: italic;
  83. }
  84. .wxParse .spaceshow {
  85. white-space: pre;
  86. }
  87. .wxParse .pre,
  88. .wxParse .tt,
  89. .wxParse .code,
  90. .wxParse .kbd,
  91. .wxParse .samp {
  92. font-family: monospace;
  93. }
  94. .wxParse .pre {
  95. overflow: auto;
  96. background: #f5f5f5;
  97. padding: 16upx;
  98. white-space: pre;
  99. margin: 1em 0upx;
  100. font-size: 24upx;
  101. }
  102. .wxParse .code {
  103. overflow: auto;
  104. padding: 16upx;
  105. white-space: pre;
  106. margin: 1em 0upx;
  107. background: #f5f5f5;
  108. font-size: 24upx;
  109. }
  110. .wxParse .big {
  111. font-size: 1.17em;
  112. }
  113. .wxParse .small,
  114. .wxParse .sub,
  115. .wxParse .sup {
  116. font-size: 0.83em;
  117. }
  118. .wxParse .sub {
  119. vertical-align: sub;
  120. }
  121. .wxParse .sup {
  122. vertical-align: super;
  123. }
  124. .wxParse .s,
  125. .wxParse .strike,
  126. .wxParse .del {
  127. text-decoration: line-through;
  128. }
  129. .wxParse .strong,
  130. .wxParse .text,
  131. .wxParse .span,
  132. .wxParse .s {
  133. display: inline;
  134. }
  135. .wxParse .a {
  136. color: deepskyblue;
  137. }
  138. .wxParse .video {
  139. text-align: center;
  140. margin: 22upx 0;
  141. }
  142. .wxParse .video-video {
  143. width: 100%;
  144. }
  145. .wxParse .uni-image {
  146. max-width: 100%;
  147. }
  148. .wxParse .img {
  149. display: block;
  150. max-width: 100%;
  151. margin-bottom: 0em; /* //与p标签底部padding同时修改 */
  152. overflow: hidden;
  153. }
  154. .wxParse .blockquote {
  155. margin: 10upx 0;
  156. padding: 22upx 0 22upx 22upx;
  157. font-family: Courier, Calibri, "宋体";
  158. background: #f5f5f5;
  159. border-left: 6upx solid #dbdbdb;
  160. }
  161. .wxParse .blockquote .p {
  162. margin: 0;
  163. }
  164. .wxParse .ul,
  165. .wxParse .ol {
  166. display: block;
  167. margin: 1em 0;
  168. padding-left: 2em;
  169. }
  170. .wxParse .ol {
  171. list-style-type: disc;
  172. }
  173. .wxParse .ol {
  174. list-style-type: decimal;
  175. }
  176. .wxParse .ol > weixin-parse-template,
  177. .wxParse .ul > weixin-parse-template {
  178. display: list-item;
  179. align-items: baseline;
  180. text-align: match-parent;
  181. }
  182. .wxParse .ol > .li,
  183. .wxParse .ul > .li {
  184. display: list-item;
  185. align-items: baseline;
  186. text-align: match-parent;
  187. }
  188. .wxParse .ul .ul,
  189. .wxParse .ol .ul {
  190. list-style-type: circle;
  191. }
  192. .wxParse .ol .ol .ul,
  193. .wxParse .ol .ul .ul,
  194. .wxParse .ul .ol .ul,
  195. .wxParse .ul .ul .ul {
  196. list-style-type: square;
  197. }
  198. .wxParse .u {
  199. text-decoration: underline;
  200. }
  201. .wxParse .hide {
  202. display: none;
  203. }
  204. .wxParse .del {
  205. display: inline;
  206. }
  207. .wxParse .figure {
  208. overflow: hidden;
  209. }
  210. .wxParse .tablebox {
  211. overflow: auto;
  212. background-color: #f5f5f5;
  213. background: #f5f5f5;
  214. font-size: 13px;
  215. padding: 8px;
  216. }
  217. .wxParse .table .table,
  218. .wxParse .table {
  219. border-collapse: collapse;
  220. box-sizing: border-box;
  221. /* 内边框 */
  222. /* width: 100%; */
  223. overflow: auto;
  224. white-space: pre;
  225. }
  226. .wxParse .tbody {
  227. border-collapse: collapse;
  228. box-sizing: border-box;
  229. /* 内边框 */
  230. border: 1px solid #dadada;
  231. }
  232. .wxParse .table .thead,
  233. .wxParse .table .tfoot,
  234. .wxParse .table .th {
  235. border-collapse: collapse;
  236. box-sizing: border-box;
  237. background: #ececec;
  238. font-weight: 40;
  239. }
  240. .wxParse .table .tr {
  241. border-collapse: collapse;
  242. box-sizing: border-box;
  243. /* border: 2px solid #F0AD4E; */
  244. overflow: auto;
  245. }
  246. .wxParse .table .th,
  247. .wxParse .table .td {
  248. border-collapse: collapse;
  249. box-sizing: border-box;
  250. border: 2upx solid #dadada;
  251. overflow: auto;
  252. }
  253. .wxParse .audio,
  254. .wxParse .uni-audio-default {
  255. display: block;
  256. }