Beautify the tag cloud style code record that comes with the robin begin theme

 Watson Blog November 26, 2017 00:15:39 WordPress comment six hundred and sixteen Reading mode

The effect picture after beautifying the tag cloud style of robin begin theme is as follows:

 Beautify the tag cloud style code record that comes with the robin begin theme

Modify as follows:

Css code

  1. .tagcloud{  
  2. padding : 14px  0  14px   12px ;   
  3. }  
  4. .tagcloud a{  
  5. float : left ;   
  6. margin : 3px ;   
  7. line-height : 26px ;   
  8. text-align : center ;   
  9. border : 1px   solid   #ddd ;   
  10. border -radius: 2px ;   
  11. padding-top :0;   
  12. padding-right : 5px ;   
  13. padding-bottom :0;   
  14. padding-left : 5px ;   
  15. overflow : hidden ;   
  16. display : block ;   
  17. width : 92px ;   
  18. height : 28px ;   
  19. }  
  20. .tagcloud a{  
  21. color : #fff ;   
  22. }  

 

Js code

  1. <script type= "text/javascript" >box_width = $( "#cx_tag_cloud-5" ).width();   
  2. len = $( ".tagcloud a" ).length - 1;   
  3. $( ".tagcloud a" ).each( function (i) {  
  4.      var  let =  new  Array('3366FF', '31ac76', 'ea4563', '31a6a0', '8e7daa', '4fad7b', 'f99f13', 'f85200', '666666');   
  5.      var  random1 = Math.floor(Math.random() * 9) + 0;   
  6.      var  num = Math.floor(Math.random() * 6 + 9);   
  7.     $( this ).attr('style', 'background:#' + let[random1] +  '' );   
  8.      if  ($( this ).next().length > 0) {  
  9.         last = $( this ).next().position().left  
  10.     }  
  11. });</ script>  

The css code can be placed in the theme style sheet file (style. css) or in "Appearance ->Custom Style", Js calls it or adds it to the footer file (footer.php file under the theme), and the code is modified by js random color plus css style.

Code from: https://www.mom1.cn/3228.html

 Watson Blog
  • This article is written by Published on November 26, 2017 00:15:39
  • This article is collected and sorted by the website of Mutual Benefit, and the email address for problem feedback is: wosnnet@foxmail.com , please keep the link of this article for reprinting: https://wosn.net/814.html

Comment