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

HTML container


<< Previous Page
HTML tutorial
Next Page >>
HTML tutorial

HTML Tutorial » HTML container

A container is a <div> tag with a class=“container”. The container will affect all elements between " <div> </div>" tags with class=“container”.

Syntax:

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

div is a tag.
class is an attribute of div tag
container is a class name.

Also, we have container tags what it is:

but we will discuss in the next chapter.

 

What is a "container" in HTML?

"container" is a class name in this HTML code: <div class="container"> your_text </div>

div is a tag.
class is an attribute of div tag
container is a class name.

Example
  <!DOCTYPE html>
<html>
<head>
<title>How do I make a container box in HTML? - example</title>

<style>
.container {
width: 90%;
height: auto;
background-color: #FF9;
margin-right: auto;
margin-left: auto;
color: #066;
} </style>


</head>

<body>
<div class="container">
<h2>your container title here</h2>
<p><strong>Your text here</strong></p>
<p> Another text : - 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>
</body>
</html>
Note: you can change name class "content" with another name as "main_box" how you like.

 

Related subjects:
div class container Create html link without underline Open link in new tab - Create link

 

How do I make a "container" box in HTML?

How do I make a "container" box in HTML?
To make a "container" HTML element you mast declare as a class name like: <div class="container"> your_text</div>

Example
  <!DOCTYPE html>
<html>
<head>
<title>How do I make a container box in HTML? - example</title>

<style>
.container {
width: 90%;
height: auto;
background-color: #FF9;
margin-right: auto;
margin-left: auto;
color: #066;
} </style>


</head>

<body>
<div class="container">
<h2>your container title here</h2>
<p>This is a paragraph </p>
<p>under the containe box </p>
<p><strong>Your text here</strong></p>
<p> Another text : - 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>
</body>
</html>
Note: you can change name class "content" with another name how you like.

Tags: container class, fluid, tags, elements, box, border, template, row padding, responsive, size, width, center, table, background color

 

How do "containers" work in HTML?

As shown in the paragraphs above. A container is a <div> with a class=“container”. The container will affect all your_text under <div> class="container"> your_text</div>.

Also, we have container tags what it is:

but we will discuss in the next chapter.

Example - How do "containers" work in HTML?
This is an editor and you can change parameters in the box below
  <!DOCTYPE html>
<html>
<head>
<title>How do "containers" work in HTML? - example</title>

<style>
.container {
width: 90%;
height: auto;
background-color: #FF9;
margin-right: auto;
margin-left: auto;
color: #066;
} </style>


</head>

<body>
<div class="container">
<h2>your container title here</h2>
<p>This is a paragraph </p>
<p>under the containe box </p>
<p><strong>Your text here</strong></p>
<p> Another text : - 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>
</body>
</html>



container class, fluid, tags, elements, box, border, template, row padding, responsive, size, width, center, table, background color
HTML 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.


Upload Image, display, edit and delete i...
Login Form with Image background...
How to Create an Image with Transparent ...
Portfolio Gallery Website with filtering...
Simple pagination script PHP MySQLi...
Center Image in div...
Image Hover Overlay Fade...
Sticky image / element / div on scroll...
Responsive images...
Create rounded image in HTML CSS...
Add border around image...
Position Text Over an Image HTML CSS res...
Create a Slideshow Images Gallery...
Create a Sticky Sidebar...
Search bar using CSS HTML...
Shrink Navigation Menu on Scroll...
How to Create Accordion HTML Templates...
Dropdown menu in the navigation bar...
Responsive Top Navigation Bar with mobil...
Split horizontal navigation bar...