From the course: CSS Essential Training

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

Referencing CSS

Referencing CSS

- [Instructor] Before we get into writing CSS, let's discuss three ways to add CSS to the HTML: inline, internal, and external. The inline method uses a style attribute added to the opening HTML tag. The CSS style rules are added as the value of the attribute. Since the styles are applied directly to each element, they are not reusable. Each style declaration must be added to each element, even if it's the same style. Also, multiple styles must be added to the same style attribute which can make it difficult to read and manage. Inline styles will override other CSS style rules added by other methods, potentially leading to conflicts. They should be used sparingly if at all since this method is not flexible and can be difficult to maintain. With the internal method, the CSS is added to the head section of the HTML document. All the CSS style rules are enclosed between style tags. CSS selectors can then be used to apply…

Contents