homepage Welcome to WebmasterWorld Guest from 54.166.84.82
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / Site Graphics and Multimedia Design
Forum Library, Charter, Moderators: not2easy

Site Graphics and Multimedia Design Forum

    
Image Gallery - Failed w3c Validation
Senmar50

10+ Year Member



 
Msg#: 3639874 posted 10:09 pm on May 1, 2008 (gmt 0)

Hello,

I have an image gallery on a web site I am creating. It looks great, but it does not pass w3c validation. Just the images failed validating. I have 30 images and 30 errors. I'll post some of the errors. My doc type is Html 4.01 strict. My gallery page consist of 30 "thumb" images. You click on the thumb image and an "img.html" page will appear with the larger image. Is there a way to fix this problem using "CSS?" Thanks in advance for your help.

Validation Output: 30 Errors
Line 134, Column 37: "IMG" is not a member of a group specified for any attribute.
<a href="large_picts/img22.html" img src="image2/theater.jpg" target="_self">&#9993;

Line 134, Column 41: there is no attribute "SRC".
<a href="large_picts/img22.html" img src="image2/theater.jpg" target="_self">&#9993;

Line 136, Column 22: "IMG" is not a member of a group specified for any attribute.
<a target="_self" img src="image2/theater2.jpg" href="large_picts/img23.html">&#9993;

Line 140, Column 22: "IMG" is not a member of a group specified for any attribute.
<a target="_self" img src="image2/SS.jpg" href="large_picts/img3.html">&#9993;

Line 142, Column 22: "IMG" is not a member of a group specified for any attribute.
<a target="_self" img src="image2/dining4.jpg" href="large_picts/img4.html">&#9993;

Line 145, Column 22: "IMG" is not a member of a group specified for any attribute.
<a target="_self" img src="image2/la10.jpg" href="large_picts/img6.html">&#9993;

Thanks in Advance for your help,
<snip>

[edited by: engine at 8:43 am (utc) on May 2, 2008]
[edit reason] see TOS [/edit]

 

mattur

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 3639874 posted 11:29 pm on May 1, 2008 (gmt 0)

Hi Senmar50
You've accidentally stuck the "a" link and "img" tags together into one tag (!) Should be something like:

<a href="large_picts/img22.html" target="_self"><img src="image2/theater.jpg"></a>

You might want to add height and width attributes on your image tags and, for accessibility/user friendliness, alt attributes too, for example:

<img src="image2/theater.jpg" height="100" width="200" alt="your brief description of the image">

Senmar50

10+ Year Member



 
Msg#: 3639874 posted 7:52 pm on May 5, 2008 (gmt 0)

Hi Mattur,

Thanks so much for your help. My pages passed w3c validation. Question: Would it be wise to place an (index.html) page in the images folder for security purposes? Visitors won't be able to see the content, if they click on the image directory. Should the index.html just say "KEEP OUT" or you have entered a secure area of this web site.

Thanks Again,
SenMar50

limbo

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 3639874 posted 7:54 pm on May 5, 2008 (gmt 0)

Or you could use .htaccess to protect your directories.

g1smd

WebmasterWorld Senior Member g1smd us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 3639874 posted 7:57 pm on May 5, 2008 (gmt 0)

Be aware that your image URLs are relative. This can cause problems, as it is the browser that resolves the path to that file.

I prefer to use URLs that begin with a "/" and therefore count from the root.

Senmar50

10+ Year Member



 
Msg#: 3639874 posted 8:22 pm on May 5, 2008 (gmt 0)

Thank you both....

My images url's are relative. They do begin with "../images".
I have to read up on the (.htaccess). I remember trying the (.htaccess) in the past on a folder, and it didn't work; or I just screwed up. I'm going to read up on it, and give it a try. Thanks again. You folks are always on point.

SenMar50

Senmar50

10+ Year Member



 
Msg#: 3639874 posted 10:51 pm on May 5, 2008 (gmt 0)

Hi,

I tried the .htacess method, and the content of the folder is still exposed.

Here is my .htacess file. I placed the file in the image folder.

<Files .htaccess>
ErrorDocument 404 "<b>Page Not Found</b><p /><br /><a href="../index.html">Return to the homepage</a>
order allow,deny
deny from all
</Files>

I tried another one:

<Files .htaccess>
ErrorDocument 403 /403.html
ErrorDocument 400 /400.html
ErrorDocument 500 /500.html
order allow,deny
deny from all
</Files>

What am I doing wrong..
Thanks in advance,
SenMar50 (P.S. The "index.html" works perfectly) :-)

g1smd

WebmasterWorld Senior Member g1smd us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 3639874 posted 12:45 am on May 6, 2008 (gmt 0)

For links ../ is not the same as /. I use / only.

.

Does this do anything useful for you...

# Protect certain files from being web accessible.
IndexIgnore .htaccess */.?* *~ *# */HEADER* */README*

As far as I know, the ErrorDocument directives shouldn't be anywhere near those either...

encyclo

WebmasterWorld Senior Member encyclo us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 3639874 posted 1:12 am on May 6, 2008 (gmt 0)

Note that you will get a fuller answer to the .htaccess questions in the Apache forum [webmasterworld.com], but you should not be wrapping the rules in a
<Files> container, as that would limit the scope th the .htaccess file only, which would make no sense. :) To turn off all directory indexes, you can just add:

Options -Indexes

to a root-level .htaccess file. :)

henry0

WebmasterWorld Senior Member henry0 us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 3639874 posted 9:44 pm on May 6, 2008 (gmt 0)

adding to mattur
<img src="image2/theater.jpg" height="100" width="200" alt="your brief description of the image">

you also need adding img title

thecoalman

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 3639874 posted 12:36 am on May 7, 2008 (gmt 0)

Placing an index.html file only prevents a listing of the files in the folder. index.html and a few others depending on the server configuration are default pages served when someone types in www.example.com/somefolder/ if there is no default page there the contents of the directory will be shown or as encyclo pointed out you could just turn this option off for all folders.

In any case none of these methods would prevent anyone from accessing the images directly via a correct URL. Using index.html is just a easy way to prevent the directory listing.

Senmar50

10+ Year Member



 
Msg#: 3639874 posted 1:38 am on May 7, 2008 (gmt 0)

Thanks for the help everyone!

Thecoldman, I do understand what you're saying about index.html as my method for preventing folder content from being indexed. But, that's all I knew how to do....until "Limbo" introduced .htaccess to me. I read up on the subject and was able to prevent my files from being indexed.

Here's what I did:

Created a .htaccess file; removed the "txt" extention before uploading to server.

My .htaccess file: (in image folder)

<Files .htaccess>
order allow,deny
deny from all
</Files>

# Protect certain files from being web accessible.
IndexIgnore .htaccess */.?* *~ *# */HEADER* */README*
IndexIgnore *
/////////////////////////////////////////

Results when folder clicked:

Index of /myweb/myimages
Apache/x.x.xx Server at www.#*$!#*$!#*$!#*$!.com Port xx

/////////

I know I have a lot more to learn about .htaccess, but this is a start, and I thnk you all.

Sincerely,
SenMar50

g1smd

WebmasterWorld Senior Member g1smd us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 3639874 posted 12:17 am on May 8, 2008 (gmt 0)

Add this too:

Options -Indexes

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Site Graphics and Multimedia Design
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved