garyk Posted October 13, 2009 Share Posted October 13, 2009 Hi, I am validating my HTML with w3c, its outputting an error;Attribute "background" exists, but can not be used for this element. <table background="../images/stories/main_ad_bg.png" width="800" height="255" >What would the error within the brackets be?... Link to comment Share on other sites More sharing options...
Kingy Posted October 13, 2009 Share Posted October 13, 2009 Hi, I am validating my HTML with w3c, its outputting an error;Attribute "background" exists, but can not be used for this element. <table background="../images/stories/main_ad_bg.png" width="800" height="255" >What would the error within the brackets be?...Try updating your link so it doesn't have the ../ Link to comment Share on other sites More sharing options...
thescientist Posted October 13, 2009 Share Posted October 13, 2009 maybe you have to use CSS instead? Link to comment Share on other sites More sharing options...
garyk Posted October 14, 2009 Author Share Posted October 14, 2009 For some reason the validation output doesn't like the "height" attribute. maybe inline styles as you say... Link to comment Share on other sites More sharing options...
Synook Posted October 14, 2009 Share Posted October 14, 2009 What about moving the styles to a stylesheet, as is good practice? Link to comment Share on other sites More sharing options...
garyk Posted October 14, 2009 Author Share Posted October 14, 2009 Your right!, will give that a try now as well. I got rid of the error but also managed to loose the background image in the process through CSS. Link to comment Share on other sites More sharing options...
Zath Posted October 14, 2009 Share Posted October 14, 2009 This error is down to using the wrong DOCTYPE for the code you are using.You should be able replace inline styles etc with a CSS equivalent. Link to comment Share on other sites More sharing options...
garyk Posted October 14, 2009 Author Share Posted October 14, 2009 Ok so now I realize the plot thickening. I am working within a module in Joomla. I am unable to link to a css from within the module nor can I add css within the head coz if I pull in full html into the module it shall call up further errors on validation... Link to comment Share on other sites More sharing options...
garyk Posted October 14, 2009 Author Share Posted October 14, 2009 So I wrapped the content into a <div> then styled the div this was able to remove the errors Link to comment Share on other sites More sharing options...
dsonesuk Posted October 14, 2009 Share Posted October 14, 2009 is this a new module you have created, or a already predefined module?you can give modules you have created a class 'Module Class Suffix' which will give you more control to add your specific css formatting to.you are trying to control the table background within a module itself, or a table within the index page? where the module positions are defined. Link to comment Share on other sites More sharing options...
garyk Posted October 14, 2009 Author Share Posted October 14, 2009 I am creating a template for the designers to follow when developing promotions. Once I have removed the validating issues for the homepage I can send it to them. The module is a mod_php which I created and positioned on the homepage index, this module will be updated often with new promotions etc. Strange thing was I played around with the following code and managed to successfully validate the CSS... for about 5mins before it reverted back to the errors again..most confusing..<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><!--<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>" >--> Link to comment Share on other sites More sharing options...
garyk Posted October 14, 2009 Author Share Posted October 14, 2009 If you are familiar with Joomla, wouldnt you think it would be virtually impossible to validate your HTML with all the different extensions one can use? I think I may have opened a can O worms trying to validate the HTML of a Joomla site... Link to comment Share on other sites More sharing options...
dsonesuk Posted October 14, 2009 Share Posted October 14, 2009 it's true!, in some cases there is no way to validate your joomla site because of extension's that break the validation rules (usually when transparency is involved).but in your case, its just a table, which broke the rule of using old method of 'background=' to insert a background image,if you used style="background-image:url(../images/stories/main_ad_bg.png);" it would probably validate, but you should use a class, or id to reference this table, to assign the background.Edit: this is why the height within the table also failed, but if where to add this to the style=".....", again, this would then validate. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.