Date: 2025-01-15 Page is: DBtxt003.php txt00018733 | ||||||||||
Computer Science | ||||||||||
Burgess COMMENTARY Peter Burgess | ||||||||||
This is your last free story this month.
Upgrade for unlimited access
5
Upgrade
Peter Burgess
Better Programming
ARCHIVE
WRITE FOR US
STYLE GUIDE
JOB BOARD
ABOUT
Getting Started With W3.CSS
Kick start your web-development project via a lightweight and responsive CSS framework called W3.CSS
Ng Wai Foong
Ng Wai Foong
Follow
Sep 18, 2019 · 9 min read
Photo by Pankaj Patel on Unsplash
In this article, I will be introducing an easy-to-use framework called W3.CSS.
Please note: This framework is meant for lightweight projects. I strongly recommend this to those that have just started out in web development in order to familiarize themselves with CSS.
The features available are good enough for a simple website. Based on the official website:
W3.CSS is a modern CSS framework with built-in responsiveness. It supports responsive mobile-first design by default, and it is smaller and faster than similar CSS frameworks.
W3.CSS can also speed up and simplify web development because it is easier to learn and easier to use than other CSS frameworks.
The main advantage is that it is free to use without any licensing required. On top of that, you can easily include it in your project with just a single line of code. We’ll cover three main areas in this article:
Setting up
Basic usage
Conclusion
Setting Up
Version
There are two different versions available:
Default: The original version provided by the official site. At the time of this writing, the latest is version 4.13.
Professional: It is free to use, just like the default version. The pro version is smaller and faster because it has no colors defined. The pro version is designed for use with themes or other color classes supplied by the developer.
Download
You can download the CSS script and link it locally or just follow the code supplied at this link:
For the professional version, you can use the following link:
You can define your own color using the style tag if you are using the professional version:
In addition, you can load your own theme as well, just like the following example:
Each theme will have the following classes:
w3-theme-l5
w3-theme-l4
w3-theme-l3
w3-theme-l2
w3-theme-l1
w3-theme
w3-theme-d1
w3-theme-d2
w3-theme-d3
w3-theme-d4
w3-theme-d5
Basic Usage
All of the CSS classes start with a w3- prefix. You can easily add it inline inside the class of the tag. In this article, I will list out a few important classes we can use to style our page. Let’s have a look at a container class below:
Background color
You can easily add color to a div tag using the w3- Welcome to Medium! Welcome to Medium! Welcome to Medium! Showing a blue border. w3-card w3-card-2 w3-card-4 Top Left
Top Right
Bottom Left
Bottom Right
Left
Right
Middle
Top Middle
Bottom Middle
w3-round
w3-round
w3-round
w3-round
Button
The w3-button class can be easily paired with any w3-
Normal (100% opacity): w3-sepia: w3-opacity (60% opacity): w3-grayscale: Input You can easily style a text input with your w3-input class. By default, it will just show a straight line as the input, but you can add a border to it via the w3-border class.
Checkbox Styling checkboxes is pretty straightforward with the w3-check class.
Radio Likewise, you can use a w3-radio class for radio buttons. Select Use w3-select to style the select tag. Remember to add in w3-border if you intend to display a border. Conclusion Congratulations on reaching the end of this article. Let’s recap what we have learned today. First, we explored a few ways to install and setup W3.CSS. Then, we moved on to the basic usage of this framework. We can easily define our class inline, and all of the classes use the w3- prefix. We can easily style our elements using the basic classes. You can also add classes on top of each other inline to create the style that you desired. W3.CSS is definitely a great framework for those that have just started to do web development. It saves you the trouble of having to configure and set up properly before you can even start to code. Check out the following link to find out more about the rest of the classes available. Thanks for reading — I will be writing on the advance classes that involve a bit of JavaScript in the next article. Reference https://github.com/JaniRefsnes/w3css https://www.w3schools.com/w3css/w3css_downloads.asp https://www.w3schools.com/w3css/w3css_intro.asp https://www.w3schools.com/w3css/w3css_references.asp Better Programming Advice for programmers. Follow 117 Web Development CSS Lightweight HTML Programming 117 claps Ng Wai Foong WRITTEN BY Ng Wai Foong Follow AI Engineer@Yoozoo | Content Writer #NLP #datascience #programming #machinelearning | Linkedin: https://www.linkedin.com/in/wai-foong-ng-694619185/ Better Programming Better Programming Follow Advice for programmers. Write the first response More From Medium More from Better Programming If Programming Languages Had Honest Slogans Anupam Chugh in Better Programming Apr 19 · 3 min read 7.6K More from Better Programming 100 of the Best Engineers, Developers, Coders, and Entrepreneurs to Follow Online Jana Bergant in Better Programming Apr 15 · 29 min read 2.3K More from Better Programming Should You Stop Using .forEach() in Your JavaScript Code? Joey Colon in Better Programming Apr 14 · 4 min read 1.3K Discover Medium Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch Make Medium yours Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore Become a member Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade About Help Legal
| |