vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Need help with validating this short bit of code (https://vborg.vbsupport.ru/showthread.php?t=139713)

Goat Boy 02-18-2007 01:33 AM

Need help with validating this short bit of code
 
A few months back I was askied if I could help out managing vbulletin for a website. This site was created 2~3 years ago and when I check the XHTML validation there were many errors. I have read and read and fixed up many of the error in which I have it down to 4 which lie in the header and footer. This was a custom template for the site.

Just wondering if someone can look at this code to see if anything sticks out as incorrect, I am stuggling with getting this to validate

PHP Code:

<table background="http://www.cmoc.ca/images/forum/mainbg.jpg" cellspacing=0 cellpadding=0  align="center" width="760" alt="Ford Mustang Canada"

The main errors are:

there is no attribute "background"
an attribute value specification must be an attribute value literal unless SHORTTAG YES is specified
there is no attribute "alt"


Hopefully this is enough information.
Thanks

Adrian Schneider 02-18-2007 01:41 AM

-Wrap your cellpadding and cellspacing values in double quotes.
-Replace background="X" with style="background: X"
-Replace alt attribute with summary attribute

The rest should be OK for XHTML transitional.

da420 02-18-2007 01:48 AM

HTML Code:

<table bgcolor="http://www.cmoc.ca/images/forum/mainbg.jpg" cellspacing=0 cellpadding=0  align="center" width="760" SUMMARY="Ford Mustang Canada">
Try that.

Goat Boy 02-18-2007 02:14 AM

Thanks for your help guys, almost there.

I can't believe I missed the quotes since I found them missing earlier in the footer :o

The only problem I have now is this
Replace background="X" with style="background: X"

Just to explain what happens it seem the jpg in the original code gets stretched to fill part of the header in the height, when I change it to the code suggested it passes the XHTML but the jpg does not get streched :confused:

One bit of code that follows the code I posted above that may give a clue is this

<tr valign="top"><td>


da420 when using bgcolor that code it fills it with a color instead of the jpg

Kungfu 02-18-2007 03:11 AM

<a href="http://www.w3schools.com/css/css_background.asp" target="_blank">http://www.w3schools.com/css/css_background.asp</a>

but to strech youll need something like css
background: #0A0B0C url(/images/bg.jpg) top left repeat-x;

that may work as it is. or you can do something like
background-image: url(/images/bg.jpg);
background-repeat: repeat-x;
etc..

Adrian Schneider 02-18-2007 03:24 AM

Oops, forgot the url() bit, thought that was obvious. :)

Goat Boy 02-19-2007 02:30 AM

Thanks for your help guys, got it all fixed up :)


All times are GMT. The time now is 08:51 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04023 seconds
  • Memory Usage 1,724KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_html_printable
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete