/    Sign up×
Community /Pin to ProfileBookmark

HTML Header

Hello All,

I am just about finished my first proper website, however I developed the website pages initially using notepad before I found Visual Web Developer and so have no html headers at present on the website pages. I attempted to add one from a new page in Visual Web Developer but it simply upset my web pages by removing the horizontal drop down menu I created and replaces it with a vertical bullet style menu, also the wrapper seems to be removed and the pages are no longer centered and sit on the left of screen.

This is the html header I attempted to add to all pages;

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd“>
<html xmlns=”http://www.w3.org/1999/xhtml” >

After what I described above occurred I simply swapped it again for a basic <html> tag.

Could someone please advise me of a quick fix and point me in the direction of some guidance on HTML headers?

Thanks in advance

Alano

to post a comment
HTML

9 Comments(s)

Copy linkTweet thisAlerts:
@donatelloJun 09.2011 — Generate one. Tutorials on the page.



Head Generator




Try what works, but if you hand coded your page, you may have a number of errors. Also, you are setting it to xhtml while the way you put your <html> tag is plain html... there is a difference... perhaps this could be generating an error...

You can also try validating your code... there is a validator at w3c.org
Copy linkTweet thisAlerts:
@Major_PayneJun 10.2011 — Validate first and correct CSS/HTML for the document type you need to use. Recommend XHTML 1.0 Strict.

Why Validate?: http://validator.w3.org/docs/why.html

CSS Validator: http://jigsaw.w3.org/css-validator/

HTML Validator: http://validator.w3.org/#validate_by_uri+with_options

But It Doesn't Validate: http://net.tutsplus.com/articles/general/but-it-doesnt-validate/

Centering any content element requires setting a width less than 100&#37; for the container. Example:

[CODE]body {
width: 90%;
height: 600px; /* optional */
margin: 0 auto;
background: #fff url(path to non-tiled image) no-repeat center scroll;
}[/CODE]


Example as a Class:

[CODE].selector_name {
width: 90%;
height: 600px; /* optional */
margin: 0 auto;
background: #fff url(path to non-tiled image) no-repeat center scroll;
}[/CODE]


HTML for Class: [CODE]<div class="selector_name">Content here</div>[/CODE]

Example as an ID:

[CODE]#selector_name {
width: 90%;
height: 600px; /* optional */
margin: 0 auto;
background: #fff url(path to non-tiled image) no-repeat center scroll;
}[/CODE]


HTML for Class: [CODE]<div id="selector_name">Content here</div>[/CODE]
Copy linkTweet thisAlerts:
@Jenie9312Jun 13.2011 — The HTML header contains several notable items which include:

doctype - This gives a description of the type of HTML document this is.

meta name="description" - This gives a description of the page for search engines.

meta name="keywords" - This line sets keywords which search engines may use to find your page.

title - Defines the name of your document for your browser.

The header in our example document:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<meta name="GENERATOR" content="Arachnophilia 3.9">

<meta name="description" content="Comprehensive Documentation and

information about HTML.">

<meta name="keywords" content="HTML, tags, commands">

<title>The CTDP HTML Guide</title>

<link href="style.css" rel="stylesheet" type="text/css">

</head>


thanks,
Copy linkTweet thisAlerts:
@CharlesJun 13.2011 — First you need to determine if you're using HTML or XHTML. Unless you really know what you are doing and need XHTML you should should be using HTML. And you really have no excuse to be using a transitional DTD. HTML doesn't have a namespace and doesn't require HTML, HEAD or BODY tags. It does, however, require the DOCTYPE, TITLE and encoding. So all you really need is:&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd"&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=[i]iso-8859-1[/i]"&gt;
&lt;title&gt;[i]Some Title[/i]&lt;/title&gt;
Copy linkTweet thisAlerts:
@donatelloJun 16.2011 — Bookmark!

?
Copy linkTweet thisAlerts:
@AlanoauthorJun 21.2011 — Thanks for your response.

How can I tell if my web site creation so far is HTML or XHTML?

Thanks for everyones assistance so far. I am enjoying learning about web development. I come from a Windows application and database background and I am keen to get further into Web development
Copy linkTweet thisAlerts:
@AlanoauthorJun 21.2011 — Charles, I notice you have a sub name of "Javascript banned" why do you state this? I have one or two pieces of Javascript code that seem to cause a scrip security warning in my web browser when I open the web site. Any advice please?

Thank you
Copy linkTweet thisAlerts:
@tracknutJun 21.2011 — Thanks for your response.

How can I tell if my web site creation so far is HTML or XHTML?
[/QUOTE]


That's a little like writing a paper, then asking "how can I tell if I wrote it in French or German?" ?

You'd need to show us the code, if you don't recognize the difference between the two.

Dave
Copy linkTweet thisAlerts:
@AlanoauthorJun 23.2011 — Hello All,

I did a validator check on the w3c website and requested also to show possible cleaned code. This generated a header for me in the form of;

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

The rest of my code had a few small errors that were corrected but no major faults so far, although my web site is not that complicated a one.

I will endevour to learn about the headers from here on. Thank you to everyone for thier assistance.

Regards

Alano
×

Success!

Help @Alano spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...