Page 1 of 4 123 ... LastLast
Results 1 to 10 of 32
  1. #1
    Join Date
    May 2012
    Posts
    564
    Plugin Contributions
    0

    Default Always Problems with the way I'm styling my custom inline Code!

    I just did an HTML validation and received 8 errors. Right now, I am concerned with the errors concerning this inline code because I thought it was finally correct:


    <div class="myCustomParagraph"><center><span id="customHeaderOne">Floral fragrances on sale this week at the Snob!</center></span>

    <p id="customPara">This week at DesignerPerfumeSnob.com we are featuring products with floral fragrance notes. You can find them on sale from Feb 10th to Feb 16th. </p>

    <p id="customPara"> What would you like to see on sale next week? Send an <a href="index.php?main_page=contact_us"><font size="2"><font color="ED3A84">email</font></font></a> and let us know!</p><span id="customHeaderTwo"><center>FREE U.S. SHIPPING + No Minimum Purchase!</center></span></div>


    The errors noted for this code are as follows:

    Line 1512, Column 173: end tag for "span" omitted, but OMITTAG NO was specified
    ...stomHeaderOne">Floral fragrances on sale this week at the Snob!</center></span>


    You may have neglected to close an element, or perhaps you meant to "self-close" an element, that is, ending it with "/>" instead of ">".


    Line 1512, Column 90: start tag was here
    …div class="myCustomParagraph"><center><span id="customHeaderOne">Floral fragra…


    Line 1512, Column 180: end tag for element "span" which is not open
    …stomHeaderOne">Floral fragrances on sale this week at the Snob!</center></span>

    The Validator found an end tag for the above element, but that element is not currently open. This is often caused by a leftover end tag from an element that was removed during editing, or by an implicitly closed element (if you have an error related to an element being used where it is not allowed, this is almost certainly the case). In the latter case this error will disappear as soon as you fix the original problem.

    Line 1516, Column 8: ID "customPara" already defined
    <p id="customPara"> What would you like to see on sale next week? Send an <a hr…

    An "id" is a unique identifier. Each time this attribute is used in a document it must have a different value. If you are using this attribute as a hook for style sheets it may be more appropriate to use classes (which group elements) than id (which are used to identify exactly one element).

    Line 1514, Column 8: ID "customPara" first defined here

    <p id="customPara">This week at DesignerPerfumeSnob.com we are featuring produc…

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

    …</p><span id="customHeaderTwo"><center>FREE U.S. SHIPPING + No Minimum Purchas…

    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>").


    Let me know if you need to see anything else.

    Thanks!

    http://designerperfumesnob.authsafe.com/

  2. #2
    Join Date
    Nov 2007
    Location
    Sunny Coast, Australia
    Posts
    3,379
    Plugin Contributions
    9

    Default Re: Always Problems with this Code!

    Look at the syntax of html:

    you can have <span><center> something something </center></span>

    but you can't have <center><span> something something </center></span>

    see http://www.w3schools.com/

  3. #3
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Always Problems with this Code!

    And this one error has cascaded to show several resulting validation errors. Fixing it will cause many if not all of the other validation errors to disappear.

  4. #4
    Join Date
    May 2012
    Posts
    564
    Plugin Contributions
    0

    Default Re: Always Problems with this Code!

    I'm still getting some errors. This is the code now:

    <div class="myCustomParagraph"><span id="customHeaderOne"><center>Floral fragrances on sale this week at the Snob!</center></span>

    <p id="customPara">This week at DesignerPerfumeSnob.com we are featuring products with floral fragrance notes. You can find them on sale from Feb 10th to Feb 16th. </p>

    <p id="customPara"> What would you like to see on sale next week? Send an <a href="index.php?main_page=contact_us"><font size="2"><font color="ED3A84">email</font></font></a> and let us know!</p><span id="customHeaderTwo"><center>FREE U.S. SHIPPING + No Minimum Purchase!</center></span></div>

    These are the errors:

    ID X already defined

    An "id" is a unique identifier. Each time this attribute is used in a document it must have a different value. If you are using this attribute as a hook for style sheets it may be more appropriate to use classes (which group elements) than id (which are used to identify exactly one element).


    Line 1516, column 8: ID "customPara" already defined

    <p id="customPara"> What would you like to see on sale next week? Send an <a hr…



    document type does not allow element X here; missing one of Y start-tag

    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>").


    •Line 1512, column 116: document type does not allow element "center" here; missing one of "object", "applet", "map", "iframe", "button", "ins", "del" start-tag

    …ph"><span id="customHeaderOne"><center>Floral fragrances on sale this week at …

    Line 1516, column 230: document type does not allow element "center" here; missing one of "object", "applet", "map", "iframe", "button", "ins", "del" start-tag

    …</p><span id="customHeaderTwo"><center>FREE U.S. SHIPPING + No Minimum Purchas…

    Can you please help with these?

  5. #5
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,762
    Plugin Contributions
    9

    Default Re: Always Problems with this custom inline Code!

    You defined customPara twice
    Code:
    Line 1516, Column 8: ID "customPara" already defined 
    Code:
    <p id="customPara">This week at DesignerPerfumeSnob.com we are featuring products with floral fragrance notes. You can find them on sale from Feb 10th to Feb 16th. </p>
    
    <p id="customPara"> What
    Zen-Venom Get Bitten

  6. #6
    Join Date
    May 2012
    Posts
    564
    Plugin Contributions
    0

    Default Re: Always Problems with this custom inline Code!

    I changed the inline code to this:

    <div class="myCustomParagraph">

    <span id="customHeaderOne">Floral fragrances on sale this week at the Snob!</span>

    <p id="customPara"> This week at DesignerPerfumeSnob.com we are featuring products with floral fragrance notes. You can find them on sale from here to here.

    <br /><br /> What would you like to see on sale next week? Send an <a href="index.php?main_page=contact_us"><font size="2"><font color="ED3A84">email</font></font></a> and let us know!

    </p>

    <span id="customHeaderTwo">FREE U.S. SHIPPING + No Minimum Purchase!</span>
    </div>

    The errors for this code are now gone, but so is the centering for custom header one and two. This is the part of the stylesheet that should govern the centering:

    .myCustomParagraph #customHeaderOne {
    color: #000;
    font-size: 150% /* - - - Can use px or em if you like - - */
    font-weight: bold;
    font-face: georgia,times new roman,times,serif;
    text-align; center;
    }

    .myCustomParagraph #customHeaderTwo {
    color: #ed3a84;
    font-size: 150%
    font-style: italic;
    font-weight: bold;
    font-face: georgia,times new roman,times,serif;
    text-align; center;
    }

    but it doesn't, so I had added the <center> and then got the errors.

  7. #7
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Always Problems with this custom inline Code!

    Change the <span id="customHeaderOne"> to <h2 id="customHeaderOne"> and they will auto-center.
    A span is an inline element by default, so some formatting properties will not apply to it. It may also work to make the spans display: block; if you really feel they are not headers.

  8. #8
    Join Date
    May 2012
    Posts
    564
    Plugin Contributions
    0

    Default Re: Always Problems with this custom inline Code!

    Quote Originally Posted by gjh42 View Post
    Change the <span id="customHeaderOne"> to <h2 id="customHeaderOne"> and they will auto-center.
    A span is an inline element by default, so some formatting properties will not apply to it. It may also work to make the spans display: block; if you really feel they are not headers.
    I changed the code to:

    <div class="myCustomParagraph">

    <h2 id="customHeaderOne">Floral fragrances on sale this week at the Snob!</span>

    <p id="customPara"> This week at DesignerPerfumeSnob.com we are featuring products with floral fragrance notes. You can find them on sale from here to here.

    <br /><br /> What would you like to see on sale next week? Send an <a href="index.php?main_page=contact_us"><font size="2"><font color="ED3A84">email</font></font></a> and let us know!

    </p>

    <span id="customHeaderTwo">FREE U.S. SHIPPING + No Minimum Purchase!</span>
    </div>

    and got this:

    http://designerperfumesnob.authsafe.com/

    Please note that all coding both inline and css was done based on input from this forum.

  9. #9
    Join Date
    Feb 2005
    Location
    Lansing, Michigan USA
    Posts
    20,024
    Plugin Contributions
    3

    Default Re: Always Problems with this custom inline Code!

    And you want that text centered ? Just change the left here to center:

    #customPara {
    color: #444443;
    font-size: 1.3em;
    text-align: left;
    }

    Let me know if I misunderstood.

  10. #10
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Always Problems with this custom inline Code!

    I guess I needed to be very specific. You only changed the first opening <span to <h2; you need to change the </span> to </h2>, and do the same for the other span/heading.
    Code:
    <h2 id="customHeaderOne">Floral fragrances on sale this week at the Snob!</span>
    
     <p id="customPara"> This week at DesignerPerfumeSnob.com we are featuring products with floral fragrance notes. You can find them on sale from here to here. 
    
     <br /><br /> What would you like to see on sale next week? Send an <a href="index.php?main_page=contact_us"><font size="2"><font color="ED3A84">email</font></font></a> and let us know!
    
     </p>
    
     <span id="customHeaderTwo">FREE U.S. SHIPPING + No Minimum Purchase!</span>
    </div>

 

 
Page 1 of 4 123 ... LastLast

Similar Threads

  1. Trying to fix inline code with colorbox...
    By toomanyknots in forum General Questions
    Replies: 2
    Last Post: 5 Apr 2015, 04:26 PM
  2. Encryption problems with our custom code
    By GeorgeM1956 in forum Upgrading to 1.5.x
    Replies: 7
    Last Post: 3 Jul 2014, 05:52 PM
  3. inline styling of php
    By hardwiredtemplates in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 28 Jun 2009, 05:39 AM
  4. Problems with styling buttonRow -- esp in IE
    By tstamplis in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 12 Mar 2008, 03:46 AM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR