AgerNic.com
WEB DEVELOPER SITE, HTML, CSS, PHP, SQL

HTML div class container


<< Previous Page
HTML form action
Next Page >>
HTML headings

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:

<div class="container"> your_text</div>

 

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*/
}

Example

<!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: &lt;div class=&quot;header&quot;&gt;</div>

<div class="container">
<h2>HTML Tutorial » HTML div class container - size - width 75%</h2>
<p>This is box is: <strong>&lt;div class=&quot;container&quot;&gt;</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>

Note: Container itself is not a keyword in 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).

Example

<!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: &lt;div class=&quot;header&quot;&gt;</div>

<div class="container">
<h2>HTML Tutorial » HTML div class container - size - width 75%</h2>
<p>This is box is: <strong>&lt;div class=&quot;container&quot;&gt;</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

<< Previous Page
HTML form action
Next Page >>
HTML headings

 



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

Online Editor
ONLINE EDITOR

news templates


COLOR PICKER

news templates
This tool makes it easy to create, adjust, and experiment with custom colors for the web.


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


CSS HTML Layout
news templates
Find here examples of creative and unique website layouts.


Free CSS HTML Menu
news templates
Find here examples of creative and unique website CSS HTML menu.


HTML Img Background
HTML Image Link
HTML Image Size
HTML Text Style
HTML Text Align
HTML Text Size
HTML Text Color Style
HTML Text Color
HTML Table Color
HTML Table Row Colspan
HTML Table Width
HTML Table Style
HTML Table Border
HTML Table
HTML Font Face
HTML Font Size
HTML Font Color
HTML Headings
HTML div border color
HTML div class
HTML class container
HTML form action
HTML comment
HTML link new tab
HTML link underline
HTML link tag
HTML button action
HTML button onclick
HTML button link
HTML table style
HTML image
HTML colors
HTML div style
Text, paragraf in HTML
HTML Tags Attributes
HTML - Elements
HTML Introduction
Home HTML Tutorial
Online Editor
ONLINE EDITOR

news templates


COLOR PICKER

news templates
This tool makes it easy to create, adjust, and experiment with custom colors for the web.


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


CSS HTML Layout
news templates
Find here examples of creative and unique website layouts.


Free CSS HTML Menu
news templates
Find here examples of creative and unique website CSS HTML menu.


jQuery replace...
jQuery replaceClass...
jQuery click ()...
jQuery switchClass()...
jQuery draggable()...
jQuery HTML...
jQuery scroll smooth...
jQuery scroll()...
jQuery stop()...
jQuery animate()...
jQuery SlideToggle()...
jQuery slideDown()...
jQuery slideUp()...
jQuery fadeToggle...
jQuery fadeOut()...
jQuery fadeIn()...
jQuery Effects - hide () and show ()...
jQuery Events...
jQuery Attributes...
jQuery Selectors...