HTML div class container
HTML Tutorial » HTML div class container
A container is a <div> element with a class=“container”. The container will affect all elements inside within the <div> container.
Div class "container" hasn’t a special meaning but container is just a well chosen name. You can replace with any other name if we don't talk about Bootstrap. In CSS Bootstrap is already implemented.
Syntax:
HTML class container, fluid, center, color,
<div class=”container”>anything</div>
Div is a tag.
Class is an attribute of div tag
Container is a class name
In the next example we show you HTML div class container, fluid, center, color templates.
.container {
width: 100%; /* this make container fluid*/
height: auto;
background-color: #FFC; /* this make content background-color*/
margin-right: auto; /* this make content center*/
margin-left: auto; /* this make content center*/
}
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>HTML div class container</title><style type="text/css">
body {
font-family: Verdana, Geneva, sans-serif;
font-size: 14px;
}
.header {
width: 100%;
height: 80px;
background-color: #E1E1E1;
box-sizing:border-box;
margin-bottom: 4px;
margin-top: 4px;
margin-right: auto;
margin-left: auto;
}
.container {
width: 100%;
height: auto;
background-color: #FF9;
margin-right: auto;
margin-left: auto;
color: #066;
}
.footer {
width: 100%;
height: 80px;
background-color: #666666;
color: #FFF;
margin-top: 12px;
margin-right: auto;
margin-left: auto;
}</style>
</head><body>
<div class="header">This is my Header<br />
This is box is: <div class="header"></div><div class="container">
<h2>HTML Tutorial » HTML div class container - size - width 75%</h2>
<p>This is box is: <strong><div class="container"></strong> </p>
<p>You can replace 75% width with 990px. </p>
<p><strong>Your text here</strong></p>
<p>- Grape silver beet collard greens avocado quandong fennel gumbo black-eyed
pea watercress potato tigernut corn groundnut. Chickweed okra pea winter purslane
coriander yarrow sweet pepper radish garlic brussels sprout groundnut summer purslane
earthnut pea tomato spring onion azuki bean gourd. Gumbo kakadu plum komatsuna
black-eyed pea green bean zucchini gourd winter purslane silver beet rock melon
radish asparagus spinach. - </p>
<!-- end container div class --> </div><div class="footer">This is my footer text</div>
</body>
</html>
Related subjects:
HTML div class tag
Div border color
Open link in new tab - Create link
Tags: class container html, fluid, center, color, vs container fluid, in angular, in java, row, width, center, class container fluid html, make, height html class container, -fluid, row, width, center, size, html div container-fluid, html element
How to make class container width, center
Is - container - for div class a special elemnt or special meaning? Simple - You could call it main-box or big-frame how you like, but if you see the word container on your HTML code, you know it is to contain something, and give it a good position on the HTML code.
You can replace CSS container 75% width ( % give you fluid content) with 990px (but 990px give you fix content).
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>HTML div class container</title><style type="text/css">
body {
font-family: Verdana, Geneva, sans-serif;
font-size: 14px;
}
.header {
width: 100%;
height: 80px;
background-color: #E1E1E1;
box-sizing:border-box;
margin-bottom: 4px;
margin-top: 4px;
margin-right: auto;
margin-left: auto;
}
.container {
width: 75%;
height: auto;
background-color: #9FC;
margin-right: auto;
margin-left: auto;
color: #039;
}
.footer {
width: 100%;
height: 80px;
background-color: #666666;
color: #FFF;
margin-top: 12px;
margin-right: auto;
margin-left: auto;
}</style>
</head><body>
<div class="header">This is my Header<br />
This is box is: <div class="header"></div><div class="container">
<h2>HTML Tutorial » HTML div class container - size - width 75%</h2>
<p>This is box is: <strong><div class="container"></strong> </p>
<p>You can replace 75% width with 990px. </p>
<p><strong>Your text here</strong></p>
<p>- Grape silver beet collard greens avocado quandong fennel gumbo
black-eyed pea watercress potato
tigernut corn groundnut. Chickweed okra pea winter purslane coriander yarrow
sweet pepper radish
garlic brussels sprout groundnut summer purslane earthnut pea tomato spring
onion azuki bean gourd. Gumbo kakadu plum komatsuna black-eyed pea green
bean zucchini gourd winter purslane silver beet rock melon radish asparagus
spinach. - </p>
<!-- end container div class --> </div><div class="footer">This is my footer text</div>
</body>
</html>
Tags: free download form, code, with css, with validation, html form checkbox label, group, checked, array, required, value, post, true false, limit, list, multiple values
Tags: class container html, fluid, center, color, vs container fluid, in angular, in java, row, width, center, class container fluid html, make, height html class container, -fluid, row, width, center, size, html div container-fluid, html element
HTML div class container - html tutorial
This tool makes it easy to create, adjust, and experiment with custom colors for the web.

Magnews2 is a modern and creative free magazine and news website template that will help you kick off your online project in style.

Find here examples of creative and unique website layouts.

Find here examples of creative and unique website CSS HTML menu.