引入:在平常进行浏览网页时,会涉及到很多tab栏切换的问题
如图
当我们点击tab1时显示tab1
点击tab2时显示tab2
代码:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>tab栏切换效果</title>
<style media="screen">
* {
margin: 0;
padding: 0;
border: 0 none;
outline: none;
}
.baohan {
width: 300px;
margin: 100px auto;
border: 1px solid #ccc;
}
#btns button {
width: 60px;
height: 30px;
float: left;
border-right: 1px solid #ccc;
}