0

I have a problem. I have CSS styles for 9 buttons on my webpage but #a doesn't work. All the other 8 ones are working fine. (The CSS is paired with HTML and Javascript, I'm trying to make a Tic-Tac-Toe Game.) (Note: I removed some code, because its all the same.)

#a {
    position:absolute;
    left:50px;
    top:150px;
    <!-- The Green Text Is Purely For De-bug purposes -->
    text-color:green;
}
#b {
    position:absolute;
    left:150px;
    top:150px;
}
#c {
    position:absolute;
    left:250px;
    top:150px;
}
#d {
    position:absolute;
    left:50px;
    top:200px;
}
10
  • Show us the HTML (or JSFiddle) with the issue. Apr 9, 2014 at 0:42
  • 3
    Does is work if you take out the text-color and the comment? Because, for color it is color:green; and comments in CSS are /* comment */
    – Stephen P
    Apr 9, 2014 at 0:47
  • 3
    Nor would it, if you spelled it text-color (and don't be too quick to assume the HTML isn't relevant; you've got at least one incorrect assumption somewhere)
    – Paul Roub
    Apr 9, 2014 at 0:52
  • 1
    The comment syntax here is wrong, I don't know if you actually have that in your code. You should use /* ... */ to comment your CSS lest you want the parser to break and ignore your code. Apr 9, 2014 at 0:54
  • 1
    The HTML (the DOM) is absolutely relevant, even if it's generated by JS -- the #a rule could fail, for example, if there is more that one DOM element with id="a"
    – Stephen P
    Apr 9, 2014 at 0:55

1 Answer 1

2

The problem was the comments, I tried with and without them and it turns out they should be

/* Blaah */

instead of

<!-- Blaah -->

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.