CSS Enhancing Design with CSS Styling Boxes Adding Content Using CSS

Jonathan Diaz
seal-mask
.a{fill-rule:evenodd;}techdegree
Jonathan Diaz
Front End Web Development Techdegree Student 2,075 Points

Why add the symbol entities to CSS and not HTML? I found that you can add the symbol entities to HTML.

I did some research and found that you can add symbol entities to HTMl. Please see the link below for reference:

https://www.w3schools.com/html/html_symbols.asp

1 Answer

Anwar Montasir
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Anwar Montasir
Treehouse Teacher

Hi Jonathan, that's correct. You can use symbol entities in HTML, and often you will actually want to.

For example, based on the example in the link you posted, you might be telling the user that an item for sale costs 6 Euro.

<p>Your cost is &euro;6</p>

And that should print the Euro symbol in the browser. In that case including the symbol entity in your HTML makes sense, since the Euro symbol is part of the page content. You're communicating to the user that the cost is €6.

However, if the symbol is purely decorative, you have the option of including it in your CSS, as I've done here. In my sample the down arrow doesn't really add anything to the meaning of the page, it's just a visual decoration to draw attention downward.