Jump to content

Validator Says Use />


waynemac

Recommended Posts

Just did an html check using validator.v3.org and it said to change my ">" to" />". I have also noticed use of "(space)/>". Whats te difference between the two "/>"`s?

 

Wayne :)

Link to comment
Share on other sites

If you are using HTML you end your tags with ">". If you are getting into XHTML all tags must be closed. That presents a problem for tags that have no ending tags like

,


or so with those tags you end them with " />"

 

 

becomes

 


becomes

becomes

 

Check out this page: http://www.w3schools.com/xhtml/xhtml_syntax.asp

Edited by TCH-Bruce
Link to comment
Share on other sites

Thanx Bruce.

 

Oh the things we learn about too late.

 

Im running phpbb in phpwebsite which is xhtml. However I seem to have been writing just html. I use <br> and not <br />. So what ur telling me (well u havent said it yet but would have) is that I will have to go thru all my templates and change all the one off tage like <br> <img src> etc to <br /> <img src... />? Just a whisper of a yes will do.

 

Also, when I write html for my boxes etc I will have to change them to xhtml...thought so.

 

Thanx Bruce.

 

Wayne :Nerd:

Link to comment
Share on other sites

Thanx Bruce and everyone.

 

I was playing with Validator again today...and was looking at closing <a href> tags in xhtml.

 

Is it correct to assume that a </a> is not needed?

 

I removed a </a> and had 1 less error.

 

If it isnt needed, which tags dont need closing?

 

Wayne

Link to comment
Share on other sites

The anchor tag ( <a> ) needs it's closing partner because it is a tag that surrounds something. If you tell the browser "there's a link that starts here" (that is, you place a <a href="link"> tag somewhere) but then you don't tell it where the link ends, how will the browser know? :)

 

Tags that don't need their closing counterparts are the <img /> tag, the <br /> and.... well, I don't remember any other that I use frequently. Check w3schools.com's XHTML tag list :)

 

Just as a note: ALL tags need to be closed. Most of them need to have the opening tag and the closing tag but there are some that can be opened and closed in just one tag, like the ones I mentioned.

Edited by TCH-Raul
Link to comment
Share on other sites

Thanx guys.

 

As for my Japanese mobilefone website...would I have to go so far as running xhtml etc? I guess its recommended but...

 

I currently have it written in pure outta my head html with and it shows up perfectly in my pc browser and on my mobilefone.

 

I want to keep the html as light as possible due to the thruput of the mobile system.

 

Your thoughts pls.

 

Thanx, Wayne

 

PS I see that Yahoo.com doesnt seem to run a DOC statement. Why?

Link to comment
Share on other sites

  • 4 weeks later...

I thought I was making some progress in figuring out how to use HTML to create a web site, but after reading this thread I'm pretty confused.

So what you're saying, HTML uses different codes then xHTML? If I use the wrong code and don't have a program that tells me I'm using the wrong code, what happens?

Something I was following showed a line break as <br /> so this is what I was using when I wanted my sentence to drop down a line but I spent all evening last night, practicing HTML by following some instructions on the web and I noticed they used <br> for dropping down a line. I had been using <br /> and had no problems with my sentence dropping down a line but when I saw this other tag, I switched and everything still looked the same when I opened the html web page.

Can you use both HTML and xHTML on the same page?

 

And during my HTML practice last night, it was suggested I use CSS to tell the page what color I wanted my fonts. I've never worked with CSS so I bought another book today called Sams Teach Yourself CSS in 24 hours. I'm still on hour 1 which basically explains what CSS is and it sounds as though this can be used with HTML and xHTML or is it HTML and "or" xHTML?

 

I haven't done much with my website since I'm still pretty ignorant when it comes to using HTML. I thought about trying to figure out Frontpage but in doing a search for more information about Frontpage, it sounds as though many people don't care for this program. I know my son who's pretty good with HTML doesn't like it.

Sheryl

Link to comment
Share on other sites

HTML is HyperText Markup Language, xHTML is eXtensible HyperText Markup Language and CSS is Cascading Style Sheets.

 

You can use CSS with HTML and xHTML. It is a document the provides how the HTML and xHTML tags are supposed to appear when being displayed.

 

If you do not have a document type definition (DTD) specified in your pages then it will be treated as regular HTML.

 

There is a really good site where you can find out the differences between the HTML, xHTML, XML and other document types. Check out http://www.w3schools.com

Link to comment
Share on other sites

Sheryl,

that sams book is a very good one,

they also have one for html,

that was my first html book

and it made a big difference seeing it put together on paper for me.

 

The DOCTYPE is the first line in the html or xhtml code.

It tells the browser how to display the page.

there are two types used the most

html4 and xhtml

both have variations like

Loose, Transitional and Strict.

 

You can find out more at w3schools.

 

I think you should stick with the strict coding like <br />

as this is the way of the future and will help to make your pages look the same in most browsers.

 

Do you have an html editor?

if so most will help you select the DOCTYPE when you create a new web page.

Link to comment
Share on other sites

Thanks for the help. Is Front Page an HTML Editor because I own that program but have never used it or know how to use it.

I've been using notepad to type out the HTML codes.

I went to that schools site and learn a little more about all this.

I've been working with my CSS book all evening and think I'm understanding things a little better. I've been trying to practice writing CSS by following the examples in my book but for some reason, when I try and apply what I've learned to my own web page, it doesn't seem to work. I'm having the hardest time trying to set a color for my links.

 

Now as to that Doctype, can I just copy one from my book or a website? This isn't something that has to be assigned to me is it?

If I'm using both xHTML and Css, do I need a document that says both?

I noticed at that Schools site a document description for strict xHTML.

!DOCTYPE html PUBLIC

"-//W3C//DTD XHTML 1.0 Strict//EN"

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"

Can I just put this at the top of my xHTML file?

Sheryl

Link to comment
Share on other sites

You may want to get an html text editor

it will let you edit and create pages easier.

I use the one from www.notetab.com

I just selected new page and selected xhtml 1.0 strict and got this

 

><!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">
<head>
 <title></title>
 <link rev="made" href="mailto:" />
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
 <meta name="generator" content="NoteTab Pro 4.95" />
 <meta name="author" content="" />
 <meta name="description" content="" />
 <meta name="keywords" content="" />
</head>

<body bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">

<h1></h1>

<p>... Type content here!</p>

<hr />
<p><small>Created on ... December 08, 2004</small></p>
</body>
</html>

 

 

you can use that as a blank template.

Link to comment
Share on other sites

Thanks for that template Don and thanks for the suggestion about using Note tab. I've heard people speak of it and silly me thought everyone was talking about notepad.

I've downloaded the free version so I'll try working with it. I wish I didn't have to run off to work this morning since I'm anxious to play around with this.

 

One question though. In my HTML studies, I read that each page has to start with <html> although I don't see that at the beginning of your template. Is that because it says it in the Doctype?

Sheryl

Link to comment
Share on other sites

Almost all tags can take more information. This is so with the <html> tag - it is present in Don's template, right under the doctype (it is not part of the doctype, it is seperate; but to use the doctype declaration properly you need the modifier:

 

<html xmlns="http://www.w3.org/1999/xhtml">

 

=)

 

<head> can take stuff too, so can <body>, etc. But best not to worry about that kind of stuff right now, at the very beginning of the learning process. =)

Link to comment
Share on other sites

Thanks Lisa,

I figured it must have been part of that doctype information.

I had a short work morning so now I can play around some more.

BTW, I have Microsoft Publisher, which I've never used, but I noticed the box says it has a web site wizard. Do you know if this is something I can use to create my web site and would it be easier then using note tab?

Maybe I better open up this program and see how it works.

Sheryl

Link to comment
Share on other sites

Don't use MS Publisher! Please! I beg you! ;)

I'm serious, don't use it. Don't even think about doing such a thing. :)

MS Publisher is not a real web page editor. It's a Desktop Publishing Tool and it's good for making small magazines, small books and other non-professional tasks. It has no web page editing capabilities whatsoever, so when it comes to the "web site wizard", what Publisher does is export an image of the page ("paper" page, not web page) you're working on, create a badly formatted HTML file (as it is usual with any Microsoft HTML editing tool) and put the image in it.

 

It's really very very bad. I can't believe I'm saying this but I think even Frontpage is better than Publisher to make a webpage... ;)

Edited by TCH-Raul
Link to comment
Share on other sites

LOL. You can breathe easy cause I won't be using MS Publisher. I couldn't figure out how to use it.

And I must be hopeless, I couldn't figure out how to use note tab either.

I'm one of these people who needs a step by step instruction book in front of me.

Maybe I'll have to stick with using notepad and using my HTML, XHTML, and CSS books.

If I don't use note tab, can I still use the DOCTYPE code you included Don at the beginning of my html document?

And do you know anything about 1st Page 2000? I think I may have used that program at one time when I was first trying to learn how to create a web page. This is going back about 3 years now so I don't really remember much about it, but if this was the program I used, I believe I figured out how to use it.

Sheryl

Link to comment
Share on other sites

1st Page 2000 was a very good web page editor! I used it a lot when I was still on Windows. I think they discontinued it, though but if you manage to download it again (be carefull, keep Bruce's warning in mind), give it a try.

 

Oh, and about this

Maybe I'll have to stick with using notepad and using my HTML, XHTML, and CSS books.

It's just my opinion but I think that's the best way to make a webpage.

Maybe use some sort of Visual editing tool (like Dreamweaver, or... Dreamweaver, or... well, you get the point ;)) to start the overall layout but then I think the best way is to edit the code by hand. Visual editors are simply not as good as our own eyes when it comes to writing good code ;)

Link to comment
Share on other sites

I'm feeling a little more encouraged tonight. I've been reading my books and experimenting practically all day today and I think I'm starting to get the hang of it.

Well a little anyways.

I decided I needed to start off simple. For a beginner, I think I was trying to get too fancy. I love making background tiles with my psp program and couldn't wait to use them on my new site. I figured out how to make a a double layer background using tables and then I tried to add a third table along the top of my inner background with links to other pages I wanted to create but I couldn't seem to make anything in the body of my page look centered after doing this so I got rid of all my tables and just went with a single image background for the time being.

I managed to make my CSS style sheet but I'm having a little trouble trying to get my font size figured out.

I think my brain has had it for today.

Thanks for all the help and suggestions.

Sheryl

Link to comment
Share on other sites

I started off using Front Page & from habit I still do *blush* - but with strict reservations (like removing the rubbish FP likes to put in when you're not paying attention & hand coding most of my stuff). I use Top Style Pro 3 for checking html & css & validating. Hmm....overkill I think. I have too many programs! Plus I just downloaded AnyEdit to give that a try.

 

As for the html - xhtml debate, my own site is written in xhtml but the web templates I offer are html. I just reckoned that people who use them are probably more comfortable with html ;) Same with sites I design - if clients want to do all updates themselves I stick to html :)

Link to comment
Share on other sites

And do you know anything about 1st Page 2000?

I downloaded that once and discovered the archive had a virus in it so I never did go back and try downloading again. Sort of ticked me off because it looked interesting.

Its not an actual virus in 1st page. I had that same scare when I first tried to install it They have an example script that gets reported as one by several AV programs. Why they still include it in their releases, I dont know. I just deleted the file after install and AVG quieted down. If you do a search for "Six Buttons from Hell" you'll get a lot of hits referring to the script.

 

Other than getting it installed, I haven't played with 1st Page much. The past few weeks I've been using an open source app called NotePad++ which, so far, has been a reliable little tool.

Link to comment
Share on other sites

Its not an actual virus in 1st page. I had that same scare when I first tried to install it They have an example script that gets reported as one by several AV programs. Why they still include it in their releases, I dont know. I just deleted the file after install and AVG quieted down. If you do a search for "Six Buttons from Hell" you'll get a lot of hits referring to the script.

My day job is as a software developer. I would never release an archive that contained anything that may be harmful. When I saw the message I decided they were not a company I felt comfortable dealing with.

 

If that's in there, who's to say that something else (perhaps worse) may be embedded in the code.

 

Maybe I'm paranoid, I felt safer without it on my system.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...