<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="ar">
<body>
<p>بيـــان أعـــرف عميــــــلك</p>
</body>
</html>
I am getting this as my result : بيـــان أعـــر٠عميــــــلك
Can anyone help me?
Strangely, I can't repeat your results in my browser. Where do you get your results?
However, I think what Xufox suggests is a good practice, to set charset as utf-8 in you meta tag in header.
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="ar">
<head>
<meta charset="utf-8"/>
</head>
<body>
<p>بيـــان أعـــرف عميــــــلك</p>
</body>
</html>
Related
I'm just learning HTML and trying to figure out whether the tag after the doctype line in the code below should be html or href. I know that href should be used when referring to url's but also that because there is a closing bracket for </html>, therefore there should also be an opening <html>. Thanks.
<!DOCTYPE html>
< **html/href** xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>The Title</title>
</head>
<body>
.
.
</body>
</html>
Use it as shown below -
<html>
<head>
<title>MyWorl</title>
</head>
<body>
<a href="http://www.w3.org/1999/xhtml" >XHTML</a>
</body>
</html>
I'm trying to include a link in my page that will link directly to google search results (as opposed to linking to a predetermined search, as in this question).
I tried this:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
</head>
<body>
click me
</body>
</html>
The ampersand gets mangled, the url comes out as http://www.google.com%26q%3Dsports instead of http://www.google.com&q=sports.
What's the right way to do this?
I think this is format if you want to return results in the correct manner:
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
click me
</body>
</html>
But here is the good resource and a duplicate to this question if that's the case - Do I encode ampersands in <a href...>?
Is this the basic html5 bolier code?
<!doctype html>
` //do I still need this?
my title
<body>
//my body
</body>
The following stackoverflow answer shows the minimum required valid HTML5 document.
So yes you do need a <title> </title> after your <!doctype html> as a minimum.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>The HTML5 Herald</title>
</head>
<body>
</body>
</html>
This, for me is
Yes, the title tag is necessary. This is the minimal valid html5 document you can use.
<!doctype html>
<title>I'm the shortest valid HTML5</title>
I feel really stupid, but I can't for the life of me find my title or meta tags in my source code. It just starts out
<!DOCTYPE html>
<head>
.....
</head>
<body>
...
and then continues like that. I know my title is set, because it's displaying in my tab. This link (https://help.yahoo.com/kb/yahoo-web-hosting/SLN18260.html?impressions=true) tells me the meta tags should be right under the title. So where is the title??? I just want to make sure my meta tags are printing as expected.
UPDATE:
Weird, I just found them like halfway down the page, way outside my <head>. I don't know what they're doing there, but at least I found them.
This is the procedure,
<!DOCTYPE HTML>
<html>
<head>
<title>...</title>
<meta charset="UTF-8">
<meta name="keywords" content=".." /> //if needed
<meta name="description" content=".." /> //if needed
</head>
<body>
.....
</body>
</html>
The <title></title> should be inside the <head></head> block.
Code does not automatically generate tags. Thus, to create a title and meta tag, just initiate them below the head (following convention):
<!DOCTYPE html>
<head>
<title>My Website</title>
<meta charset="UTF-8">
</head>
<body>
</body>
a proper HTML structure should be like..
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<HTML>
<HEAD>
<TITLE>My title</TITLE>
</HEAD>
<BODY>
......
</BODY>
</HTML>
HERE is the reference to get more ideas about HTML.
Like the title says, what exactly does that mean? Ive tried googling for answers but I still dont understand? so the entire document has to be in a HTML5 format right? and the syntax has to be in strict XHTML?
so is this the correct header to use in this situation? Thank you so much :)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Page Title</title>
<link rel="stylesheet" href="style.css" type="text/css" media="screen" charset="utf-8"/>
</head>
<body>
</body>
</html>
I think you are looking for polyglot HTML5. It's still HTML, but "could be served" as XML.
This is how the base structure looks like:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>title</title>
</head>
<body>
</body>
</html>
Here is another article: http://www.xmlplease.com/xhtml/xhtml5polyglot/
The normal doctype (see HTML syntax - doctype) for HTML5 is:
<!DOCTYPE html>
You can also use deprecated doctypes, but the term says pretty much everything about them.
And, no, HTML5 markup does not need to be valid XHTML, in the empirical sense that HTML5 markup might be both valid HTML and non-valid XHTML/XML.
Three meaningful considerations are:
in HTML5 <br> is allowed and <br/> is too.
a closing /> on non-void elements does not behave like it does in XML: it's ignored, you cannot have auto-closing entities.
HTML5 introduces a set of so-called semantic tags (nav, footer, article...), that are not specified in XHTML.
Regarding point 2, this is not valid:
<!DOCTYPE html>
<html>
<head><title>Dummy</title></head>
<body>
<div/>
</body>
</html>
you have to write:
<!DOCTYPE html>
<html>
<head><title>Dummy</title></head>
<body>
<div></div>
</body>
</html>
See HTML syntax - elements for more information.
check the required syntax of each element in HTML5 according to web specs
http://w3-video.com/Web_Technologies/HTML5/index.php
provides a syntax section for each element:
e.g.
http://w3-video.com/Web_Technologies/HTML5/doctype/html5_doctype_syntax.php