The issue here is that in your CSS file, with .row.rectangle you are saying that any element that contains the .row class, and then the .rectanglebox class, or any element with the row class that has a child element with the .rectanglebox class will have these styles applied to it.

You can either change your code to class="row rectangleclass" or just change your CSS to simply .rectangleclass { ... }

Answer from Alex Peña on Stack Overflow
🌐
Study.com
study.com › courses › computer science courses › introduction to html & css
External Style Sheets in CSS: Definition & Examples - Lesson | Study.com
September 22, 2020 - Appearing here is an external style sheet file called ''mystyles.css'' containing all the styles needed for our HTML: ... There are many benefits to using external style sheets. For example:
🌐
Quackit
quackit.com › css › external_style_sheets.cfm
External Style Sheets
You then link to the external style sheet from all your HTML pages. This means you only need to set the styles for each element once. If you want to update the style of your website, you only need to do it in one place. Type CSS code into a plain text file, and save with a .css extension (for example, styles.css).
🌐
W3Schools
w3schools.com › css › css_howto.asp
How to add CSS
CSS Reference CSS Selectors CSS Combinators CSS Pseudo-classes CSS Pseudo-elements CSS At-rules CSS Functions CSS Reference Aural CSS Web Safe Fonts CSS Animatable CSS Units CSS PX-EM Converter CSS Colors CSS Color Values CSS Default Values CSS Browser Support ... When a browser reads a style sheet, it will format the HTML document according to the information in the style sheet. ... With an external ...
🌐
Javatpoint
javatpoint.com › external-css
External CSS - javatpoint
Example: <!DOCTYPE html> <html> <head> <style> body { background-color: linen; } h1 { color: red; margin-left:... ... CSS selectors are used to select the content you want to style. Selectors are the part of CSS rule set. CSS selectors select HTML elements according ...
🌐
Hostinger
hostinger.com › home › tutorials › what is a css class? a complete guide to using the css selector
What is a CSS class? A complete guide to using the CSS selector
November 6, 2025 - For the rest of this tutorial, we’ll assume you are using an external style.css file. In your style.css file, define a class by typing a period (.) followed by a name of your choice. This name is the selector.
🌐
W3Schools
w3schools.com › css › css_external.asp
CSS External Stylesheet
CSS Templates CSS Examples CSS Editor CSS Snippets CSS Quiz CSS Exercises CSS Code Challenges CSS Website CSS Syllabus CSS Study Plan CSS Interview Prep CSS Bootcamp CSS Certificate · CSS Reference CSS Selectors CSS Combinators CSS Pseudo-classes CSS Pseudo-elements CSS At-rules CSS Functions CSS Reference Aural CSS Web Safe Fonts CSS Animatable CSS Units CSS PX-EM Converter CSS Colors CSS Color Values CSS Default Values CSS Browser Support ... With an external style sheet, you can change the look of an entire website by changing just one file!
🌐
W3Schools
w3schools.com › html › html_classes.asp
HTML Classes - The Class Attribute
In the following example, the first <h2> element belongs to both the city class and also to the main class, and will get the CSS styles from both of the classes:
Find elsewhere
🌐
W3Schools
w3schools.com › html › html_css.asp
HTML Styles CSS
The CSS margin property defines a margin (space) outside the border. ... External style sheets can be referenced with a full URL or with a path relative to the current web page. This example uses a full URL to link to a style sheet:
🌐
GeeksforGeeks
geeksforgeeks.org › css › how-to-link-external-css-to-html
How to Link External CSS to HTML? - GeeksforGeeks
Example 1: In this example, we are using an external CSS style to provide styling to our div, h1, and p tags. ... <!DOCTYPE html> <html> <head> <link rel="stylesheet" href="geeks.css" /> </head> <body> <div class="main"> <h1 class="GFG"> ...
Published   October 8, 2024
🌐
Quora
quora.com › How-do-you-create-an-external-style-sheet-in-HTML-and-CSS
How to create an external style sheet in HTML and CSS - Quora
Answer (1 of 3): 1. Create the CSS File * Create a new file with the [code ].css[/code] extension (e.g., [code ]style.css[/code]). * Write your CSS rules within this file. Example [code ]style.css[/code]: body { background-color: lightblue; font-family: sans-serif; } h1 { color: navy; t...
🌐
Hostinger
hostinger.com › home › tutorials › types of css: inline, external and internal definitions and differences explained
Types of CSS: Inline, Internal and External CSS Explained
April 23, 2025 - You can use class and ID selectors in this style sheet, like the following example: .class { property1 : value1; property2 : value2; property3 : value3; } #id { property1 : value1; property2 : value2; property3 : value3; } Since you’ll only ...
🌐
BBC
bbc.co.uk › bitesize › guides › zggs2nb › revision › 3
External style sheets - Implementation: CSS - National 5 Computing Science Revision - BBC Bitesize
March 13, 2023 - The actual style sheet file will contain CSS rules that are then applied across the entire page. For example: ... In this case, the background color of the webpage will be ghostwhite and any h1 headings will appear in verdana font, as size twenty blue text in italic style. External style sheets have the following advantages over internal and inline styles: one change to the style sheet will change all linked pages · you can create classes ...
🌐
W3Schools
w3schools.com › cssref › sel_class.php
CSS .class Selector
More "Try it Yourself" examples below. The CSS .class selector selects elements with a specific class attribute value.
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › CSS › Class_selectors
Class selectors - CSS | MDN
HTML class attributes which are not valid CSS identifiers must be escaped before they can be used in class selectors. ... <p class="red">This paragraph has red text.</p> <p class="red yellow-bg"> This paragraph has red text and a yellow background. </p> <p class="red fancy">This paragraph has ...
🌐
HubSpot
blog.hubspot.com › home › website › the beginner's guide to css classes & .class selectors
The Beginner's Guide to CSS Classes & .class Selectors
June 14, 2023 - It selects all elements with that class attribute so that unique CSS declarations can be applied to those specific elements without affecting other elements on the page. In our example, we’ll create declaration blocks for both of our CSS classes with the selectors .orange-text and .blue-text:
🌐
DigitalOcean
digitalocean.com › community › tutorials › how-to-create-classes-with-css
How To Create Classes With CSS | DigitalOcean
October 13, 2020 - But you have also specified the red-text class by adding the highlighted class attribute class="red-text" inside the opening HTML tag. Save your index.html file and load it in the browser. (For instructions on loading an HTML file, please visit our tutorial step How To View An Offline HTML File In Your Browser). ... Let’s add an additional CSS class to explore styling different pieces of <p> text content with different classes.
🌐
Simplilearn
simplilearn.com › home › resources › software development › how to link external css in html
How To Link External CSS in HTML | Simplilearn
December 2, 2025 - External CSS (file) is a form of CSS which is used to add styling to multiple HTML pages at a time. It helps to design the layout of many HTML web pages simultaneously. Read more!
Address   5851 Legacy Circle, 6th Floor, Plano, TX 75024 United States
🌐
SheCodes
shecodes.io › athena › 11404-external-and-internal-css-in-html
[HTML] - External and Internal CSS in HTML - SheCodes | SheCodes
Learn what is external and internal css in html, their advantages and how to use them on your projects.
🌐
Way2tutorial
way2tutorial.com › css › how_to_write_css_style.php
How to Write CSS In-line, Internal or External Style sheet, CSS @import Keyword
How to Write CSS In-line, Internal or External Style sheet, CSS @import Keyword. In this page you can learn how to write CSS style. You can define and implement