我的代码工作的codepen但不是外面有使用Visual Studio代码来创建我的文件(分别为:Quote.html,Quote.css,Quote.js都在同一个文件夹中)。html在浏览器中打开文件时,出现绿屏,因此css文件正确链接,但js文件未链接。根据我对Stackoverflow的js了解,据我所知,我将文件正确地放入了脚本中,但是我做的事情是错误的。一世HTML文件代码: <!DOCTYPE html> <html> <head> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"/> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css" integrity="sha384-XdYbMnZ/QjLh6iI4ogqCTaIjrFk87ip+ekIjefZch0Y+PvJ8CDYtEs1ipDmPorQ+" crossorigin="anonymous"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta charset="utf-8"> <link rel="stylesheet" type="text/css" href="Quote.css"> </head> <body> <div id="app"></div> <script src="https://cdnjs.cloudflare.com/ajax/libs/react/16.8.6/umd/react.production.min.js" crossorigin></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/react-dom/16.8.6/umd/react-dom.production.min.js" crossorigin></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/css/bootstrap.min.css"></script> <script src="Quote.js" type="text/javascript"></script> </body> </html>//css file code: body {background-color: green; color: white;} #quote-box { margin-top: 80px;}这是应显示的Codepen链接:https ://codepen.io/EOJA/pen/MRNoBq
添加回答
举报
0/150
提交
取消