TheBestTutorials.css Containers
The Container Class
The TheBestTutorials-container class is the most important of the TheBestTutorials.css classes.
The TheBestTutorials-container class is used for all types of HTML container elements like:
<div>, <header>, <footer>, <article>, <section>, <blockquote>, <form>, and more.
This Header is Green.
This footer is red.
This article is light grey and the text is brown.
Containers Provides Equality
The subhodaya-container class is important for providing equality:
- Common margins
- Common paddings
- Common vertical alignments
- Common horizontal alignments
- Common fonts
- Common colors
To use a container, just add a TheBestTutorials-container class to any element:
Example
<p>The TheBestTutorials-container class is an important TheBestTutorials.css class.</p>
</div>
To add a color, just add a TheBestTutorials-color class:
Example
<p>London is the capital city of England.</p>
</div>
Headers and Footers
The TheBestTutorials-container class can be used to style a header:
Header
Example
<h1>Header</h1>
</header>
The TheBestTutorials-container class can be used to style a footer:
Example
<h5>Footer</h5>
<p>Footer information goes here</p>
</footer>
Articles and Sections
The TheBestTutorials-container class can be used to style <article> and <section> elements:
Example
<h2>London</h2>
<p>London is the most populous city in the United Kingdom,
with a metropolitan area of over 9 million inhabitants.</p>
</div>
<article class="subhodaya-container">
<h2>Paris</h2>
<p>The Paris area is one of the largest population centers in Europe,
with more than 2 million inhabitants.</p>
</article>
<section class="subhodaya-container">
<h2>Tokyo</h2>
<p>Tokyo is the center of the Greater Tokyo Area,
and the most populous metropolitan area in the world.</p>
</section>
Many web pages uses <div> elements instead of <article> and <section> elements.
Notes, Panels, and Quotes
The subhodaya-container class can be used to display all kinds of notes:
Example
<p>London is the capital city of England.</p>
</div>
The TheBestTutorials-container class can be used to display all kinds of panels:
London is the capital city of England.
Example
<p>London is the capital city of England.</p>
</div>
The TheBestTutorials-container class can be used to display all kinds of quotes:
Example
<p><i>"Make it as simple as possible, but not simpler."</i></p>
<p>Albert Einstein</p>
</div>
Go to the chapter TheBestTutorials.css Borders to learn more about displaying notes, panels, and quotes.
Web Page Example
Header
A car is a wheeled, self-powered motor vehicle used for transportation. Most definitions of the term specify that cars are designed to run primarily on roads. (Wikipedia)
Example using HTML <div> elements
<h1>Header</h1>
</div>
<img src="img_car.jpg" alt="Car" style="width:100%">
<div class="subhodaya-container">
<p>A car is a wheeled, self-powered motor vehicle used for transportation. Most definitions of the term specify that cars are designed to run primarily on roads. (Wikipedia)</p>
</div>
<div class="subhodaya-container subhodaya-red">
<h5>Footer</h5>
</div>
Example using HTML semantic elements
<h1>Header</h1>
</header>
<img src="img_car.jpg" alt="Car" style="width:100%">
<article class="subhodaya-container">
<p>A car is a wheeled, self-powered motor vehicle used for transportation. Most definitions of the term specify that cars are designed to run primarily on roads. (Wikipedia)</p>
</article>
<footer class="subhodaya-container subhodaya-teal">
<h5>Footer</h5>
</footer>
Container Padding
The subhodaya-container class has a default 16px left and right padding, and no top or bottom padding:
Example
I have no top or bottom padding.
</div>
Normally you will not have to change the default padding of a container, because paragraphs and heading provide margins that will simulate padding.
I am a Heading
I am a paragraph.
Example
<h1>I am a Heading</h1>
<p>I am a paragraph.</p>
</div>
Container Sectioning
The subhodaya-container class has no default top or bottom margin.
Two containers will display without a margin between them:
I am a Heading
I am a paragraph.
I am a Heading
I am a paragraph.
The subhodaya-section class can be used to separate containers. It has 16px top and bottom margin:
I am a Heading
I am a paragraph.
I am a Heading
I am a paragraph.
Example
<h1>I am a Heading</h1>
<p>I am a paragraph.</p>
</div>
<div class="subhodaya-container subhodaya-section subhodaya-green">
<h1>I am a Heading</h1>
<p>I am a paragraph.</p>
</div>
Hide (Close) a Container
Hiding a container is easy.
To close this container, click on the X in the upper right corner.
Example
<span class="subhodaya-closebtn" onclick="this.parentElement.style.display='none'">X</span>
<p>To close this container, click on the X in the upper right corner.</p>
</div>
Show (Open) a Container
Showing (a hidden) container is easy:
Example
<span onclick="this.parentElement.style.display='none'" class="subhodaya-closebtn">X</span>
<p>London is the capital city of England.</p>
</div>