Reputation: 4283
I wanted to make a HTML page with some background color in header with some text. I wanted exactly like this but I am not getting CSS for this particular class w3-container w3-teal
.
Can anybody tell how to get the CSS of these class.
Here is a link from where I am taking. 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>
Upvotes: 0
Views: 112
Reputation: 4250
This is the 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 :
$('.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>
Upvotes: 2