我无法使用预览浏览器(VS代码扩展)

时间:2019-08-13 10:54:20

标签: html css visual-studio-code

我安装了Browser Preview(Visual Studio代码扩展),但是我不能使用它。

安装后,我有两个选择:

  • 浏览器预览:附加
  • 浏览器预览:启动

选择附加选项时,我将显示以下屏幕:

Browser Preview: Attach

然后选择启动选项:

Browser Preview: Launch

我尝试按照“如何更改默认的起始URL /起始页?”主题中的说明进行配置。来自plug in page

configure

第一种情况我得到了结果。 有两个名为“浏览器预览”的字段。我分别尝试了一个,而且都尝试了。

我也来查看vs code网站。

我还测试了许多变体,例如* .html文件的url。该文件甚至已打开,但没有同时更新。我还尝试将http:// localhost:3000放在提到的字段中。我也没有成功。

我尝试删除所有vs代码文件(包括配置文件)并重新安装所有内容,但是我也没有解决问题。

我认为该错误可能在launch.json配置文件中。我正在阅读此文件中包含的link,但已经浪费了太多时间,无法寻求帮助。

我将保留我的html代码和配置文件。

注意:忽略html / css的格式错误。我不久前开始研究Web开发。

配置文件“ launch.json”:

{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
    {
        "type": "browser-preview",
        "name": "Browser Preview: Attach",
        "request": "attach"
    },
    {
        "type": "browser-preview",
        "request": "launch",
        "name": "Browser Preview: Launch",
        "url": "http://localhost:3000"
    }
]
}

html{
	background-image: url("imagens/fundo.png");
}

td{
	font-weight: bold;
	text-align: center;
}

a{
	color: blue;
}

table{
	background-color: #dddd;
	padding: 10px;
	height: 90px;
	width: 900px;
}

#ConteudoPrincipal{
	width: 880px;
	padding: 10px;
	background-color: white;	
}

#TodosOsDireitosReservados{
	
	text-align: center;
	/*margin: auto;*/
	width: 880px;
	padding: 10px;
	font-weight: bold;
}

.FotosStyle{
	border: 10px solid #ddd;
}

#DivFoto1{
	padding: 10px;
}

#TiituloDaPágina{
	color: #444241;
	font-weight: bold;
	font-size: 20px;
}
<!DOCTYPE html>
<html>

	<head>
		<title>Campanhas publicitárias</title>
		<meta charset="utf-8">
		<link rel="stylesheet" type="text/css" href="estilo.css">
	</head>
	
	<body>
		
		<img src="imagens/capa.png">
		
		<div>
			<table>
				<tr>
					<td> <a href="indexs.html">HOME</a></td>
					<td>|</td>
					<td><a href="BIOGRAFIA.html">BIOGRAFIA</a></td>
					<td>|</td>
					<td><a href="CAMPANHA_PUBLICITARIAS.html">CAMPANHA PUBLICITÁRIAS</a></td>
					<td>|</td>
					<td><a href="CONTATOS.html">CONTATOS</a></td>
				</tr>
	
			</table>
		</div>

		<div id="ConteudoPrincipal">

			<div>
				<P id="TiituloDaPágina">Sobre Anna Bella</P>
			</div>
			
			<div>
				<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras nunc felis, tincidunt congue tellus a, finibus viverra dolor. Phasellus vel nunc vel ligula elementum cursus ut vel velit. Cras porta ullamcorper turpis quis ultricies. Donec dignissim mauris augue, eget vulputate odio commodo vitae. Phasellus et vehicula diam. Suspendisse sed nunc nec quam ornare condimentum. Cras sit amet nibh ac nibh condimentum consectetur ac id orci. Mauris ac gravida libero, non porttitor sapien. Pellentesque nec ultricies ex. Nam id arcu nibh. Mauris vitae semper orci. Curabitur maximus scelerisque quam quis hendrerit. Fusce semper accumsan lacus, id hendrerit lacus sagittis id. Phasellus iaculis mi at egestas venenatis. Nunc fermentum diam vel nunc rhoncus ultrices.</p>
			
				<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras nunc felis, tincidunt congue tellus a, finibus viverra dolor. Phasellus vel nunc vel ligula elementum cursus ut vel velit. Cras porta ullamcorper turpis quis ultricies. Donec dignissim mauris augue, eget vulputate odio commodo vitae. Phasellus et vehicula diam. Suspendisse sed nunc nec quam ornare condimentum. Cras sit amet nibh ac nibh condimentum consectetur ac id orci. Mauris ac gravida libero, non porttitor sapien. Pellentesque nec ultricies ex. Nam id arcu nibh. Mauris vitae semper orci. Curabitur maximus scelerisque quam quis hendrerit. Fusce semper accumsan lacus, id hendrerit lacus sagittis id. Phasellus iaculis mi at egestas venenatis. Nunc fermentum diam vel nunc rhoncus ultrices.</p>
	
				<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras nunc felis, tincidunt congue tellus a, finibus viverra dolor. Phasellus vel nunc vel ligula elementum cursus ut vel velit. Cras porta ullamcorper turpis quis ultricies. Donec dignissim mauris augue, eget vulputate odio commodo vitae. Phasellus et vehicula diam. Suspendisse sed nunc nec quam ornare condimentum. Cras sit amet nibh ac nibh condimentum consectetur ac id orci. Mauris ac gravida libero, non porttitor sapien. Pellentesque nec ultricies ex. Nam id arcu nibh. Mauris vitae semper orci. Curabitur maximus scelerisque quam quis hendrerit. Fusce semper accumsan lacus, id hendrerit lacus sagittis id. Phasellus iaculis mi at egestas venenatis. Nunc fermentum diam vel nunc rhoncus ultrices.</p>
			</div>

		</div>

		
		<div id="TodosOsDireitosReservados">
			<p>Todos os direitos reservados.</p>
		</div>

	</body>


</html>

0 个答案:

没有答案