Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
img width height validation
Old 08-23-2008, 08:35 PM img width height validation
Galaxian's Avatar
Rich Powell

Posts: 842
Name: Rich Powell
Location: United Kingdom
Trades: 0
Is there a way to validate pages without 1 image having width height validation? I have a dynamic image which can change in width/height so cannot declare the dimensions in the img tag..
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

Please help get the new
Please login or register to view this content. Registration is FREE
forum started for Webmasters like you!

Galaxian is offline
Reply With Quote
View Public Profile Visit Galaxian's homepage!
 
 
Register now for full access!
Old 08-24-2008, 02:12 PM Re: img width height validation
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
Nope. The 'rules' say an img must have the dimensions defined.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 08-24-2008, 02:44 PM Re: img width height validation
L a r r y's Avatar
Super Talker

Posts: 102
Name: Larry K
Location: Arizona
Trades: 0
Quote:
Originally Posted by Galaxian View Post
Is there a way to validate pages without 1 image having width height validation? I have a dynamic image which can change in width/height so cannot declare the dimensions in the img tag..
I think it could be done if you replace the img tag with a call to a server-side script that will write the img tag, together with the name of the image and its dimensions. The page will be parsed by the server and sent to the validator or to the visitor's browser as plain HTML.

In so doing, you should have a valid page, and the scripted tag should always validate.
L a r r y is offline
Reply With Quote
View Public Profile Visit L a r r y's homepage!
 
Old 08-24-2008, 02:55 PM Re: img width height validation
L a r r y's Avatar
Super Talker

Posts: 102
Name: Larry K
Location: Arizona
Trades: 0
There may also be a Javascript alternative to my server-side scripting suggestion, wherein the validator doesn't choke on the Javascript and invalidate your page. I am no expert on Javascript, but I have run into a few that work great, but don't validate.

The validator will see the Javascript and not just its results, and you are dependent on the user having Javascript available and enabled. Therefore, if possible, a server-side solution is preferred.
L a r r y is offline
Reply With Quote
View Public Profile Visit L a r r y's homepage!
 
Old 08-24-2008, 03:22 PM Re: img width height validation
Valiant's Avatar
Super Talker

Posts: 112
Location: England
Trades: 0
Couldn't you just use percentages as the height and width???
Valiant is offline
Reply With Quote
View Public Profile
 
Old 08-28-2008, 05:57 PM Re: img width height validation
L a r r y's Avatar
Super Talker

Posts: 102
Name: Larry K
Location: Arizona
Trades: 0
That may work -- if a 640x480 pixel image is displayed as 640x480 with a width=100% and height=100%, then if a different image appears with say, 640x817 pixels, it should appear as 640x817 with the same 100% width and height values. I have no experience with that, but your question also caused me to search and come up with an article that suggests specifying images in ems and thus have the browser's text size changer affect image size too. That won't help the original poster's dilemma, but something worth looking at.

See http://www.bigbaer.com/css_tutorials...l.tutorial.htm
L a r r y is offline
Reply With Quote
View Public Profile Visit L a r r y's homepage!
 
Old 08-28-2008, 10:33 PM Re: img width height validation
Novice Talker

Posts: 5
Name: alex
Trades: 0
Quote:
Originally Posted by L a r r y View Post
That may work -- if a 640x480 pixel image is displayed as 640x480 with a width=100% and height=100%, then if a different image appears with say, 640x817 pixels, it should appear as 640x817 with the same 100% width and height values. I have no experience with that, but your question also caused me to search and come up with an article that suggests specifying images in ems and thus have the browser's text size changer affect image size too. That won't help the original poster's dilemma, but something worth looking at.

See http://www.bigbaer.com/css_tutorials...l.tutorial.htm
This is true the picture will stay the same width and height
mightclubkid is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to img width height validation
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.55275 seconds with 12 queries