Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 05-07-2011, 09:49 AM   PM User | #1
toplisek
Regular Coder

 
Join Date: May 2006
Posts: 205
Thanks: 4
Thanked 0 Times in 0 Posts
toplisek has a little shameless behaviour in the past
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..
toplisek is offline   Reply With Quote
Old 05-07-2011, 10:00 AM   PM User | #2
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,689
Thanks: 158
Thanked 2,184 Times in 2,171 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
How did you assume this as an issue with utf-8 ?
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
abduraooft is offline   Reply With Quote
Old 05-07-2011, 01:22 PM   PM User | #3
Apostropartheid
The Apostate


 
Apostropartheid's Avatar
 
Join Date: Oct 2007
Posts: 3,215
Thanks: 16
Thanked 265 Times in 263 Posts
Apostropartheid is on a distinguished road
The error message pretty much tells you what your issue is; have a careful read of it. This has nothing to do with UTF.
__________________
Blog | Twitter
Useful links: W3C HTML Validator | W3C CSS Validator | HTML 5 Guide
CF: HTML & CSS Resources/Tutorials Thread | HTML & CSS Posting Rules and Guidelines
Remember: no link, no code, no help!
Apostropartheid is offline   Reply With Quote
Old 05-07-2011, 08:16 PM   PM User | #4
toplisek
Regular Coder

 
Join Date: May 2006
Posts: 205
Thanks: 4
Thanked 0 Times in 0 Posts
toplisek has a little shameless behaviour in the past
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.
toplisek is offline   Reply With Quote
Old 05-07-2011, 08:42 PM   PM User | #5
Apostropartheid
The Apostate


 
Apostropartheid's Avatar
 
Join Date: Oct 2007
Posts: 3,215
Thanks: 16
Thanked 265 Times in 263 Posts
Apostropartheid is on a distinguished road
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.
__________________
Blog | Twitter
Useful links: W3C HTML Validator | W3C CSS Validator | HTML 5 Guide
CF: HTML & CSS Resources/Tutorials Thread | HTML & CSS Posting Rules and Guidelines
Remember: no link, no code, no help!
Apostropartheid is offline   Reply With Quote
Old 05-07-2011, 10:12 PM   PM User | #6
toplisek
Regular Coder

 
Join Date: May 2006
Posts: 205
Thanks: 4
Thanked 0 Times in 0 Posts
toplisek has a little shameless behaviour in the past
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.
toplisek is offline   Reply With Quote
Old 05-08-2011, 02:43 PM   PM User | #7
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,689
Thanks: 158
Thanked 2,184 Times in 2,171 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
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>
?
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
abduraooft is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:08 AM.


Advertisement
Log in to turn off these ads.