WeLoveCSS Logo
Home Profile Members Search Rules Help New Posts



WeLoveCSS > WEB DESIGN > HTML & XHTML > [SOLVED] Html Tidy - rules too fussy?

Reply
  Thread Tools Display Modes
Old 6th July 15, 09:22 AM   #1
desk
WLC Member
 
desk's Avatar
 
Join Date: May 2015
Location: Melbourne, Australia
Posts: 22
Default Html Tidy - rules too fussy?

A few warnings come up when I run my html through HtmlTidy, though Validator doesn't pick them up. Despite these 'errors', the site works OK as it is, but I'm checking here in case I'm missing something.

<meta charset="UTF-8"> gives the following warnings -
Warning: <meta> proprietary attribute "charset"; Warning: <meta> lacks "content" attribute
I found a parial solution -
<META http-equiv="Content-Type" content="text/html" charset="UTF-8">
The result was one warning rather than two -
Warning: <meta> proprietary attribute "charset"

<table>
Warning: <table> lacks "summary" attribute
I am guessing it wants something like width="Xpx" or "Y%". At present, my tables are probably formed by em sizes of data & paddings inside each cell.

<img src="X.jpg" width=Y height=Z alt="Name" title="Describe"> gives the following warning -
Warning: <img> escaping malformed URI reference
I can't work this one out: other images in identical formats aren't faulted.

Do I really need to change any of these? WC3 doesn't help much (it's offical jargon is a bit opaque). Or am I being too particular?
__________________
/*<--Desk-->*/

Last edited by desk; 6th July 15 at 11:36 AM.
desk is offline   Reply With Quote
Old 6th July 15, 03:57 PM   #2
meesa
WLC Mod
 
meesa's Avatar
 
Join Date: Jul 2009
Location: Milky Way Galaxy
Posts: 3,710
Default Re: Html Tidy - rules too fussy?

I would assume you're using W3's validator? What's your DOCTYPE on the page?
__________________
Praise be to the Lord God for the ability to learn, the capability to analyze, and the time to help users on this forum.
meesa is offline   Reply With Quote
Old 8th July 15, 02:49 AM   #3
desk
WLC Member
 
desk's Avatar
 
Join Date: May 2015
Location: Melbourne, Australia
Posts: 22
Default Re: Html Tidy - rules too fussy?

It's simply <!DOCTYPE html>, which I test first in WC3 Validator then in Html Tidy. The second one picks up a few things that Validator misses (empty <p> for example. Here's Tidy -

https://infohound.net/tidy/

Maybe Tidy uses some XTM standards - I don't know - though it identifies my pages as Html5. It also objects to any '&' used in a sentence, & wants all accents (&eacute; etc) changed to code numbers.
It gives links about errors, sometimes, to WC3 working documents, which are a bit cryptic. Also line numbers (which I have to guess at) to locate the errors. A 'tidied' version of the web page is generated, too.
__________________
/*<--Desk-->*/
desk is offline   Reply With Quote
Old 8th July 15, 03:18 AM   #4
Phreaddee
WLC Lover
 
Phreaddee's Avatar
 
Join Date: Oct 2010
Location: Newcastle, NSW, Australia
Posts: 768
Default Re: Html Tidy - rules too fussy?

does the page work though?
thats all that really matters

with html5
<meta charset="utf-8" /> should be completely fine

& should always be &amp;

as for the image tag...

<img src="path.to.image" alt="alttext" title="title" />

get rid of the inline css.

as for the table. I hope that is for tabulated data...
Phreaddee is offline   Reply With Quote
Old 8th July 15, 03:39 AM   #5
meesa
WLC Mod
 
meesa's Avatar
 
Join Date: Jul 2009
Location: Milky Way Galaxy
Posts: 3,710
Default Re: Html Tidy - rules too fussy?

A. Pharadee is correct: if it works, you should be fine.

B. I wouldn't worry about anything outside of the W3 if you want valid code. Tidy is probably following something other than the standard.
__________________
Praise be to the Lord God for the ability to learn, the capability to analyze, and the time to help users on this forum.
meesa is offline   Reply With Quote
Old 10th July 15, 07:34 AM   #6
desk
WLC Member
 
desk's Avatar
 
Join Date: May 2015
Location: Melbourne, Australia
Posts: 22
Default Re: Html Tidy - rules too fussy?

Thanks! Yes, the site seems to work fine (so far), but it's always nice to be reassured. One thing I picked up from your replies is the space-forward slash at the end of tags <tag />.
I haven't used any (I thought they were some post-Html5 sophistication), & my code (with <meta charset="UTF-8"> etc) slips past WC3s Nu Validator, no problems.

I suppose by inline css, that includes width & height dimensions in the image tags. A word in defence of this malpractice - I constantly refer to them while preparing the layout, to calculate ems & picas for the surrounding regions. I also suspect they provide full-size placeholders (in all but FireFox) when the page is loaded away from the image files. This is very handy, & overlaps show up quickly (specially in Chrome).

& here's another thing - notice my use of the ampersand? (It's like the computer is stealing our language, absconding with a shorthand Latin symbol in common use before printing was invented!) Still, I understand the possibility for confusion with code, so attempt to convert them to &amp; HtmlTidy is better than Validator at hunting them down.

As for tables...
But that's for another post!
__________________
/*<--Desk-->*/
desk is offline   Reply With Quote
Old 10th July 15, 07:57 AM   #7
meesa
WLC Mod
 
meesa's Avatar
 
Join Date: Jul 2009
Location: Milky Way Galaxy
Posts: 3,710
Default Re: Html Tidy - rules too fussy?

In regards to the end slash, you should always have it. At least IMO.

HTML is just a special version of XML. In XML, self-closing tags must be closed. If you ever used XHTML, it also forced all tags to be closed.

HTML is a bit more lax on this, which is why it won't complain, but it also won't complain if you never close any list items. It's very loose on that kind of thing. So, what it comes down to is clean, readable code. And to me, <tag /> looks much cleaner, and is more readable than <tag>. Plus, it follows XML standards.

For inline CSS, if it's that helpful to you during development, leave it in, but then before release everything should be moved to a stylesheet.

Yep, the ampersand has a special use in URLs and XML code. Actually, it's kinda a killer to itself. It can be used to make an ampersand via &amp; but also you might need to do something like &copy; for a copyright symbol. There's more than a few different ones that are named, plus it works to put in ASCII and UNICODE codes too.

Plenty of places on this forum alone, let alone the internet on why tables should be used for tabular data only, and not for layouts.
__________________
Praise be to the Lord God for the ability to learn, the capability to analyze, and the time to help users on this forum.
meesa is offline   Reply With Quote
Old 12th July 15, 10:35 AM   #8
desk
WLC Member
 
desk's Avatar
 
Join Date: May 2015
Location: Melbourne, Australia
Posts: 22
Default Re: Html Tidy - rules too fussy?

That's a great link for the ampersands, so thanks! I like the longhand versions better than coded ones - with &uml; you can see what you're getting, rather than the all-too-clever #246 (for example).

As for inline image sizes, I wonder if they would be disfunctional if I didn't include dimensions anywhere -i.e. does a browser need to be told the size at all? Perhaps it's time for some off-line experiments...

But that - like attention to many other details - might have to wait. After 2 months of solid slog, I've got all my pages up & need a rest.
All done with a CSS style sheet! (It's a tiny but powerful 12 KB.) In case anyone's interested, it's at -

http://www.colourmusic.info

And yes, it's got -
TABLES!!!
It's a site made originally in 1996, when tables were the only smart way to go. With CSS, I've rarely been tempted to use tables for layout, since I appreciate that the same effects can be achieved, with added refinements.

That said, one of the biggest obstacles to anyone starting on CSS for the first time, is the rabid ravings against tables one continually encounters on the internet. (And I don't mean any of you, by that.) People like me will just dig their heels in.
In fact, one of the greatest aspects of CSS is the degree of elegance it can give any table. The W3 tutorial on the subject is a delightful start!

http://www.w3.org/community/webed/wiki/Styling_tables
__________________
/*<--Desk-->*/
desk is offline   Reply With Quote
Old 12th July 15, 01:35 PM   #9
meesa
WLC Mod
 
meesa's Avatar
 
Join Date: Jul 2009
Location: Milky Way Galaxy
Posts: 3,710
Default Re: Html Tidy - rules too fussy?

If you want the image at it's full, original size, then no size is necessary. And, technically, that's the best option unless you want them to be different sizes in different contexts.

I think if you ever try to make a site completely without tables (unless you have tabular data), you'll find your life made easier in the long run.
__________________
Praise be to the Lord God for the ability to learn, the capability to analyze, and the time to help users on this forum.
meesa is offline   Reply With Quote
Old 13th July 15, 01:10 AM   #10
desk
WLC Member
 
desk's Avatar
 
Join Date: May 2015
Location: Melbourne, Australia
Posts: 22
Default Re: Html Tidy - rules too fussy?

That's a good tip - of 100-200 images, I only have one that repeats, at a reduced size. It must be relying on the inline styling at the moment, to shrink it down. A lucky escape! (It may be easiest to make up a reduced version, with a different name, just for this instance.)

A remark about images - the pixel dimensions of Photoshop & CSS seem to match on screen, for the most part. There may be discrepancies if a class has been applied, to shrink text to a certain %. It might do the same to the image...

You may be pleased to hear that, although I still have several tables throughout my site, none of them are for layout purposes! But tables are still one of my favourite things - from classic table borders around a set of definitions to separate them from the text, to colour charts with no data at all other than the colour swatches.
But even tables have their limits e.g. a colour chart where each swatch has its own symbol/pattern/gradient. Then the combined powers of HTML & CSS are to no avail, & only a trusty jpg can save the day.
__________________
/*<--Desk-->*/
desk is offline   Reply With Quote
Reply


Thread Tools
Display Modes
Linear Mode Linear Mode

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:20 PM.



Home | Advertise | Contact Us | Top
Home | Advertise | Contact Us | Top

Copyrightę 2006 WeLoveCSS.com. All Rights Reserved.
Powered by vBulletin Version 3.8.4 Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.