Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Copyright Symbol in CSS :after Pseudo-Element

SOLVED - used \00a9 instead of ©

Pretty self-explanatory:

body:after {     content: "© me";     /* other formatting */ } 

In HTML, the © sequence inserts a copyright character. Can this be done in CSS Pseudo-Elements like I'm trying to do here?

like image 546
Justin Mrkva Avatar asked Oct 14 '11 16:10

Justin Mrkva


People also ask

What is :: after and :: before CSS?

Definition and UsageThe ::before selector inserts something before the content of each selected element(s). Use the content property to specify the content to insert. Use the ::after selector to insert something after the content.

What is :: after in CSS?

::after (:after) In CSS, ::after creates a pseudo-element that is the last child of the selected element. It is often used to add cosmetic content to an element with the content property. It is inline by default.

When would you use the :: before or :: after pseudo-element in your CSS?

Special welcome offer: get $100 of free credit. CSS ::before and ::after pseudo-elements allow you to insert “content” before and after any non-replaced element (e.g. they work on a <div> but not an <input> ). This effectively allows you to show something on a web page that might not be present in the HTML content.

What symbol do you need after the value in CSS?

The ::after selector inserts something after the content of each selected element(s).


1 Answers

CSS doesn't use HTML's entities; it uses its own unicode escape sequences.

You need to use \00a9 for the copyright symbol.

body:after {   content:"\00a9 me"; } 

See here for a cheat-sheet table which shows just about every entity/unicode string you'd ever need: http://www.evotech.net/blog/2007/04/named-html-entities-in-numeric-order/

like image 50
Spudley Avatar answered Oct 02 '22 01:10

Spudley