Skip to content
Home Blog Web Development 3 Ways to keep your code clean

3 Ways to keep your code clean

  • Web Development
Blueprint Digital
Blueprint Digital

There are always people who don’t care if their code is clean, for them what really matters is the code to work. But why you should bother to have or to clean your code? As a web developer at Blueprint I try to keep my code clean and simple because messy code is waste of time. There will be web developers who will go after you to add content or pages and they can’t find the proper CSS (Cascading Style Sheets) code because someone have written a messy code.

Having Proper Indentation

Indentation has no effect of how the page is rendered but has a huge effect on how web developers read the code. Usually coders indent by one tab or 2 3 spaces when they are starting a new element that is child element of the tag above.

There are no indentation rules, every developer create their own rules. If you create your own rules or you do how your teacher show you, try to be consistent in every code that you write.

Stop creating Class for HTML tags that already exist

My first days as a web designer I use to create a class for everything. But why I should create new code for something that is already there and waiting to be used? Most of new designers don’t know, or for them is much easier. If you have this habit try to get rid of it.

 Bad code
.second-header {
color:#330099;
}
Good code

#content h2 {
color:#330099;
}

Organize you’re CSS

When creating a new CSS page for a website try to order it. If is possible try to keep the code in a logic order. Try to write the code in the order of the web page. For example keep the header rules first, than the body and the last one should be the footer. You could also comment when the body rules start or end, when the navigation rules start and ends. This way, when you go back later to change some rules you will know that the footer rules will be the last ones in the CSS page.

Ready to Dominate Online and Grow Your Business?

Schedule time to connect with Blueprint about your online goals, or request a free review of marketing campaigns.

Related Posts

What Makes a Great Website Design for Healthcare Providers?

What Makes a Great Website Design for Healthcare Providers?

A visitor forms a first judgment about a website in about 50 milliseconds. For a healthcare practice, that split second carries more weight than it does almost anywhere else, because the people arriving are rarely in a casual mood. Most have already met the practice online before they ever meet the provider, comparing options and[...]
What Your Website Communicates Before Anyone Reads A Word

What Your Website Communicates Before Anyone Reads A Word

Before a visitor reads your headline, clicks your navigation, or scrolls to your services, your website has already made an impression. It has hinted at whether your business feels established or improvised, whether your brand is clear or scattered, and whether you're worth a few more seconds or a quick trip back to the search[...]
Is Lead Generation Worth It for B2B Companies?

Is Lead Generation Worth It for B2B Companies?

Qualified leads are the foundation of B2B revenue, but the cost to generate them keeps climbing. Search competition is stiffer, buyer attention is shorter, and more companies are chasing the same decision-makers. When marketing spend rises and pipeline stays unpredictable, the question of whether lead generation is worth it becomes harder to ignore. For companies[...]
Previous
Next

Partner with BLUEPRINT to reach your online goals, grow your business and reshape your story.

Get in touch with BLUEPRINT

Reach out to request a discovery call, a free campaign review, or for all other inquiries.

Subscribe to our newsletter