There are three ways to apply CSS to a webpage: Inline, Internal, and External.
The following three sections discuss how to
implement CSS in these ways, and also provide examples of each:
Inline CSS involves embedding the style rules directly in the HTML tags and is considered bad practice as it mixes the HTML code with the styling and makes it harder to read the code. The subheadings of this report are all styled using inline CSS.
Internal CSS involves using the <style> tag to format the style sheet within the <head> tag before the HTML code. This webpage has a short internal CSS section that declares the fonts to use. This webpage also uses an internal CSS section to style the webpage.
External CSS is considered best practice and it is implemented by linking an external style sheet, a .css file, in the <head> section of the HTML document. This is recommended because it allows you to make all design changes on the that file then linking that file to whatever webpages you want to use that stylesheet on. This also makes sharing or reusing stylesheets easier. This webpage uses an external CSS section to style the same webpage as the one in the previous example.