Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2010
    Posts
    319
    Plugin Contributions
    0

    Default validation errors adding images to mega menu

    hi,
    adding images to my megamenu, if you hover over bikes you will see the images.

    it looks ok for me but when i validate it with http://validator.w3.org/ it gives me errors

    here is code ive added to give me image

    PHP Code:
    $result .= '<div style="height: ' MEGAMENU1_ICON_IMAGE_HEIGHT 'px; margin: 0 auto;">' zen_image(DIR_WS_IMAGES $category['image'], 'View our Range of ' $category['name'] . ' Bicycles 'MEGAMENU1_ICON_IMAGE_WIDTHMEGAMENU1_ICON_IMAGE_HEIGHT) . '</div><div style="height: 50px; margin: 0 auto;">' $category['name'] . '</div>'

    errors i get include these

    any help appreciated

    thanks
    bn17311

    Line 213, Column 164: document type does not allow element "div" here; missing one of "object", "applet", "map", "iframe", "button", "ins", "del" start-tag

    …style="height: 106px; margin: 0 auto;"><img src="images/cats/rbg09.jpg" alt="V…



    The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

    One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").

    and

    Error Line 213, Column 371: document type does not allow element "div" here; missing one of "object", "applet", "map", "iframe", "button", "ins", "del" start-tag

    …div><div style="height: 50px; margin: 0 auto;">12 Boys 3+Yrs</div></a></li><li>



    The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

    One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").

  2. #2
    Join Date
    Apr 2010
    Posts
    319
    Plugin Contributions
    0

    Default Re: validation errors adding images to mega menu

    forgot to post test site

    http://bicycles.stuff-4-sale.org/

  3. #3
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    9,689
    Plugin Contributions
    11

    Default Re: validation errors adding images to mega menu

    PHP Code:
    <li class="submenu"><a href="/index.php?main_page=index&amp;cPath=1">BIKES</a>
                           <
    ul class="level2"><li>
    <
    a href="http://bicycles.stuff-4-sale.org/index.php?main_page=index&amp;cPath=963"><div style="height: 106px; margin: 0 auto;"><img src="images/cats/rbg09.jpg" alt="View our Range of 12 Boys 3+Yrs Bicycles" title=" View our Range of 12 Boys 3+Yrs Bicycles " width="150" height="105" /></div><div style="height: 50px; margin: 0 auto;">12 Boys 3+Yrs</div></a></li><li
    When looking at this code (and it is repeated man times on the page) I'm reminded of what my old open-faced reel would do from time to time. We called it a bird's nest.
    You (or the template's creator) have tried to put items inside calls that cannot support them. You've created your own bird's nest by nesting a <div> inside an <a> tag.
    Apparently, this was done to control the image sizes. Just not the proper way to do things. The <div> tag is meant to be a container that surrounds all the information pertaining to it. This might look like that's what it's doing but it would have to surround the entire <a> tag.
    The better choice would be to use the <a> to define what you want. Go to http://tinyurl.com/nsocno8 and scroll down to the accepted answer. Great example of how to fix part of the problem. Make sure you don't wind up with <ul> or <il> tags inside the <a> as well.
    Last edited by dbltoe; 12 Apr 2015 at 04:51 PM.
    A little help with colors.
    myZenCartHost.com - Zen Cart Certified, PCI Compatible Hosting by JEANDRET
    Free SSL & Domain with semi-annual and longer hosting. Updating 1.5.2 and Up.

  4. #4
    Join Date
    Apr 2010
    Posts
    319
    Plugin Contributions
    0

    Default Re: validation errors adding images to mega menu

    thanks now sorted

    bn

 

 

Similar Threads

  1. v139h Mega Menu Mess
    By traytray in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 20 Nov 2012, 07:58 PM
  2. v150 Mega Menu assistance
    By Fancyfrills in forum Templates, Stylesheets, Page Layout
    Replies: 18
    Last Post: 24 Aug 2012, 06:16 PM
  3. v150 No Mega-Menu for v1.5?
    By merrydown in forum All Other Contributions/Addons
    Replies: 4
    Last Post: 31 Jul 2012, 12:04 PM
  4. Horizontal Drop Menu sort order of mega-menu
    By familynow in forum All Other Contributions/Addons
    Replies: 3
    Last Post: 19 Oct 2011, 04:39 PM
  5. Mega menu system?
    By Jakesza in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 19 Sep 2011, 08:51 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg