Tab effect implemented by CSS + JS (html component)

Source: Internet
Author: User
The code is as follows: Copy code
<! Doctype html public "-// w3c // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<Html lang = "us-en">
<Head>
<Title> css tab (html component) </title>
<Link rel = "shortcut icon" href = "favicon. ico" type = "image/x-icon"/>
<Meta http-equiv = "content-type" content = "text/html; charset = gb2312"/>
<Meta name = "keywords" content = ""/>
<Meta name = "description" content = ""/>
<Style type = "text/css">
Div. card div {background-color: # FF8000; float: left; padding: 1px; padding-bottom: 0; clear: both; width: 405px ;}
Div. card a {color: black; font-size: 14px; text-decoration: none; float: left; width: 100px; text-align: center; background-color: white; margin-right: 1px ;}
Div. card div. home a. home {font: normal bold 14px/1.5 ;}
Div. card div. international a. international {font: normal bold 14px/1.5 ;}
Div. card div. sport a. sport {font: normal bold 14px/1.5 ;}
Div. card div. finance a. finance {font: normal bold 14px/1.5 ;}
Div. card div. content {background-color: white; border: 1px solid # ff8000; height: 100px ;}
</Style>
<Script type = "text/javascript">
Var shq = {}
Shq. cmenu = function (e)
{
Var e = window. event? Window. event. srcElement: e.tar get;
If (/a/I. test (e. tagName )){
E. parentNode. className = e. className;
E. parentNode. nextSibling. innerHTML = e. innerHTML;
E.parentNode.nextSibling.style.css Text = 'border-top: none ';
E. blur ();
     }
}
</Script>
</Head>
<Body>
<Div class = "card">
<Div onclick = "shq. cmenu (event)">
<A href = "#" class = "home"> China </a>
<A href = "#" class = "international"> international </a>
<A href = "#" class = "sport"> Sports </a>
Related Article

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.