Website Code Tricks

3 simple website code tricks to help you fix common problems

If you’re new to digital marketing and feel a little overwhelmed by it all, one of the last things you probably want to hear is that you should also learn how to code.
For the uninitiated, ‘coding’ in this context is essentially writing the back-end data that powers a website – every image, every fragment of text, every part of your page is actually represented by lines of data which web browsers are able to read and translate into the pages you see.

While it may sound far too technical – and for the more in-depth, detailed changes, it is – there are some major advantages to getting your head around the basics of website coding, just to be able to work out why your formatting looks all wrong or why you can’t embed something to suit the way you want it to look.

Here are some basic coding tips which may help.

1. <P> is for paragraph

This is probably the simplest, most common code you’re going to find on most websites, especially if you’re trying to fix your blog.

<p> is code for ‘paragraph’. You write <p> in your HTML editor then you write the text you want, then you close it off with </p>. Simple.
green computer with html code on the screen
Most website back-end systems have a HTML display option in the text editor which enables you to switch from the plain text mode to the back-end code – here is where you can see why things are being displayed the way they are.
Most website back-end systems have a HTML display option in the text editor which enables you to switch from the plain text mode to the back-end code – here is where you can see why things are being displayed the way they are.

<p> comes in handy particularly when you’re trying to cut and paste text from another source – you’ll often see the text has been transferred across with weird formatting or fonts and you want to fix it. If you can’t find a solution in your normal editing option, switch to HTML, change the opening code for each paragraph to <p> (and make sure you close it with </p>) and it’ll be fixed.

It doesn’t solve all coding errors, but it’s definitely handy to know.

2. Centre it up

Another common annoyance is trying to get embedded images, videos or social media posts to display in the centre of the screen. Sometimes you can use the centre orientation option in your text editor, sometimes you can choose to centre it as a display option – but if neither of those options work, go to the HTML code and enter this at the start of the relevant section:

<div align=center>

It’s important to note the American spelling of ‘center’ here. You then go to the end of the relevant code for content you want displayed in the middle and close off the section with </div> and there you have it. Easily fixed.

The <div> tag assigns a division of the code, enabling you to block together a segment within the <div> and </div> codes.

3. Spaced out

Paragraphs looking weird? Not formatting how you’d like?

Most times, if you use the <p> parameter and include spaces in between you can solve your spacing woes – but here’s another one. If you enter <p> &nbsp; </p> between the test you want to break up, it’ll insert a line between the text.

‘nbsp’ stands for non-breaking space, which represents an empty space where no line break occurs, essentially dividing your text. Like a paragraph. In most HTML editors, you can either enter this, or you can leave an actual space between closed-off paragraphs or divisions.

There’s obviously a lot more to coding than a couple of basic tricks, but knowing just a few elements can go a long way. Once you have an understanding of the basics, and what they mean in code language, you can start to get a better understanding of other code elements and consider how each section relates.

If you find another bit of code you’re not sure about and you need help, you can always Google the opening parameter to get an idea of why it exists and what it’s doing.

The more complex jobs will always require expert assistance – it’s hard to understand the depth of code without proper training – but these small bits of knowledge can help you sort out little issues in a pinch. 
contact icon

Need help choosing the right marketing solution for your business?

Give us a call on 1800 006 910 to chat with one of our experts, or request a call back.
Related Products
Managed Service

Search Engine Optimisation

Local Starter
from $500 monthly*
We'll drive traffic to your website and deliver hot leads

✔  5 x locally optimised keywords a month

✔  Get started with Google My Business

✔  Talk to our experts for advice
VIEW DETAILS
*All prices GST inclusive. Click on View Details to view key terms.
Share by: