Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    Regular Coder
    Join Date
    May 2006
    Posts
    216
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Question UTf and validation issue inside SPAN

    I have code on UTF8 pages like:
    PHP Code:

    <ul>
    <
    li>
    <
    span>

    <
    div style="margin: 10px 5px 0px;"></div><div style="border-style: dotted; border-width: 1px; padding: 2px 0px 2px 5px; background-color: rgb(225, 255, 230); margin-bottom: 3px;"><a href="index1.html">My index file</a></div><div style="margin:10px 5px 0px;"></div>

    </
    span>

    </
    li>
    </
    ul
    I can not modify this working code. Is there solution to fix this issue?

    Error message:

    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>").
    Last edited by toplisek; 05-07-2011 at 09:54 AM.

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,855
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    How did you assume this as an issue with utf-8 ?
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    The Apostate Apostropartheid's Avatar
    Join Date
    Oct 2007
    Posts
    3,215
    Thanks
    16
    Thanked 265 Times in 263 Posts
    The error message pretty much tells you what your issue is; have a careful read of it. This has nothing to do with UTF.

  • #4
    Regular Coder
    Join Date
    May 2006
    Posts
    216
    Thanks
    4
    Thanked 0 Times in 0 Posts
    It is 50 lines coded menu and seems not to be validated. Probably I can not change to DIV as it will be mixture of my CSS code.

    ANSI encoding gives error in validation even you can have 100% valid code.

    UTF8 without BOM will delete hidden text.

  • #5
    The Apostate Apostropartheid's Avatar
    Join Date
    Oct 2007
    Posts
    3,215
    Thanks
    16
    Thanked 265 Times in 263 Posts
    Quote Originally Posted by toplisek View Post
    It is 50 lines coded menu and seems not to be validated. Probably I can not change to DIV as it will be mixture of my CSS code.

    ANSI encoding gives error in validation even you can have 100% valid code.

    UTF8 without BOM will delete hidden text.
    What?

    You can't have a div within a span. If you want a block level element inside of an inline one, you'll have to use CSS's display property.

  • #6
    Regular Coder
    Join Date
    May 2006
    Posts
    216
    Thanks
    4
    Thanked 0 Times in 0 Posts
    I'm new to this issue.
    How you connect CSS properties with SPAN as inline element and inside DIV?

    If you want a block level element inside of an inline one, you'll have to use CSS's display property....

    Need more info.

  • #7
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,855
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    Don't you just need
    Code:
    <ul>
    	<li style="margin: 5px;border: 1px dotted #000;  padding: 2px 0px 2px 5px; background-color: rgb(225, 255, 230);">
    		<a href="index1.html">My index file</a>
    	</li>
    </ul>
    ?
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)


  •  

    Posting Permissions

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