SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Zealot cools_sonu's Avatar
    Join Date
    Jan 2010
    Posts
    136
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    html comment in mozilla

    Hello

    My problem is that firefox is behaving weirdly in my system. I'm trying to create any page, and when ever I put an html comment it doesn't show it properly and then I'm not getting the proper result in firefox.

    How can I solve this issue ?

    Well here is the simple html comment which is being converted into firefox like:

    This tag is being
    Code HTML4Strict:
    <!---- End of main div ---->

    like
    &gt;!----------- End of main div ------&gt;

    or some times like

    <!--------- End of main div ---------&gt;

    And after that all the page elements vanishes away..

    How can I solve this issue ?

  2. #2
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,564
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    We would need to see a site wehre this is happening at . Just that little snippet there isn't going to give us enough to create a test case .
    Twitter-@Ryan_Reese09
    http://www.ryanreese.us -Always looking for web design/development work

  3. #3
    SitePoint Zealot cools_sonu's Avatar
    Join Date
    Jan 2010
    Posts
    136
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanx for the reply Ryan

    Well I'm testing on my pc only, So can't post any link to it.

    But I can show u my full code. I'm getting results in all browser even in IE, but not in firefox

  4. #4
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,564
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Full code should work fine, make sure when you post the code, we can reproduce the issue on our end
    Twitter-@Ryan_Reese09
    http://www.ryanreese.us -Always looking for web design/development work

  5. #5
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    You CANNOT legally have that amount of conjoined dashes (without white-space) after the first 2, i.e. -- in a HTML Comment the proper syntax is <!-- .... --> that is probably why it is screwing up.

    White space is not permitted between the markup declaration open delimiter("<!")
    and the comment open delimiter ("--"), but is permitted between the comment close
    delimiter ("--") and the markup declaration close delimiter (">"). A common error is to
    include a string of hyphens ("---") within a comment. Authors should avoid putting
    two or more adjacent hyphens inside comments.
    I am assuming you meant just the comments were doing this and not where you were putting them?
    Last edited by xhtmlcoder; Jan 29, 2010 at 14:57. Reason: Added W3C Clarification

  6. #6
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,159
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    As xhtmlcoder says, the problem is your hyphens inside the comment. Any pair of hypens after <!-- will terminate (or restart) the comment; it doesn't stop at --> as many believe.

    Code:
    <!-- comment -- not comment -- comment again -->
    So you have an empty comment followed by a the text "End of main div ---->".

    Never use more than one hyphen at a time inside an SGML comment.
    Birnam wood is come to Dunsinane

  7. #7
    SitePoint Wizard Blake Tallos's Avatar
    Join Date
    Jun 2008
    Location
    Cuyahoga Falls, Ohio.
    Posts
    1,508
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It might have to deal with IE'S comment bug. http://www.positioniseverything.net/...haracters.html

    It depends, I would have to see the document.
    Blake Tallos - Software Engineer for Sanctuary
    Software Studio, Inc. C# - Fanatic!
    http://www.sancsoft.com/


  8. #8
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,564
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by BlakeAnthony View Post
    It might have to deal with IE'S comment bug. http://www.positioniseverything.net/...haracters.html

    It depends, I would have to see the document.
    I doubt it, he said IE was fine and there has been no mention of IE being outa whack .
    Twitter-@Ryan_Reese09
    http://www.ryanreese.us -Always looking for web design/development work


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
  •