Category: CSS Snippets

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 »

How to Style HTML Input Placeholders In CSS

Let’s start with the HTML: So, now we want to style the placeholders themselves. If you want to keep it simple, most modern browsers support this: You can use the ::placeholder pseudo-class like any other. For older browser support it looks like this: So, let’s look at a real-world example: A simple form. Nothing fancy, but notice the placeholder text for the required email field is a different color. This is one simple example of how you might use something like this. Here’s the full HTML: And, here’s the full CSS: So, there you go. Now, speaking of real-world examples,

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 »

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 »

Responsive Web Design: Building a Responsive Menu

In this responsive web design tutorial, you’ll learn how to build a responsive menu. You’ll learn: how to target different breakpoints with media queries how to write the CSS to “flip” the menu from vertical to horizontal view at those breakpoints how to use jQuery to create a responsive navigation icon that toggles the mobile menu Watch the tutorial below: Links mentioned in the video: Discount link to Rob’s Complete Web Developer Course My review of the the Complete Web Developer Course My web developer resources page with more code snippets Here’s the code I used in the video: If

Read More »

Pure HTML and CSS Dropdown Menu

Here’s how to create a pure HTML and CSS dropdown menu: Here’s the code I used in the video: If you get value from this code snippet, please consider sharing it with another developer or group who could benefit from it.

Read More »

Who else wants to build a thriving freelance business?

I’ve helped 39,413 other freelancers start and grow thriving freelance businesses. Are you next? Subscribe to my Freelance Secrets newsletter and I’ll show you how.

Success Stories

Ready to add your name here?

Tim Covello

Tim Covello

75 SEO and website clients now. My income went from sub zero to over 6K just last month. Tracking 10K for next month. Seriously, you changed my life.

Michael Phoenix

Michael Phoenix

By the way, just hit 95K for the year. I can’t thank you enough for everything you’ve taught me. You’ve changed my life. Thank you!

Stephanie Korski

Stephanie Korski

I started this 3 days ago, following John’s suggestions, and I gained the Upwork Rising Talent badge in less than 2 days. I have a call with my first potential client tomorrow. Thanks, John!

Jithin Veedu

Jithin Veedu

John is the man! I followed his steps and I am flooded with interviews in a week. I got into two Talent clouds. The very next day, I got an invitation from the talent specialists from Upwork and a lot more. I wanna shout out, he is the best in this. Thanks John for helping me out!

Divyendra Singh Jadoun

Divyendra Singh Jadoun

After viewing John’s course, I made an Upwork account and it got approved the same day. Amazingly, I got my first job the very same day, I couldn’t believe it, I thought maybe I got it by coincidence. Anyways I completed the job and received my first earnings. Then, after two days, I got another job and within a week I got 3 jobs and completed them successfully. All the things he says seem to be minute but have a very great impact on your freelancing career.

Sarah Mui

Sarah Mui

I’ve been in an existential crisis for the last week about what the heck I’m doing as a business owner. Even though I’ve been a business for about a year, I’m constantly trying to think of how to prune and refine services. This was very personable and enjoyable to watch. Usually, business courses like this are dry and hard to get through…. repeating the same things over and over again. This was a breath of fresh air. THANK YOU.

Waqas Abdul Majeed

Waqas Abdul Majeed

I’ve definitely learnt so much in 2.5 hours than I’d learn watching different videos online on Youtube and reading tons of articles on the web. John has a natural way of teaching, where he is passionately diving in the topics and he makes it very easy to grasp — someone who wants you to really start running your business well by learning about the right tools and implement them in your online business. I will definitely share with many of the people I know who have been struggling for so long, I did find my answers and I’m sure will do too.

Scott Plude

Scott Plude

I have been following John Morris for several years now. His instruction ranges from beginner to advanced, to CEO-level guidance. I have referred friends and clients to John, and have encouraged my own daughter to pay attention to what he says. All of his teachings create wealth for me (and happiness for my clients!) I can’t speak highly enough about John, his name is well known in my home.

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!

Mohamed Misrab

Misrab Mohamed

John has been the most important person in my freelance career ever since I started. Without him, I would have taken 10 or 20 years more to reach the position I am at now (Level 2 seller on Fiverr and Top Rated on Upwork).

Who else wants to build a thriving freelance business?

I’ve helped 39,413 other freelancers start and grow thriving freelance businesses. Are you next? Subscribe to my Freelance Secrets newsletter and I’ll show you how.