Last Updated: March 5th, 2025
WHAT IT MEANS

Modern Front-end development may look easy at first, but producing clean, semantic and cross-browser-supported code is definitely a hard job. It is useful to maintain some best practices, which are discussed here.

Front-End Coding | Nascenia

Figure: Front-End Coding

SOME BEST PRACTICES FOR FRONT-END CODING
1. Declare a DOCTYPE

The DOCTYPE declaration should be in the first line of HTML. Actually, it activates the standard mode in all browsers. It is recommended that you use the HTML doctype:

 
2. Close your tag

Leaving some tags open is simply a bad practice. Only self-closing tags (
,


,,,, etc)are valid. Normal elements can never have self-closing tags.

3. Explain which div you are closing

If we view most of the website source at the very bottom of the page an almost endless list of closing

tags. Without proper code organization, it can be messy. Using indentation and comment for every div is a good practice.

18. Checking in cross-browser while developing

One of the biggest mistakes most beginners made when developing HTML, CSS, and JavaScript, was not to test pages on multiple browsers while developing them. Generally, we used to write all the code and just view it in Firefox to see how it was rendered.

In theory, this should be good. However cross-browser issues are a major problem for front-end developers, especially due to IE. If we test our documents on Firefox/IE/Chrome while writing it, cross-browser rendering problems will be much easier to fix.

If you want to learn more about Modern Front End technologies, visit follow Frontend development Guideline.

Categories: Web Design

More to Explore

The Quest for Knowledge Continues. Fuel Your Curiosity.