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
1 Answer
Reset to default 3Check 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条)