Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8136607
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T10:48:56+00:00 2026-06-06T10:48:56+00:00

I have just found something very weird while developing a website. While trying to

  • 0

I have just found something very weird while developing a website. While trying to get a div element to display across the top of the screen, I noticed that I wasn’t achieving a desired result in any browser except for old versions of IE. In order to test some different code, instead of deleting the faulty line, I used ‘//’ to comment it out (I’m not really even sure if that works in css) but what happened was, the compatible browsers used the uncommented code, while IE used the code marked by ‘//’. here is the code:

#ban-menu-div{
position:fixed;top:0;
//position:relative; //<-- IE keeps the banner with rel pos while the other
display:block;       //    browsers used fixed
margin:auto;
padding:0px;
width:100%;
text-align:center;
background:black;
}

so basically, it seems as though // can be used to instruct newer browsers to ignore specific lines of code, and instruct older versions of IE to use it? If this is common practice someone please let me know. it sure makes developing for older browsers a hell of a lot easier

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T10:48:57+00:00Added an answer on June 6, 2026 at 10:48 am

    // is not a valid CSS comment.

    Browsers that parse CSS properly will ignore //position because //position is not a valid property name (details are here, property -> IDENT S* -> follow it through).

    This only works in IE7 due to its well known bug of accepting properties with junk prepended to them.

    It’s not just // that works. IE7 will have red text here:

    body {
        !/!*//color: red;
    }
    

    This is most typically exploited with *, for example *display: inline; as part of the display: inline-block workaround for IE7.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just found this great tutorial as it is something that I need.
I'm a penetration tester and I have just found, on a website we are
I have just found a script we are using which has a sub that
I have just started spring, I found that somewhere we are using handlerequest() method
I have an interview tomorrow morning and just found out that I will also
I am learning Java and just found that the Interface can have fields, which
Just have read sass changelog and found out that FSSM (the gem that had
I have looked but have not found a specific answer for changing just one
Just random pick some methods that I have found: sforce.connection.describeSObject sforce.SearchResult sforce.sObject sforce.LeadConvert() sforce.connection.create()
I just migrated from Windows to Mac OS X and have found theres no

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.