我一直在嘗試使用Materialise CSS提供的Javascript選項卡。出於某種原因,我的瀏覽器將只顯示前4個選項卡。然後我發現,如果我減少瀏覽器的寬度,多餘的選項卡(選項卡5,選項卡6等)也會變得可見。 Safari和FireFox都是如此。我認爲這是一個非常奇怪的問題,並想知道任何人在這裏可以解釋爲什麼會發生這種情況。下面是代碼:MaterializeCSS選項卡 - 不顯示超過4個選項卡
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<!--Import Google Icon Font-->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<!--Import materialize.css-->
<!-- Compiled and minified CSS -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.99.0/css/materialize.min.css">
<!--Let browser know website is optimized for mobile-->
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
</head>
<body>
<!-- Tabs -->
<div class="row">
<div class="col s12">
<ul class="tabs">
<li class="tab col s3"><a class="active" href="#test1">Tab 1</a></li>
<li class="tab col s3"><a href="#test2">Tab 2</a></li>
<li class="tab col s3"><a href="#test3">Tab 3</a></li>
<li class="tab col s3"><a href="#test4">Tab 4</a></li>
<li class="tab col s3"><a href="#test5">Tab 5</a></li>
</ul>
</div>
<div id="test1" class="col s12">Test 1</div>
<div id="test2" class="col s12">Test 2</div>
<div id="test3" class="col s12">Test 3</div>
<div id="test4" class="col s12">Test 2</div>
<div id="test5" class="col s12">Test 3</div>
</div>
<!-- Init Tabs -->
<script type="text/javascript">
$(document).ready(function(){
$('ul.tabs').tabs();
});
</script>
<!--Import jQuery before materialize.js-->
<script type="text/javascript" src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
<!-- Compiled and minified JavaScript -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.99.0/js/materialize.min.js"></script>
</body>
</html>
從MaterializeCSS:提前 http://materializecss.com/tabs.html
謝謝!