Forum Moderators: not2easy
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">✉
Line 134, Column 41: there is no attribute "SRC".
<a href="large_picts/img22.html" img src="image2/theater.jpg" target="_self">✉
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">✉
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">✉
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">✉
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">✉
Thanks in Advance for your help,
<snip>
[edited by: engine at 8:43 am (utc) on May 2, 2008]
[edit reason] see TOS [/edit]
<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">
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
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
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) :-)
<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. :)
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.
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