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

Container responsive styles


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

HTML Tutorial » Container responsive styles

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

Syntax:

.container {
margin: value;
padding: value;
height: value;
width: value;
background-color: value;
display: flex;
}

<div class="container"> your_text </div>
div is a tag.
class is an attribute of div tag
container is a class name.

In order to have a superior web page design to meet today's requirements, we can style the class of containers such as: responsive, fluid, box, border, row padding, size, width, center, table, background color.

 

Create a flex container

How do you make a Flex container? To create a flex container, we have to set the value of the area's container's display property to flex or inline-flex . The direct children of that container become flex items.

Example
  <!DOCTYPE html>
<html>
<head>
<title>How do you make a Flex container? - example</title>

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


</head>

<body>
<div class="container">
<h2>This is a Flex container? - example</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" or how you like.

 

Related subjects:
div class container contrainer tag div class container

 

How do I make a size box?

How do I make a size"container" box in HTML?
To make a size "container" HTML element you mast declare size value as width and height in <style>:

Example
  <!DOCTYPE html>
<html>
<head>
<title>How do I make a size box? - 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 I make border and padding "containers"?

To make a border and padding "container" element you mast declare border: value, and padding: value as in the next example <style>:

Example
  <!DOCTYPE html>
<html>
<head>
<title>How do I make border and padding "containers"? - example</title>

<style>
.container {
width: 90%;
height: auto;
border: medium solid #F00;
padding: 30px;
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
Container responsive styles - 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...