HTML CSS American Flag
This article describes how I created an American Flag using HTML and CSS. This demonstration confirms that detailed images can be created by only using HTML and CSS.
Creating an American Flag using CSS and HTML
The CSS code is used to set pixel widths and color for the HTML elements. There are only three tags used to create the flag, one tag for each of the three colors. The three tags are <a>, <b> and <span>. The flag is mostly correct in that it has 50 stars and 13 stripes, seven of which are in the same rows as the blue star field. The rows of stars are also correctly staggered in alternating rosw of 6 and 5 stars each. Any incorrectnes would most likely be a matter of size proportions of the starts in relation to the stripes
Click here to view the HTML CSS American Flag
Additional Tags required for Cross Browser Compatibility
In order to get both Internet Explorer and Firefox to display the flag correctly a few additional commands had to be incorporated into the flags code. A non breaking blank space ( ) was required to be inside of each of the tags in order for the flag to appear when using Firefox, Internet Explorer would display the flag without the additional character. The CSS line-height and display:inline-block commands were required to make firefox display the elements as intended. Additionally a transitional doctype tag was employed to force the American flag to display similarly in the different browsers.
This is primarily intended to be an example of what can be done with CSS - It is true that by using this technique a variety of artistic and appealing web images could be created pixel by pixel, however it is unlikely to be used since other easier methods of image creation are readily available.
Article Tags
Related Articles
No related articles were found.
More Articles By amazing
HTML Tutorial Part 1
by amazing | in Computers and Internet | 1878 Views
A beginners guide to creating a web page from scratch. Includes common tag names and usage.
HTML CSS American Flag
by amazing | in Computers and Internet | 6678 Views
This article shows how to create and American Flag usinng only HTML and CSS
Best Non-Candy Alternative Halloween Treats Kids Will Love
by amazing | in Events and Holidays | 4764 Views
If you prefer to avoid giving out Candy for Halloween check out this list of Non-Candy gifts for Halloween
Add a Comment
You must Login to enter comments.
Categories
- Arts, Crafts and Hobbies
- Automotive and Transportation
- Business and Profession
- History and Famous People
- Education
- Events and Holidays
- Family
- Fashion
- Food
- Games and Entertainment
- Health and Nutrition
- Home
- Computers and Internet
- Law and Government
- Entertainment and Media
- Money and Finance
- Travel, Places and Culture
- Plants and Animals
- Relationships
- Religion
- Science and Technology
- Sports and Recreation
- Earnwrite Help
Recent Comments
We just added a new Featured Image capability to the site. Learn how it works in our help article: How to Include Images in Your Article.
by earnwrite on 10 Sep 2016
in How to Include Images in Your Article
Nice Article, these tools make diagnosing problems with modern cars easy
by writeswell on 30 Aug 2016
in How to Use OBD Systems to Diagnose Your Car Problems
Thanks for these guidelines, I hope they help improve the quality of the content on the site.
by homeandauto on 26 Aug 2016
in Article Quality and Publication Standards
dried banannas are great too, have you tried them?
by earnwrite on 26 Aug 2016
in Using Dried Apples for Cooking, Snacks and Storage
It helps the people who don't know the exact procedure of finding an ASIN on their articles. Thanks for sharing.
by rpadmendra on 25 Jul 2014
in How to Use Amazon ASIN Values on Earnwrite
Useful and informative, thanks for sharing
by taazakhabar on 12 Aug 2012
in How an Oxygen Sensor Works in Automobiles
Thank you for these helpfull articles.
by homeandauto on 13 Jun 2012
in How to Use Amazon ASIN Values on Earnwrite
Thank you for sharing this information. I'm fairly new to IM and I'm always looking for new ways to maximize my article income.
by kellyk on 28 Jun 2011
in Making the Internet Work For You, Earning income with Bukisa.com
Thanks for the easy to understand tips.Mohit - http://www.abstract-thoughts.com
by Mohit on 21 May 2011
in How to Use Earnwrite to Make Money Online
See my articles on "How to Get a Google Adsense Publisher ID" and "How To Add a Earnwrite Channel to Adsense" for more information and resources on using Channels to see your Earnwrite.com earnings in Adsense.
by earnwrite on 31 Dec 2010
in FAQ