![]() |
| Home | Demo | Services | Features | Help | User Forum | Blog | About | |
|
#1
|
|||
|
|||
|
The StatCounter code for XHTML inserts a <div> tag in both the script output and the noscript code. Since <div> is a block-level element, it forces a newline if the visible StatCounter code appears in a line of text, for example, "You are visitor # "... the counter appears on the next line. This problem does not occur in the ordinary HTML version of the code.
It seems to have originated in this forum post: http://forum.statcounter.com/phpBB2/...ighlight=xhtml , where the <div> tag was added to provide a block-level container for the <a> tag inside the StatCounter code, so it would pass the stricter XHTML validator. But... the <div> does not have to be inside the StatCounter code to contain the <a> tag, it can be outside anywhere in the document. The page author should do this to get the page to validate. I don't think that the visible counter should be block-level (like a paragraph or table) so it always starts a new line. Solution: remove the <div> tags. -Ted Treadwell |
|
#2
|
||||
|
||||
|
Yes, please! I second that!
|
|
#3
|
|||
|
|||
|
A site that I designed, http://www.benwhite.org.uk, is suffering from exactly that problem. The counter is at the bottom, and I hoped that it would be in the form "[email | 0005 | XHTML 1.0" etc.
In saying "remove the div tags", do you mean that removing the div tags would work, or that the developers need to remove the div tags? Thanks, Lionel |
|
#4
|
|||
|
|||
|
What I meant is that the StatCounter developers should remove the <div> element that is wrapping the script output in counter_xhtml.js (2 lines at bottom). It's not necessary for the XHTML validator and it's causing the counter to act as a block element on the page.
The <div> that is in the <noscript> portion of the code must remain, because the noscript tag can only contain block elements due to a stupid quirk of the HTML/XHTML DTDs. But that will only affect the small number of users with javascript turned off. |
|
#5
|
|||
|
|||
|
Ah right, so evidently there is no way that I'll be able to get it inline until they do.
|
|
#6
|
||||
|
||||
|
Quote:
|
|
#7
|
|||
|
|||
|
Well, what kind of changes? I can't say I know anything about java...
|
|
#8
|
||||
|
||||
|
Quote:
After all, there is not many XHTML coded pages, with visible counters where some text is wanted on the same level as the counter. So the need to change can't be so common |
|
#9
|
|||
|
|||
|
I apologize. My knowledge of coding with XHTML is unfamiliar, and so I wouldn't know what to change, and what to. Could you spell it out for me? Thank you.
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|