This article mainly introduces how to use HTML + CSS + JS to create a simple webpage menu interface. The JavaScript code used in this ABROAD project is very simple. For more information, see
The label is used to write the ABROAD project. In fact, labels are everywhere on the WEB, the figure in turn shows the DCC Article publisher, ABROAD background data adding, Baidu image search, and sf post-tab style-like the native checkbox in the browser, but the checkbox is really ugly, so we can use this simple method to beautify it.
1. HTML code:
Economic and financial administration, human capital market, sales electronic engineering IT engineering Biological Medicine physics, chemical advertising, media language, translation
2. CSS code (color, font size, and spacing are adjusted by yourself ):
/* Label style */. tags span {font: 12px/22px 'Microsoft yahei', Arial, Lucida Grande, Tahoma; border: 1px # E3E0D9 solid; display: inline-block; height: 20px; background: # FFF; text-align: center; padding: 2px 7px; margin: 1px 4px; cursor: pointer;-webkit-transition: all. 3 s bytes-in-out;-moz-transition: all. 3 s memory-in-out; overflow: hidden; color: #989898 ;}. tags span: hover {border-color: # 00956d ;}. tags span. active {color: # FFF; border-color: # 00956d; background-color: # 00956d ;}
3. JS Code (the Code also extracts data based on your own needs. Forgive me for using the jquery library freely ~) :
// Tag binding Click Event @ 21:57:26 $ ('. tags span '). on ('click', function () {$ (this ). toggleClass ('active') ;}); // @ 2014-01-29 23: 12: 35var tag_content = ','; $ ('. tags span '). each (function (k, v) {if ($ (v ). hasClass ('active') {tag_content + = $ (v ). text () + ',' ;}}); if (tag_content = ',') {alert ('select at least one professional tag'); return ;}