Advantages and disadvantages of CSS writing styles
When writing CSS, there are 3 styles of scripting; inline, internal and external. These scripting styles have advantages and disadvantages, which can be used in a specific scenario.
Inline
Inline scripting, allow is a form allow a web developers, to change the presentation of a specific html tag, such as “<p></p>” Using inline scripting allow the web developer to change the properties of this tag.
Advantages
Using inline scripting is not recommended when creating a website with multiple web pages, but does have advantages. Firstly inline scripting, is good for testing codes. Using inline to test is very efficient as it quick and easy to implement and remove.
Disadvantage
The problem with using inline is; it’s time consuming when modifying the website, with a varity of html elements. This is because, you are unable to change all the elements at a single time, instead you have to check every individual tag, and change that manually, which can be time consuming for complicated website such as amazon, eBay.
Internal
Internal CSS also known as imbedded, is a where the code, is stored, near the top of webpage, in the “head” section, where a new tag called “style” is created.
Advantages
When making changes to a website, using internal is quick than inline, as it only requires you change few a line of codes, to affect the webpage. For example if a web developer needed to makes changes to all the “<H1></H1>” on a single webpage, they can do that very simply by change the style code for the “h1”.
Disadvantage
This disadvantage of using internal, is it’s slower that external css. When it comes to making changes internal is slow than external, this is because when making changes, a web developer has to change the code for every page, this can time consuming when modifying a website, with several pages
External
External CSS is code that is stored of an external file with the extension .css that is linked to a website.
Advantage
By using external CSS, the webpage looks cleaner, which makes viewing code friendlier for developers. Secondly when making modifications, using external CSS is the fastest, because it is used to make changes across a website, and you are only required to do it once, for the change to happen.
Disadvantage
Using external, can make changes quicker, however using external CSS, the loading of website increases, as devices have to download CSS file, as well, to view the website; if the CSS file is not downloaded, the webpage could look incorrect and unusable. Secondly with loading times increased, the can be slow especially on mobile devices, and users will be looking for other site, that can load information quicker.
No comments:
Post a Comment