0%

Rain

0%

Fog

None

Snow

captcha

TEL: 0845 621 4321

clear

clear

London, Uk

An inline style by any other name…

Posted on August 19, 2013

Back in the good old days of the net there was a commonly used technique called ‘inline styles’. This involved the web designer adding a style attribute to the tag and putting in the values they needed. For instance:

<div style=”background:#dddddd; color:#222222;”></div>

This was quickly deemed to be an extremely cumbersome way of styling markup, and the inclusion of a CSS file and properly-labelled elements via classes and divs became the norm. Meaning the designer could take their div, assign it with an ID or class and then have it referenced in the CSS file, making it easier to make sweeping changes to the site without having to edit each individual element in the code.

Now this has fared designers well for a great number of years and only in the most extreme circumstances would any respected web designer think of using inline styles – it has to be justified. A common use of inline styles then became a common indicator that a different designer may be needed. However, it’s difficult to ignore the signs that this technique may be creeping back into play. This is one example that will have most designers cringing:

<div class=”font-family-arial  font-size-normal  float-left color-red ”></div>

While Twitter’s bootstrap uses a similar method, it’s done in a semantic way that it is only used for defining specific qualities of an element. Such as:

<button class=”btn warning”></div>

With this, the designer can change the class of warning to be any colour and style they like – with the same applying to the class of btn. The class is not defining how the element should look, as it is in the bad example (font-family-arial, color-red).

It seems that the inliners are slowly coming back into existence, shrouded in the cover of classes, and this may be something to keep an eye out for.

Steven is Engage Web’s go-to man for all things web-related, bringing his knowledge of current trends in web design and development to the team.

Twitter LinkedIn Google+ 

Posted by Steven

We have worked with:

TEL: 0845 621 4321