Reputation: 1031
I need to put the name of some universities on my web page. I have typed them as they were but in some browser or maybe some computers they appear differently. For example, "Universite de Moncton" should have the 2nd "e" in Universite with an accent acute over it. Could you please help about it.
Upvotes: 14
Views: 49993
Reputation: 3033
In case you need to display a special character, such as the é
in an :after
(or a :before
), you have to look it up from here, and you have to omit the first 0, like so:
div:after {
content: "\00E9";
}
<div></div>
Upvotes: 0
Reputation: 9417
There are two methods. One is by using "HTML entities." You need to enter them as, for example, é
. Here is a comprehensive reference of named entities; you can also reference the Unicode code point of a given character, using its decimal form as Ӓ
or its hex form as Ӓ
.
Perhaps more common now (ten years after this answer was originally entered) is simply using Unicode characters directly. Rất dễ dàng, phải không? This is more acceptable and universal because most pages now use UTF-8 as their character encoding.
运气!
Upvotes: 3
Reputation: 7429
I think from the mention that 'in some computers or browsers they appear differently' that the problem you have is with the page or server encoding. You must
assign the correct encoding in your webpage, done with a meta tag
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
force the server encoding with, for example, PHP's header()
function:
header('Content-Type: text/plain; charset=ISO-8859-1');
Or, yes, as everyone has pointed out, use the html entities for those characters, which is always safe, but might make a mess when you try to find-replace in code.
Upvotes: 4
Reputation: 63606
You can use UTF-8 HTML Entities:
è è
é é
ê ê
ë ë
Here's a handy search page for the UTF-8 Character Map
Upvotes: 5
Reputation: 655489
If you’re using a character set that contains that character, you can use an appropriate character encoding and use it literally:
Université de Moncton
Don’t forget to specify the character set/encoding properly.
If not, you can use an HTML character reference, either a numeric character reference that denotes the code point of the character in the Universal Character Set (UCS):
Université de Moncton
Université de Moncton
Or using an entity reference:
Université de Moncton
But this entity is just a named representation of the numeric character reference (see the list of entity references that are defined in HTML 4):
<!ENTITY eacute CDATA "é" -- latin small letter e with acute,
U+00E9 ISOlat1 -->
Upvotes: 28
Reputation: 26730
By typing it in to your HTML code. é
<--You can copy and paste this one if you want.
Microsoft windows has a character map for accessing characters not on your keyboard, it's called Character map
.
Upvotes: 2
Reputation: 2193
http://www.starr.net/is/type/htmlcodes.html
This site shows you the HTML markup for all of those characters that you will need :)
Upvotes: 0