Category: CSS

How to vertically center text in CSS Grid and Flexbox

Take this simple HTML: And, some basic styling: It looks like this: Now, we want to center this text vertically. The first modern approach you can take is with flexbox. Just add these two lines to .parent: And, you get this: Simple. It’s very similar with CSS Grid: And, you can add as much text as you want and it’ll get vertically-centered properly. Like this: So, there you go. That said, if you want to go on learning even more HTML and CSS, check out my Website Template course on Skillshare. You’ll learn CSS Grid, CSS transitions, asynchronous requests in

Read More »

2 ways to horizontally center a DIV in CSS

Let’s take this simple HTML structure: The first method involves some straight-forward CSS: Doesn’t get much simpler than that: And, if it this is all you need to do, you can probably stop here. But, sometimes what you’re actually trying to do is a little more complicated and you need some more flexibility. Enter CSS Grid: Here, we’re creating a grid with 1 column that fills the entire space of the parent DIV. Then, a child DIV with a 60% width. And, using justify-items to center the child DIV. This might seem like overkill for something this simple, but it

Read More »

CSS transitions

CSS transitions are another simple thing you can do that can add some “spice” to your websites. Take this menu animation, for example: ​​​​​We build this in my latest SkillShare course and it not only “looks cool”, but it gives the user important visual feedback. These little things are how you start to make a website or application “feel” intuitive. Anyway, transition properties are pretty straight-forward: div { transition-property: width; transition-duration: 2s; transition-timing-function: linear; transition-delay: 1s; } Here’s what each property is: transition-property is the property of the element to transition. transition-duration is how long the transition will last transition-timing-function is the “effect”

Read More »

Building a responsive grid with CSS Grid

If you haven’t messed with it, yet… CSS Grid is pretty handy. Take this HTML, for example: <div class=”wrapper”> <div class=”box”>1</div> <div class=”box”>2</div> <div class=”box”>3</div> </div> We can easily create a grid like this: .wrapper { display: grid; grid-template-columns: 100px 100px 100px; grid-gap: 10px; } That’ll give you a grid that looks something like this: And, you can do even more complex layouts like this:​​​​ With just a few lines of code. Again, pretty handy. Anyway, one of the things I immediately wanted to do was build a Bootstrap-like grid system using CSS Grid. So, I did… and I put it

Read More »

NEW COURSE: Build an AJAX-powered freelance website template

Just released a new project-based course. In this one you’ll learn: How to submit form data using AJAX How to build a responsive grid with CSS Grid How to send a contact email using PHP How to build a mobile menu using CSS transitions How to build a website using HTML, CSS, jQuery and PHP And, plenty more. Full source code is included. You can get access to it for nothing here: https://skl.sh/2xM6Y3l Later, John P.S. If you’re a Patreon supporter, you can access the course here: https://www.patreon.com/posts/21697046

Read More »

The One-Line Difference Between Ugly and Amazing Websites

Forget personal taste. I’m telling you as sure as I’m sitting here… whatever your personal thoughts about the differences between this before and after… one will get you, “Um well… something just feels off.” And, the other: “Wow! Clean, fresh. Amazing!” It’s just how people are. Anyway, here’s the before: And, here’s the after: This is a template I’m working on for a new course I’m doing. And, the difference is a single CSS declaration, but it’s light-years in terms of how it looks and how clients will react to it. The code? body, p, h1, h2, h3, h4, h5,

Read More »

The simple secrets to high-paying freelance clients

What makes clients willing to pay $5,000, $10,000 even $20,000 and up for your services? Download and install my mobile app and I’ll show you. It’s free. Just click the button below:

Clients Like:

Inc. Magazine Logo
Lewis Howes Logo
Ray Edwards Logo

WHAT OTHERS ARE SAYING

Oliver Wainwright

Oliver Wainwright

I’m a fan. I have completed several of John’s courses. I find him very knowledgeable and he has a great delivery.

Chris Aitken

He significantly improved my site through his expert knowledge of PHP, CSS and Javascript. Would definitely recommend John to others.

Thabo Motsoahae

John is one of the best instructors I have come across, I learned a lot from his online tutorials.

Aaron Gott

Aaron Gott

John has a particular knack for the development and training of others.

Ray Edwards

I recommend John every chance I get. If every person I worked with were as committed to excellence, punctuality, value, and unquestionable integrity… the world would be a better place. Highest recommendation.

Steve Dimmick

Steve Dimmick

John has provided expert knowledge and advice on multiple occasions that have helped me better serve my clients. John is a Rockstar!

Bob Patterson

Not only is John a very talented programmer and developer, he is also an excellent communicator. He has a talent for taking complex subjects and communicating them in terms that anyone can understand. This is a rare combination. This ability has enabled me to take my skills and knowledge to the next level. Thank you John for for all that you do.

Michael Skye

Michael Skye

John is a man of integrity, who gives generously of himself to projects and people he cares about.

Andrew Malone

Andrew Malone

John Morris is exceptional in his ability to give focused insight into Freelancing and starting one’s business. His direct methods inspire confidence in his honesty.

Jason Rumley

Jason Rumley

John has a habit of over-delivering on the expectations he sets up. That’s why he’s the best.

Lori Grant

John did an outstanding job on my project. I highly recommend him and look forward to working with him on future projects.

Sukh Plaha

John is a fantastic and patient tutor, who is not just able to share knowledge and communicate it very effectively – but able to support one in applying it. However, I believe that John has a very rare ability to go further than just imparting knowledge and showing one how to apply it. He is able to innately provoke one’s curiosity when explaining and demonstrating concepts, to the extent that one can explore and unravel their own learning journey. Thanks very much John!

Jim DeJonge

Jim DeJonge

John has a relaxed and engaging manner. His advice is solid and the explanations are well thought out.