Not able to view html/css code in browser view

I thought I’d ask. When I use the code below in sublime and brackets text editor I am unable to view the code in the browser view. I just get a blank browser. If I try on other text programs such as online text code browsers I get the same results. What am I doing wrong? I’m not sure how to present the code without it printing.

<DOCTYPE html>
<html>
<link rel="stylesheet" href="mystyle.css">
<head>
<meta charset="UTF-8">
<title> </title>
<style>
	table {
		border: 1px black solid;
	}

	table th {
		border: 1px black solid;
	}

	table td {
		border: 1px black solid;
	}
</head>
<body>
	<table style="border: 1 px black solid;">
		<tr>
			<th>Player name</th>
			<th>shots</th>
			<th>points</th>
			<th>free throws</th>
			<th>Rebounds</th>
			<th>Steals</th>
			<th>Assists</th>
		</tr>
		<tr>
			<td>jack</td>
			<td>95</td>
			<td>40</td>
			<td>30</td>
			<td>20</td>
			<td>40</td>
			<td>49</td>
		</tr>
		<tr>
			<td>bob</td>
			<td>34</td>
			<td>32</td>
			<td>90</td>
			<td>45</td>
			<td>12</td>
			<td>10</td>
		</tr>
	</table>
    </style>
	</body>
</style>
</body>
</html>

I’ve edited your code for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').

you can use an html validator like the one below to help you find errors that may prevent your code from working properly (just copy your code into it)

I do see some obvious mistakes like:

  • The link tag should be nested in the head element
  • the </style> tag is in the wrong place as it should be inside the head block of code
  • there are duplicate </body>
    and other mistakes

That helped tremendously! Thank you!

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.