W3.CSS Framework

Simplify Web Design, Amplify Your Creativity

What is a Web Framework?

Imagine a framework as a powerful toolkit for web developers. It's like a pre-built LEGO set that gives you all the essential pieces to construct a website quickly and efficiently.

Key Benefits:

  • ✓ Saves development time
  • ✓ Ensures consistent design
  • ✓ Provides cross-browser compatibility

Discover W3.CSS: Your Design Superpower

Mobile-First

Responsive design that looks great on all devices, from smartphones to desktops.

Lightweight

Super fast and efficient, with minimal overhead and no jQuery dependencies.

Easy to Learn

Simple, intuitive classes that make web design accessible to everyone.

How to Use W3.CSS

Method 1: Quick CDN Integration

<link rel="stylesheet" href=
"https://www.w3schools.com/w3css/4/w3.css">

Simply paste this link in your HTML's <head> section. Instant styling magic!

Method 2: Download & Custom Setup

  1. Download w3.css from official W3Schools website
  2. Save in your project's CSS directory
  3. Link in your HTML with a local path

W3.CSS Classes: Colors and Hover Effects

W3.CSS provides simple and effective classes for applying colors and hover effects. Let's explore the main classes:

1. w3-color

The w3-color class sets the background color of an element.

This is a background example with w3-blue.

2. w3-text-color

The w3-text-color class changes the text color of an element.

This text is red using w3-text-red.

3. w3-hover-color

The w3-hover-color class applies a background color when the element is hovered over.

4. w3-hover-text-color

The w3-hover-text-color class changes the text color on hover.

Hover over this text to turn it green.

W3.CSS Border Classes

W3.CSS provides an extensive range of classes to manage borders efficiently. Here are the key classes with examples:

1. w3-border

The w3-border class applies a default border around an element.

This is an example of w3-border.

2. w3-border-left, w3-border-right, w3-border-top, w3-border-bottom

These classes apply borders to specific sides of an element.

Left border with w3-border-left.
Right border with w3-border-right.
Top border with w3-border-top.
Bottom border with w3-border-bottom.

3. w3-border-color

Use w3-border-color classes to set the border color.

Red border using w3-border-red.
Blue border using w3-border-blue.

4. w3-hover-border-color

The w3-hover-border-color class changes the border color on hover.

Hover me to see a green border.

5. w3-topbar and w3-bottombar

These classes create a top or bottom border with increased thickness.

Topbar with w3-topbar.
Bottombar with w3-bottombar.

W3.CSS Font Size Classes

W3.CSS provides font size classes to adjust text sizes responsively. Below is a table that lists these classes with descriptions and examples:

Class Name Description
w3-tiny Applies a very small font size.
w3-small Applies a small font size.
w3-large Applies a large font size.
w3-xlarge Applies an extra-large font size.
w3-xxlarge Applies a double-extra-large font size.
w3-xxxlarge Applies a triple-extra-large font size.
w3-jumbo Applies a jumbo font size for headings or emphasis.

W3.CSS Text Classes

W3.CSS offers a variety of text-related classes for alignment, spacing, and styles. The table below explains these classes:

Class Name Description Example
w3-left Aligns text to the left. This text is left-aligned.
w3-center Centers the text. This text is centered.
w3-right Aligns text to the right. This text is right-aligned.
w3-wide Adds letter-spacing to text. This text is wide-spaced.
w3-opacity Applies transparency to text. This text is semi-transparent.

W3.CSS Table Classes

W3.CSS provides various table classes to style your tables efficiently. Below is a table that explains and demonstrates these classes:

Class Name Description Example
w3-table Applies default table styling with full-width.
Sample Table
w3-striped Alternates background colors for rows.
Row 1
Row 2
w3-bordered Adds borders to the table and cells.
Cell 1
w3-border Adds a single border around the table.
Cell 1
w3-hoverable Highlights rows on hover.
Hover Row
w3-centered Centers the table content.
Centered

W3.CSS Container

The w3-container class provides consistent padding and spacing, making it ideal for sectioning content on a webpage.

This is a W3.CSS container. It ensures uniform padding and spacing.

W3.CSS Panel

The w3-panel class creates bordered content blocks, making sections visually distinct and highlighted.

This is a W3.CSS panel. It adds borders and spacing to the content.

W3.CSS Rounded Panel

The w3-round class rounds the corners of elements. Combine it with w3-panel for elegant designs.

This is a W3.CSS rounded panel. Rounded corners add a modern and polished look.

1. W3.CSS Button

The w3-button class styles buttons with padding, rounded corners, and hover effects.

This is an example of a styled W3.CSS button.

2. W3.CSS Display Container

The w3-display-container class is used to position elements within a container easily.

Top Right
Bottom Left

This is a display container.

3. Collapsible Panel

A collapsible panel allows content to be toggled open or closed using buttons.

x

My Heading

This is the content inside the collapsible panel. You can hide or show this section by clicking the button above.

4. W3.CSS Display Positions

Use w3-display-position classes like w3-display-topright, w3-display-middle, and more to position elements within containers.

Top Right
Center

1. W3.CSS Button

The w3-button class styles buttons with padding, rounded corners, and hover effects.

This is an example of a styled W3.CSS button.

2. Collapsible Panel

A collapsible panel allows content to be toggled open or closed using buttons.

This is the content inside the collapsible panel. You can hide or show this section by clicking the button above.

W3.CSS Lists

W3.CSS provides the w3-ul class to create styled, uniform, and responsive lists. Additional classes such as w3-border, w3-center, and w3-hoverable can enhance their appearance.

Here is a styled list using W3.CSS:

3. W3.CSS Lists

Closable List Items

Closable list

Avatar List

You can combine w3-ul and the w3-bar classes to create an avatar list:

List Sizes

The size of the list can be adjusted using W3.CSS classes like w3-small, w3-large, and more.

W3.CSS Image Classes

Learn how to style images using W3.CSS classes like w3-round, w3-circle, w3-border, and w3-grayscale.

1. Rounded Corners (w3-round)

This class applies rounded corners to the image, giving it a smooth and modern look.

Rounded Corners

2. Circle (w3-circle)

The w3-circle class creates a circular image. This is ideal for profile pictures or decorative elements.

Circle Image

3. Bordered Image (w3-border)

Adds a simple border around the image, which enhances visibility and separates it from the background.

Bordered Image

4. Grayscale Image (w3-grayscale)

Converts the image to grayscale. This is useful for placeholders, subdued backgrounds, or stylish effects.

Grayscale Image

Image Text

Position content inside an image with the w3-display-classes - Note that we have added the w3-container class to get more padding:

Lights

Top Left

Top Right

Bottom Left

Bottom Right

Left

Right

Middle

Top Middle

Bottom Middle