


[Import] DIV CSS js to create rounded tab effect_html/css_WEB-ITnose
做网站很多年.一直用TABLE布局网页,没有想到DIV+CSS的魅力如此之大,看了些资料.做了个简单而很使用的效果.圆角无刷新选项卡.单击以下地址预览(下载):
http://www.d000.cn/epark/attachments/file/css1.html
简单介绍一下重要代码:
1:圆角效果的实现
xhtml代码:
这句很简单,就是用这个标签在网页占八行的位置(上边4行,下边4行)
相关CSS:
/*圆角框*/
b.rtop, b.rbottom{
display:block;
background: #668995
}
b.rtop b, b.rbottom b{
display:block;height: 1px;
overflow: hidden;
background: #81a6b3
}
b.r1{margin: 0 5px}
b.r2{margin: 0 3px}
b.r3{margin: 0 2px}
b.rtop b.r4, b.rbottom b.r4{margin: 0 1px;height: 2px}
这段代码就很容易明白,就是填充每一行,然后设置不同的左右边距,就实现了圆角效果,相关CSS的设置可以参考CSS2.0中文手册.
2:选项卡效果的实现
> b >
In a DIV, one is currently displayed and all others are hidden. When the mouse clicks on other options, the corresponding options are displayed.
The CSS code is as follows:
.TopTen .hiddencontent
{
display: none;
.TopTen .activecontent
{text-align: justify;
padding: 2px; border: 0px solid;
z -index: 2;
}
a.active {
background:#678995; }
JS code is as follows:
tabCount = 3;
function changeTab(tabIndex)
{
for (i = 1; i <= tabCount; i )
tab = document.getElementById( "TopTenTab" i);
content = document.getElementById("TopTenContent" i);
if (i == tabIndex)
{
tab.className = "active";
content.className = "activecontent"; tab.className = "";
content.className = "hiddencontent";
}
}
}
These are not many, you will understand them all if you take a closer look.
PS: If you want to implement mouse movement When reaching a certain option, the corresponding content will be displayed. Just change onclick="changeTab(3);" to: onmouseover="changeTab(3);" onclick="return false;" and so on!
Article source: http://0839.d000.cn/default.asp?id=16

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



The article discusses the HTML <progress> element, its purpose, styling, and differences from the <meter> element. The main focus is on using <progress> for task completion and <meter> for stati

The article discusses the HTML <datalist> element, which enhances forms by providing autocomplete suggestions, improving user experience and reducing errors.Character count: 159

The article discusses the HTML <meter> element, used for displaying scalar or fractional values within a range, and its common applications in web development. It differentiates <meter> from <progress> and ex

HTML is suitable for beginners because it is simple and easy to learn and can quickly see results. 1) The learning curve of HTML is smooth and easy to get started. 2) Just master the basic tags to start creating web pages. 3) High flexibility and can be used in combination with CSS and JavaScript. 4) Rich learning resources and modern tools support the learning process.

The article discusses the viewport meta tag, essential for responsive web design on mobile devices. It explains how proper use ensures optimal content scaling and user interaction, while misuse can lead to design and accessibility issues.

The article discusses the <iframe> tag's purpose in embedding external content into webpages, its common uses, security risks, and alternatives like object tags and APIs.

HTML defines the web structure, CSS is responsible for style and layout, and JavaScript gives dynamic interaction. The three perform their duties in web development and jointly build a colorful website.

AnexampleofastartingtaginHTMLis,whichbeginsaparagraph.StartingtagsareessentialinHTMLastheyinitiateelements,definetheirtypes,andarecrucialforstructuringwebpagesandconstructingtheDOM.
