CSS FRAMEWORK
CSS FRAMEWORK
W3.CSS Introduction
What is W3.CSS?
• W3.CSS is a modern framework with built-in responsiveness and easy to learn and
use compared to other CSS frameworks.
• It aims to speed up and simplify web development and support modern responsive
devices like Mobile, Laptop, Tablet and Desktop.
• W3.CSS was designed to be a high-quality alternative to Bootstrap.
W3.CSS Colors
W3.CSS provides us with classes to set the color of font and container. Not only this,
there are also classes to change or set the color of the font or container on hover the
division or section. All the coloring elements can be broadly be classified into the
following parts:
• Background Color
• Text Color
• Hover Background Color
• Hover Text Color
W3.CSS - Containers
HTML5 has the following container elements −
W3.CSS Panels
w3-panel: This class adds 16px padding on all sides i.e. top, right, bottom, left. It can
also be used with all the HTML5 container elements i.e. div, article, section, header,
footer, etc. All the elements inside this class share the same font-size, font-color,
padding, alignment, etc.
W3.CSS Border
Borders are generally used to display an outline around a box or table cell or any other
HTML element. In W3.CSS, there are different classes available to add or remove
borders. The classes that are used to add borders are referred to as additive classes and
those that are used to remove borders are referred to as subtractive classes.
Color of Borders: Any color can be added to the border by using the following border-
color classes that are available in W3.CSS. If you want any other customized color, then
you can set it manually using the CSS attribute.
Thick Border:
You can add a thick border to any side of the targeted element by using W3.CSS border
classes.
Wide Text: To make the text appear to look wider we make use of a w3-wide class of
W3.CSS.
Font Sizes:
You can set the font of the text using the size classes of the W3.CSS. The classes that
come under this category are as follows:
1. w3-tiny This class sets the font size of the targeted element to 10px.
2. w3-small This class sets the font size of the targeted element to 12px.
3. w3-large This class sets the font size of the targeted element to 18px.
4. w3-xlarge This class sets the font size of the targeted element to 24px.
5. w3-xxlarge This class sets the font size of the targeted element to 32px.
6. w3-xxxlarge This class sets the font size of the targeted element to 48px.
7. w3-jumbo This class sets the font size of the targeted element to 64px.
Font Styles: W3.CSS also has some inbuilt font styles which can be extensively used to
decorate webpages. The list of the classes for the font styles are as follows:
Sr. No. Class Name Description
W3.CSS Tables
W3.CSS provides a series of classes that can be used to apply various styling to the
tables such as changing the heading appearance, making the rows stripped, adding or
removing borders, making rows hoverable, etc. W3.CSS also provides classes for
making tables responsive.
Simple Table: The .w3-table class is used to create a simple W3.CSS table. This class
name is used with <table> tag to create a table.
Syntax:
<table class="w3-table"> Table Contents... <table>
Stripped rows: The .w3-stripped class is used to create an alternate dark and light rows.
Use the combination of table, w3-table, and w3-stripped classes within the <table> tag to
create a stripped table.
Syntax:
Bordered Table: The .w3-border is used to add a border across the table. The border
only occurs around the table and not in the table. The see this effect use .w3-border
together with .w3-table in the table tag.
Syntax:
<table class="w3-table w3-border"> Table Contents... <table>
If we want a completely bordered table we have to use .w3-bordered class along with
.w3-border and w3-table inside the table tag.
Hoverable Table: The .w3-hoverable class is used to add a hover effect (change
background color to gray when the mouse moves over) on table rows. Use the
combination of w3-table and w3-hoverable classes within the <table> tag to create a
hover rows table.
Syntax:
<table class="w3-table w3-hoverable"> Table Contents... <table>
Centered Content Table: The .w3-centered class is used to place all the content of the
table to the center. Use the combination of w3-table and w3-centered classes within the
<table> tag to create this effect.
Syntax:
<table class="w3-table w3-centered"> Table Contents... <table>
W3.CSS - Lists
W3.CSS can be used to display different types of lists using various styles over
w3-ul.
w3-ul
1
Represents a basic list without any border.
w3-striped
2
Displays a stripped list.
w3-bordered
3
Draws a list with border across rows.
w3-border
4
Draws a list with border.
w3-card
5
Draws a list as a card.
w3-tiny
6
Draws a list with very small font.
7 w3-small
Draws a list with small font.
w3-large
8
Draws a list with large font.
w3-xlarge
9
Draws a list with extra large font.
w3-xxlarge
10
Draws a list with very extra large font.
w3-xxxlarge
11
Draws a list with very high extra large font.
w3-jumbo
12
Draws a list with jumbo large font.
W3.CSS - Images
W3.CSS provides options to display images in beautiful and interesting ways using
w3-image as the main class.
w3-image
1
Represents a basic styled image without any border.
w3-circle
2
Displays an image within a circle
w3-title
3
Used to put text over an image.
w3-card
4
Draws an image as a card.
W3.CSS - Grids
W3.CSS provides a 12 column fluid responsive grid.
It uses the w3-row and w3-col style classes to define rows and columns
respectively.
2 w3-col
Specifies a column with sub-classes
1 s1
Defines 1 of 12 columns with width as 08.33%.
2 s2
Defines 2 of 12 columns with width as 16.66%.
3 s3
Defines 3 of 12 columns with width as 25.00%.
4 s4
Defines 4 of 12 columns with width as 33.33%.
s12
5
Defines 12 of 12 columns with width as 100%. Default class for small screen
phones.
Here is a list of column-level styles for medium screen devices, typically tablets.
1 m1
Defines 1 of 12 columns with width as 08.33%.
2 m2
Defines 2 of 12 columns with width as 16.66%.
3 m3
Defines 3 of 12 columns with width as 25.00%.
4 m4
Defines 4 of 12 columns with width as 33.33%.
m12
5
Defines 12 of 12 columns with width as 100%. Default class for medium
screen phones.
Here is a list of column-level styles for large screen devices, typically laptops.
1 |1
Defines 1 of 12 columns with width as 08.33%.
2 |2
Defines 2 of 12 columns with width as 16.66%.
3 |3
Defines 3 of 12 columns with width as 25.00%.
4 |4
Defines 4 of 12 columns with width as 33.33%.
|12
5
Defines 12 of 12 columns with width as 100%. Default class for large screen
devices.