preview

Different Ways Of Implementing Css Styles Into Html

Better Essays

Dean Cartner – CSS
(P1)

There are 3 different ways of implementing CSS styles into html. These are internal, external and inline. External is when you have a file that only contains CSS code in it and is saved with .css at the end. External sheets are referenced in the HTML code using <link>. You need to link it from all HTML pages. Doing so means you only need to set the styles once. This comes in useful if you want to change the styles later on as you only have to do it in the one place. This is an example.

Internal is when you place all the CSS code in the head section of the code so between <head> and </head>. As opposed to the external css you don 't need to create a rule for each HTML element. This is an example of internal CSS code.

Inline is CSS style that is applied to only one element by using the style attributes which means you can only apply the style you want to a certain instance. These are fairly straight forward and quick to make which means you don 't have to create a seperate document or create a new element for it in the head section. This is an example.

(M1)

I am going to explain functions, advantages and disadvantages of External and Inline which are two different ways to implement CSS. There are several advantages for using external CSS including the fact that it gives you total control of the layout and structure of your page which allows you to keep the website and the content separate in your code.

Get Access