wxParse.css 4.3 KB

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