Internal CSS  


Internal CSS  

The most used CSS forms for renovating, styling, and altering the distinctive characteristics of a particular web page is internal CSS. By using the “style” element in the “head” section of an HTML web page, you can utilise the internal CSS.

CSS is an abbreviation for Cascading Style Sheets. It is employed to format a webpage’s design. CSS allows you to alter the cover image, background colour, display colour, photos, font sizes, text spacing, and layouts for various devices and customise web pages for various screen sizes. 

Therefore, CSS aids in describing how your web page that was created using a markup language like HTML and XML looks. It offers an easy-to-use method for changing and formatting web page content.

By adding CSS code, you can improve any aspect of the numbers and alphabets on the sites. Whatever style, or a mix of styles, you decide to use, it will spice up the letters you provide to draw the reader in or simply make the page aesthetically beautiful.

What is Internal CSS? 

The most used CSS forms for renovating, styling, and altering the distinctive characteristics of a particular web page is internal CSS. By using the “style” element in the “head” section of an HTML web page, you can utilise the internal CSS.

Internal CSS may be used to style a single web page as a whole, but not multiple web pages. Multiple web pages can be styled using the same code. 

The CSS coding for the webpage is stored in an internal stylesheet in the file’s head section. Reusing the code makes it simple to add styles like groups or ID numbers. The drawback of utilising an internal stylesheet would be that modifications only affect the page where the code is inserted.   

Other Types of CSS 

Along with Internal CSS, there exist two other styles. They are as follows:

  1. Inline CSS
  2. External CSS

Inline CSS

To style a particular HTML element, use inline CSS. Selectors are unnecessary for this CSS style; you simply need to add the style property to each HTML tag.

In some circumstances, HTML’s inline CSS feature can be helpful. For instance, if you need to add styles to just one element and you don’t have permission to access CSS files.

A CSS rule can be rapidly and simply added to an HTML webpage. This method is handy for performing rapid fixes to your website as well as evaluating or previewing the changes.

External CSS

In the case of external CSS, you can use any text editor on your device to create an external.css file that you can link to from your web pages.

A huge website can be styled more effectively using this CSS type. Your entire site can be changed at once by making changes to a single.css file.

Your HTML files will be smaller and have a better structure because the CSS code is in a separate file. The same.css file can be applied to many pages.

Advantages and Disadvantages of Internal CSS

Knowing the pros and cons of any concept will help you understand it better. Take a look at the advantages and disadvantages of internal CSS below.


  • You can include CSS in HTML texts by utilising a type of CSS known as internal CSS. A single HTML web page’s layout can be designed, and styles can be modified within the HTML code. 
  • You need not upload several files because the code will only be added to one HTML file. 
  • Developers create cascading style sheets to specify a style, and by just referring to that CSS file, they can use that style across multiple pages. As a result, styling effort is reduced, and repetition is done away with. 
  • The designer can use earlier functions that weren’t specified in the HTML that was used to create the web pages. 
  • The forms within external style sheets become overruled by internal or embedded styles. Internal CSS stands second in the priority list after Inline CSS. 


  • When we use the head section to encompass all the styles we desire, the code will have more lines. Long code will make debugging challenging. It is not advised if the task is complicated. It will take longer to load.
  • The same styling code would need to be written at the beginning of every site page if you wanted the same styling across each page. This would make the code seem cluttered and, if you were building a large site, could take quite some time. 
  • Internal CSS is only useful for HTML websites with a single page. You are unable to make a reference to this stylesheet from the link> components if your new HTML website uses internal CSS. It may make website modifications and updates more difficult and complex.    
  • The most popular technique to apply CSS is to retain the style in external CSS files since internal CSS is not ideal for large projects when more than one web page is required. 

Internal CSS in HTML 

A page’s appearance is specified by CSS, and the browser then produces the page as specified. Using CSS, you can change a page’s background and text colour, stop links from being underlined, and animate pictures, text, as well as other HTML elements, to name just a few stylistic options.

Inline CSS appears one way, and internal CSS looks another. A CSS attribute and values are still set, but now they are enclosed in brackets and specified by a CSS selector rather than being contained within a style attribute. This rule set is then contained within the <style></style> tags and is located in the HTML file’s head section.

Additionally, internal CSS is perfect for one-page websites since it divides the HTML and CSS into distinct sections while keeping them in the same document. If your website consists of multiple pages and you want to make changes to them all, you must open each HTML file for these kinds of pages and add or modify the internal CSS within every head section.


<!DOCTYPE html>
body {background-color: black;}
h1   {color: pink;}
p    {color: purple;}

<h1>This is a text heading</h1>
<p>This is a text paragraph.</p>

Wrapping Up 

A website should load more quickly to operate effectively. Nowadays, users typically only have to wait a few seconds for a web page to load. Therefore, it’s crucial to guarantee more speed. CSS is crucial to the success of businesses that wish to guarantee a quick and easy online experience.

You’ve probably come across a lot of beautiful, user-friendly websites. These websites all share the same uniformity in design. Developers may ensure that the style components are used consistently across multiple web pages by using CSS.

Want to know more about website build and design?

If you’re new to coding and would like to build your first web page from scratch, for free, then try our 5 Day Coding Challenge. After just one hour a day, over five days, you’ll learn the basics of both HTML and CSS. Register now through the form below.


Code Institute’s €250,000 Spring Scholarship Fund - Education for All

The world is full of opportunities, and with technologies advancing and AI becoming the keyword for work success, there really hasn’t been a time more suited to people who want and need to upskill for the future of work. However, many of us know that upskilling can be expensive. To combat this, Code Institute has […]

Coding the Future: Developer Spotlight - Emma Hewson

In October 2022, Emma Hewson joined Code Institute’s Level 5 Diploma in Web Application Development programme, which is run in association with Cardiff and Vale College and is funded via the Welsh Government’s Personal Learning Accounts (PLA) initiative. The course aims to equip learners in full-stack software development, preparing them to enter the digital workforce […]

The Basics of GraphQL: Understanding the Importance of GraphQL 

In the ever-evolving landscape of web development, GraphQL has emerged as a game-changer. This query language, developed by Facebook and later open-sourced, has revolutionised the way data is requested and delivered over APIs. In this article, we will delve into the fundamental concepts of GraphQL and explore why it has become a pivotal tool in […]