[英]Banner header CSS is missing
I wanted to make a HTML page with some background color in header with some text. 我想制作一个HTML页面,该页面的标题带有一些文本。 I wanted exactly like this but I am not getting CSS for this particular class
w3-container w3-teal
. 我想完全像这样,但是我没有为此特定类
w3-container w3-teal
获得CSS。
Can anybody tell how to get the CSS of these class. 任何人都可以告诉如何获得这些类的CSS。
Here is a link from where I am taking. 这是我要去的地方的链接。 https://www.w3schools.com/w3css/tryit.asp?filename=tryw3css_containers_div_header
https://www.w3schools.com/w3css/tryit.asp?filename=tryw3css_containers_div_header
<!DOCTYPE html>
<html>
<title>W3.CSS</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<body>
<div class="w3-container w3-teal">
<h1>Header</h1>
</div>
<div class="w3-container">
<p>The w3-container class can be used to display headers.</p>
</div>
</body>
</html>
This is the css: 这是CSS:
.w3-teal{ background-color: #009688; color:#fff;}
Here is the working code:
这是工作代码:
.w3-container, .w3-panel { padding: 0.01em 16px; } .w3-teal, .w3-hover-teal:hover { color: #fff!important; background-color: #009688!important; }
<div class="w3-container w3-teal"> <h1>Header</h1> </div> <div class="w3-container"> <p>The w3-container class can be used to display headers.</p> </div>
Template 2 : 范本2:
$('.ToggleDiv').click(function() { $('.menu').slideToggle(500); });
* { padding: 0px; margin: 0px; box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; } .w3-container, .w3-panel { padding: 0.01em 16px; } .w3-teal, .w3-hover-teal:hover { color: #fff!important; background-color: #009688!important; } .ToggleDiv { position: absolute; top: 33px; right: 40px; z-index: 999; font-size: 28px; } .ToggleDiv a { color: #fff } h1 { margin: 20px 0; } .menu { width: 100%; position: absolute; left: 0px; right: 0px; top: 83px; background: #fff; display: none; color: #000; border: 1px solid #000; padding: 10px; }
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" /> <div class="w3-container w3-teal"> <h1>Header</h1> <div class="ToggleDiv"><a href="#"><i class="fa fa-caret-down"></i></a> </div> <div class="menu"> <p>Helo I am being shown !!!</p> <p>Helo I am being shown !!!</p> </div> </div>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.