Create United States Flag with HTML and CSS

Happy Independence Day to all the citizens of United States of America. My old post of creating Indian Flag with HTML and CSS was very popular among my readers. So today I want to create American Flag with HTML and CSS to celebrate US Independence Day.

Learn to create United Stages Flag with HTML and CSS. US Flag is fun.
Flag of the United States of America.

United States Flag or American Flag is rectangular in shape like most flags. It has 13 horizontal stripes which are of two alternating colors red and white. There is a blue rectangle (called as a canton) with 50 small white five pointed stars.

US Flag which is also called as Stars and Stripes, Old Glory and the Star Spangled Banner has been a proud symbol of freedom, democracy and liberty in the world.

Lets break down this challenge into easy steps.

  1. US Flag has 13 Horizontal stripes, which are of equal height. So let us take height of each stripe to be 20px. I have chosen this height so that we do not run into decimals or fractions when it comes to aspect ratio.
  2. US Flag has several predefined aspect ratios. So let us take flag ratio of 1.9 which means we can build a flag with dimensions 494px width x 260px height.
  3. Among 13 Horizontal Stripes, there are 7 red stripes and 6 white stripes.
  4. Width of Blue Canton is 2/5th width of the flag. This means width of Canton is 197.6px.
  5. Blue Canton spans 7 stripes in height. Hence its height is 140px.
  6. There are 50 white stars in total. They are arranged in 5 rows of 6 stars and 4 rows of 5 stars. Let us assume height of each star is 16px.
  7. Approximate Hex Codes of Flag Colors are Red (#B22234), Blue (#3C3B6E) and White(#FFFFFF).

So we have got all the data to build the US Flag. Let us write some code.

HTML Code

We will plan our HTML as follows.

  • Let us have an outer div with class flag
  • The Flag div will have 13 divs with class ‘stripe’ and 1 div with class ‘canton’. To do this very quickly, we can take help of emmet and type .flag>.stripe*13+.canton and press enter
  • Stripe will be empty divs. Canton will have 9 rows of div with class star-rows. Each star row will have 6 spans or 5 spans called star with a unicode character ★ or ‘★‘.
  • You can do this quickly using emmet once again by typing .star-row9>span.star{★}*6and press enter. You can eliminate addition star from alternate rows.
  • We will add a message I ❤️ USA at the bottom of the flag.

Here is the HTML Code.

CSS Code

Let us apply CSS code to our flag by applying a mini reset.

  • The flag class as per the specification will have a width of 494px and height of 260px. We can give some top and bottom margin. Let us set its position to relative which will help us to position canton later. Let us give some box shadow for visual appeal.
  • The stripe class will have an height of 20px. Now comes the fun part. In order to assign background colors to alternate red and white stripes we will make use of CSS nth-child selector. .stripe:nth-child(odd) selects all odd stripes from first one and .stripe:nth-child(even) selects all even stripes.
  • The blue canton will have to be positioned absolute with respect to top left corner of the flag. It has a height of 140px.
  • The stars are the most trickiest part of this flag challenge. Let us assign a height of 15px for 9 star-rows. The star-row will display all its child elements as a flex. Let us assign white color to our star spans.
  • US Flag stars are arranged differently in alternate rows. To achieve this we will use the nth-child selector once again. However for the odd rows we will use justify-content:space-around and for even rows we will use justify-content:space-evenly. Voila, the star arrangement is perfect !
  • We will style our message and show some love to the flag !

Here is the final CSS.

Finally we have built the US Flag with HTML and CSS. Here is the CodePen

See the Pen US Flag by Tech Jasmine (@techjasmine) on CodePen.

I hope you have enjoyed this challenge. Its a good challenge to test your skills in HTML and CSS. Using nth-child selector is a coolest part. Of course there are thousand different ways to achieve the result, but this is my little approach. If you have any suggestions, let me know about it 🙂

Wish you once again a very happy 4th of July 🇺🇸 !

Keep Coding ! Keep Smiling 🙂

Best Web Development Tutorials on YouTube

Ever since the inception of YouTube, there have been thousands of people who have imparted free education to their followers. Today you can learn to play a guitar, or basics of gardening or speak a new language or get good at Math, all at the comfort of your couch.

Web Development and Software development in general is no different. You can find some of the best instructors on YouTube to learn everything about a programming language, build projects, acquire new skills, improve your code quality etc.

Since there are thousands of hours of content one can simply binge watch, it is most important to focus on only those videos which will help you achieve your goals. Whether you are a student or an employee or a freelancer, the best way to improve your skills and achieve your goals is to build projects. If you are a web developer, I cannot stress this point enough.

Among ocean of resources on YouTube, there is only bucketful of full fledged, project focused web development tutorials. This is because coming up with an idea for a project is hard. A content creator needs to spend considerable amount of time working on the idea, translating the idea into code, polishing the content and finally delivering it as a tutorial.

My blog post aims to make a curated list of best web development tutorials on YouTube. You will end up creating tangible projects at the end of each tutorial which you can showcase in your portfolio.

I aim to keep this list up to date and weed out any outdated tutorials.

HTML and CSS

Components

Full Websites / Landing Pages

Libraries

JavaScript

React

Vue

NodeJS

GraphQL

MERN Stack

PHP

Django

WordPress

I hope you will find this curated list of Best Web Development Tutorials on YouTube very helpful . There are still hundreds of good creators and thousands of awesome tutorials. So I apologize if I have missed any good content creator or any good tutorial. You can always share them in comments.

Keep Coding, Keep Smiling !

PS: If I have helped you and made a difference in your life, considering supporting my blog.

Create Indian Flag with HTML and CSS

How cool will it be if we can create Indian Flag with HTML and CSS ! Let’s build it together.

Indian Flag

Indian Flag is a rectangular flag with Saffron, White and Green tricolor stripes and Navy Blue Ashoka Chakra, a 24 spoke wheel at the center. Our flag has a long history and is a powerful symbol which unites our countrymen.

So let’s break down the challenge of into multiple steps.

  • Indian Flag has a pre-defined aspect ratio for various flag size. For our reference let’s build a flag of 225px x 150px
  • Indian Flag has 3 rectangular stripes. So we need 3 <div> for each stripe which are of same dimension. In our case width needs to be 225px and each stripe needs to be 50px in height. So that 3 x 50px = 150px
  • We need hex color codes for Saffron, White and Green stripe. My quick glance at Wikipedia gives me following approximate hex codes which will be good to represent our flag.
    • India Saffron – #FF9933
    • White – #FFFFFF
    • India Green – #138808
  • We can use this image from Wikipedia for Ashoka Chakra at the center of the white stripe. The hex code for navy blue Ashoka Chakra if you are curious is #000080, which we will use later for a message.

Let’s translate above steps into HTML

Ok wonderful ! Now let’s style our flag using CSS.

Hurray ! We have completed creating Indian Flag with HTML and CSS.

Here is the CodePen.

See the Pen Indian Flag by Tech Jasmine (@techjasmine) on CodePen.

I usually present this simple challenge to junior developers when recruiting. I look for following points in the implementation

  • The use of width and height for div
  • Use of reusable classes for 3 Stripes of same dimension and id for each individual colors
  • Ashoka Chakra, which is a major challenge for many. You need to set the size of the image and center it in the white stripe. Skilled candidates use CSS Flex for white stripe to center the image. Some also make image as a block, set margin : auto to center it and add padding to the top of the white stripe.

Ofcourse this project can be implement in different ways, using different CSS properties.

Overall making Indian Flag with HTML and CSS is a fun challenge. Try to create the flag if your country using HTML and CSS. Let me know about it in the comments. Always ask for help if you need it.

Keep Coding, Keep Smiling !

PS: If I have helped you and made a difference in your life, considering supporting my blog.

Top Udemy Courses for Web Development

Udemy Courses are one of the best and cheapest way to learn a variety of topics ranging from Web Development, Software Development, Graphics Design, Photography, Music, Finance, Accounting, Self Help, Health and fitness.

Udemy has its sale at various times during a year. But they have longest sale with great discounts during the first week of new year. This year they are offering some great courses for less than $10 up to January 9th.

This blog post aims to list top Udemy Courses for Web Development.

My choice of these courses are based on a combination of concepts + contents + real world projects + course updates + beginner friendliness + value for money. Honestly these are my personal opinion and selecting few courses from an ocean of courses was a real challenge.

Front End

HTML + CSS

Javascript

Typescript

Frameworks

React

Angular

Vue

Back End

NodeJS

GraphQL

Django

PHP

Database

Full Stack

MERN Stack

MEAN Stack

LAMP Stack

Bootcamps

Beginner

Advanced

WordPress Development

I hope you will find these Udemy Courses useful in your web development journey. There are lots of other great instructors and great courses as well. I hope to cover lesser known instructors with great content in future post.

Keep Coding, Keep Smiling !

PS: If I have helped you and made a difference in your life, considering supporting my blog.

Free Online Full Stack Web Development Bootcamps 2020

Hello friends, I’m going to review top Free Online Full Stack Web Development Bootcamps in 2020. I think 2020 is going to be a golden year of free online education with so many resources to kick start your web development journey.

Here is the list of free online web development bootcamps I’ll be covering in this post.

  1. freeCodeCamp
  2. The Odin Project
  3. Full Stack Open
  4. App Academy Open
  5. CS50 Web Programming

freeCodeCamp

freeCodeCamp is one of the top web development resources recommended online especially to the beginners. It’s a non-profit started in the year 2014 by Quincy Larson who aims to provide top quality software education to the students for free. This initiative has helped thousands of students get jobs and earn a decent living.

freeCodeCamp offers you certifications on following topics which are divided into modules.

  • Responsive Web Design
  • JavaScript Algorithms and Data Structures
  • Front End Libraries
  • Data Visualization
  • APIs and Microservices
  • Information Security and Quality Assurance
  • Coding Interview Prep

Each modules takes about 300+ hours to complete and focuses on core topics related to HTML, CSS, JavaScript, Data Structures and Algorithms, Front end tools such as React, Redux, Bootstrap, Sass.

Backend Development is taught using NodeJS and Express and MongoDB for Database technology. So at the end of this you can call yourself an Junior Developer in MERN (Mongo, Express, React and NodeJS) Stack.

The best part what I like about freeCodeCamp is that there are detailed modules focused on improving the quality of code such as Information & Security, Quality Assurance and Testing and Project Oriented learning.

Ultimately if you spend an year on freeCodeCamp and put what you have learnt to practice, you’ll definitely be a better web developer.

The Odin Project

The Odin Project is one of the top resource since 2013. It was founded by Erik Trautman during his time as an instructor for a web development bootcamp. Main aim of the project was to provide structured learning resources or a path for beginners and learners. Before this, they were lots of resources all over the internet, but no sane way to go through all of them in a structured path.

Today The Odin Project is maintained by volunteers and backed by supporters and sponsors. The best part about The Odin Project is that it provides you a spartan way to learn web development. This means that you have to set up your own development environment, download and install stuff, tinker with command line look around for help. This is as real world as it gets with very less hand holding. Ultimately The Odin Project makes you a better developer who is self reliant.

The curriculum at The Odin Project has 3 tracks or paths

  • Full Stack JavaScript
  • Front End Only
  • Full Stack Ruby on Rails

The tracks start from web development basics (or 101 topics) and also gives you taste of real world stuff such as Text Editors, Command Line, Git. Core topics covered in the tracks are HTML, CSS, JavaScript, Ruby, Front End Frameworks, Backend with NodeJS or Ruby on Rails.

The Odin Project is one among only few free online bootcamps to teach Ruby and Ruby on Rails.

There are plethora of hands on project challenges such as Rock Paper Scissors, Etch-a-sketch, Calculator, Tic Tac Toe, Restaurant Page, ToDo List, Weather App, Battleship, Photo Tagging App, Message Board, Inventory App and finally a Social Network clone.

The Odin Project offers some insights on how to get hired.

As an interesting fact, there are few students who work on freeCodeCamp and The Odin Project side by side. They use FCC for learning theoretical concepts and TOP for practical projects.

App Academy Open

App Academy Open is a free full stack web development curriculum offered by App Academy, a top coding bootcamp in US. Apart from free track, they also offer Mentorship, live lectures, pair programming, career services which are paid premium services.

I’m gonna discuss here only about the free curriculum.

App Academy Open curriculum consists of Video Lectures + In-Browser Coding. They cover through a vast list of topics which may take over a year to complete.

  • Welcome To Coding
  • Intro to Programming
  • Full Stack Online – Intro to Programming
  • Software Engineering Foundations
  • Ruby
  • SQL
  • Rails
  • JavaScript
  • React
  • Full Stack Project
  • MERN Stack Curriculum
  • Full Stack Online – Job Search
  • Docker Curriculum
  • GraphQL Curriculum
  • Data Structures and Algorithms

Each topics are quite voluminous on their own and there are lots of projects to be completed at the end with detailed guidelines. This program will definitely help you get job ready and your projects will impress a lot of people.

Full Stack Open

Full Stack Open is a recent online web development bootcamp collaboration by Houston, a Finnish software company and The University of Helsinki (of Java Mooc.fi fame).

Full Stack Open is aimed for advanced web development learners with a focus on topics such as React, Redux, Node.js, MongoDB and GraphQL. It assumes you have a familiarity with HTML, CSS and Javascript.

The objective is to build single page applications with React that consumes API’s build with Node.

The course is divided into 9 parts on following topics

  1. Fundamentals of Web apps
  2. Introduction to React
  3. Communicating with Server
  4. NodeJS + Express
  5. Testing Express Servers
  6. Testing React Apps + Custom Hooks
  7. State Management with Redux
  8. React Routeer + Styling with CSS + Webpack
  9. GraphQL

Full Stack Open is a very professional course which is frequently updated and aims to make course learners job ready by the end of the course. This online bootcamp needs to be your priority when you have mastered the basics of web development.

CS50’s Web Programming

CS50 by legendary David J. Malan of Harvard University is a brand by itself which revolutionized the way Computer Science fundamentals are taught in the classrooms across the world.

CS50’s Web Programming with Python and JavaScript is web development focused curriculum by the makers of CS50 which can be considered as a sequel to the original course.

CS50’s Web Programming with Python and JavaScript deep dives into following topics

  • Git
  • HTML, CSS
  • Flask
  • SQL
  • ORMs, APIs
  • JavaScript
  • Front Ends
  • Django
  • Testing, CI/CD
  • GitHub, Travis CI
  • Scalability
  • Security

Each topic is an hour long video lecture which are followed by project with detailed guidelines. The final project is to build a web application of your choice with Python, JavaScript and SQL.

Just like CS50, this course is also very popular with web development learners. At the end of the course, you will have solid fundamentals and you can gain a fresh perspective on web development.

If you are a newbie starting to learn web development, I highly recommend you make the best use of any or all of the above Free Online Fullstack Web Development Bootcamps. Each bootcamp is unique on its own, just experiment and find out which appeals more to you. The most important part is to build a solid portfolio for yourself and develop your skills to be job ready.

That’s it for this post. Follow my blog for more resources on web development in days to come.

Happy 2020, Happy coding !

PS: If I have helped you and made a difference in your life, considering supporting my blog.