Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS Language Speak: Container vs Wrapper?

Tags:

html

css

What's the difference between container and wrapper? And what is meant by each?

like image 517
keruilin Avatar asked Oct 30 '10 14:10

keruilin


People also ask

What is a CSS container?

CSS provides web developers with the two most useful classes i.e. container and panels. They are used to place content together with same font-color, background-color, font-size, font-family, etc. w3-container: This class is used to add 16px padding on both the left and right side of the element.

What are wrappers HTML?

What is a HTML Wrapper? An HTML wrapper allows you to center content within a webpage. tag – or ideally in a separate style sheet) to make the wrapper work. The key components we'll talk through are the centering component, the width of the wrapper and the internal padding.

What is CSS container class for?

CSS w3-container class is the perfect CSS class for HTML containers. It can be used to display all kinds of headers, footers, articles, sections, alerts, notes, panels, or quotes.

What is a div wrapper?

A wrapper is an element, commonly a div, that encloses one or more other. elements in the HTML markup, e.g.: <div id="wrap"> <h1>Headline</h1>


1 Answers

According to this answer:

In programming languages the word container is generally used for structures that can contain more than one element.

A wrapper instead is something that wraps around a single object to provide more functionalities and interfaces to it.

This definition matches with meaning of words and it's useful for HTML structures like:

<ul class="items-container">     <li class="item-wrapper">         <div class="item">...</div>     </li>     <li class="item-wrapper">         <div class="item">...</div>     </li>     <li class="item-wrapper">         <div class="item">...</div>     </li>     <li class="item-wrapper">         <div class="item">...</div>     </li>     <li class="item-wrapper">         <div class="item">...</div>     </li> </ul> 
like image 195
m.rufca Avatar answered Sep 19 '22 21:09

m.rufca