Use HTML + CSS + JS to create a simple webpage menu interface _ basic knowledge-js tutorial

Source: Internet
Author: User
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 ;}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.