javascript - Error showing in my practice? "Unexpected character after attribute value" - Stack Overflow

New to using HTML and Javascript and trying to practice just placing text, buttons, etc. Getting "

New to using HTML and Javascript and trying to practice just placing text, buttons, etc. Getting "Unexpected Character After attribute value". What does this mean? i still am able to place everything so should i just ignore it? Thanks.

<!DOCTYPE html>
<html>
<head>
    <title>Page title</title>
</head>
<body>
    <h1 style="text-align:center;">Computer Programming</h1>
    <p style="text-align:center;">Programming Language List</p>
    <ul>
        <li> <button style='color:red';>HTML</button> </li>
        <li> <button style='color:blue';>JAVASCRIPT</button></li>
        <li> <button style='color:green';>CSS</button> </li>
    </ul>
</body>
</html>

New to using HTML and Javascript and trying to practice just placing text, buttons, etc. Getting "Unexpected Character After attribute value". What does this mean? i still am able to place everything so should i just ignore it? Thanks.

<!DOCTYPE html>
<html>
<head>
    <title>Page title</title>
</head>
<body>
    <h1 style="text-align:center;">Computer Programming</h1>
    <p style="text-align:center;">Programming Language List</p>
    <ul>
        <li> <button style='color:red';>HTML</button> </li>
        <li> <button style='color:blue';>JAVASCRIPT</button></li>
        <li> <button style='color:green';>CSS</button> </li>
    </ul>
</body>
</html>
Share Improve this question asked Apr 29, 2018 at 0:03 J DJ D 1372 silver badges12 bronze badges 3
  • 1 you've got your CSS semicolons outside the quotes for the attribute values (sometimes). – Pointy Commented Apr 29, 2018 at 0:05
  • @Pointy I can't believe i missed that. Sorry if it was a dumb question but i appreciate the help! – J D Commented Apr 29, 2018 at 0:07
  • Note that you don't really need the last semicolon in the "style" attribute string. – Pointy Commented Apr 29, 2018 at 0:10
Add a ment  | 

1 Answer 1

Reset to default 3

Check your semicolons on your button tag, they have to be inside quotes like:

<button style='color:green;'>CSS</button>

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745141567a4613456.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信