如何将CSS、javascript和HTML文件链接在一起

How to link CSS, javascript and HTML files together

本文关键字:HTML 文件 链接 在一起 javascript CSS      更新时间:2023-09-26

我正在努力学习网络开发,并在代码学院学习了一些课程。它只是教授语法和内容的含义,而不是如何实现它们。有人能帮助我理解以上所有内容是如何联系在一起的吗。我试着做了一个基本的代码,我试着链接一些东西,但css文件没有链接到网页上的HTML文件。

代码低于

<!DOCTYP html>
<HTML>
   <head>
    <link href="http://s3.amazonaws.com/codecademy-content/courses/ltp/css/shift.css" rel="stylesheet">

    <link rel="stylesheet" href="http://s3.amazonaws.com/codecademy-content/courses/ltp/css/bootstrap.css">
    <link rel="stylesheet" href="main.css" type="text/css">

    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
   </head>
   <body> 
    <div class="nav">
     <div class="container">
      <ul class="pull-left">    
        <li><a href="#">HOME</a></li>
        <li><a href="#">CONTACT</a></li>
      </ul>
     </div>
    </div>
    <div class="jumbotron">
     <div class="container">
      <h1>TRANSFER STUDENT?</h1>
      <h4>INDIA -> US</h4>
      <a href="#">Learn More</a> 
     </div>
    </div>
    <div class="content">
     <div class="container">
      <p>This website has been hosted specially for Transfer Students from India into the colleges in the United
     States. Information regarding transfers, eligibility, life and other important aspects of college life
     as a transfer student is available. If any more information is required please vist the contacts tab.</p>          
     </div>
    </div> 
    <div class="otherlinks">
     <div class="explorer">
      <h3>Explore and know about College Transfers</h3>
      <div class="row">
       <div class="col-md-4">
    <div class=""thumbnail">        
     <a href="#"><img src="http://www.dqindia.com/IMG/410/32410/bits01may312k4.jpg"/></a>
     <a href="#"><img src="http://kaw.stb.s-msn.com/i/BC/4C1785CC7D8E3AAB36924732558E36.jpg"/></a>
     <a href="#"><img src="http://m.harvard.edu/modules/home/images/logo-home.png"/></a>
       </div> 
      </div>
     </div>
    </div>
   </body>
</html>  

我还制作了一个小css文件,并试图进行一些更改,但这些更改在页面上不可见css代码位于下方

.jumbotron h1 {
    font-size:30px;
    color:blue;
}
.jumbotron {
    background-image:url('http://urbanupdate.in/wp-content/uploads/
2014/03/india-us-flag.jpg');
}
.nav a {
    color: #5a5a5a;
    font-size: 11px;
    font-weight: bold;
    padding: 14px 10px;
    text-transform: uppercase;
}

此外,我将这些文件保存在同一个文件夹中,其次我使用记分板。另外,如何将我电脑中的其他文件链接到txt文件?我仍然没有包含任何jquery代码,但如果我错了,请纠正我jquery代码将进入我链接jquery的脚本标记之后的两个脚本标记中。正确的

您的代码中有很多错误,但主要是协议错误:

  • 第47行html代码语法错误<div class=""thumbnail">请替换为<div class="thumbnail">
  • 线路5、8、13为具有https的链路提供服务
  • 第7行(在css中),<img>src的48、49、50个路径返回404未找到