完全沒用過javascript,不知道要如何開始
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.5/font/bootstrap-icons.css">
<link rel="stylesheet" href="layout.css">
<link rel="stylesheet" href="styles.css">
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
width: 100%;
max-width: 1200px;
margin: 0 auto;
font-family: Arial, sans-serif;
/*position: relative;*/
}
header {
background-color: white;
height: 140px;
position: relative;
}
header .dropbtn {
font-size: 18px;
}
.sticky-header {
padding: 10px;
text-align: center;
position: fixed;
width: 85%;
top: 0;
z-index: 1;
/* 确保标题在内容之上 */
}
.scrolling-content {
padding: 20px;
margin-top: 50px;
/* 为内容留出标题的空间 */
overflow-y: scroll;
/* 让内容区域可以滚动 */
height: calc(100vh - 50px);
/* 设置内容区域高度,确保内容在标题下面 */
}
header img {
border: white;
width: 100px;
height: 100px;
}
header .dropdown {
/*background-color: rgb(242, 255 ,0);*/
right: -245px;
bottom: -80px;
}
/*header nav a{
background-color: darkblue;
color: #fff;
font-size: 18px;
letter-spacing: 1px;
padding: 10px 20px;
display: block;
float: left;
text-decoration: none;
border-radius: 8px 8px 0 0;
border: 1px solid red;
margin: 0 3px;
margin-top: 20px;
}*/
header .dropdown-content a {
background-color: white;
color: black;
font-size: 12px;
letter-spacing: 2px;
padding: 10px 12px;
border-radius: 8px 8px 0 0;
margin-left: 5px;
transition: .2s;
}
header .dropdown-content a:hover {
padding-bottom: 30px;
}
body>nav {
background-color: white;
color: #fff;
height: 60px;
position: sticky;
top: 0;
}
main {
background-color: white;
overflow: hidden;
display: flex;
justify-content: center;
margin-top: 400px;
}
aside {
display: flex;
justify-content: space-between;
}
aside a {
text-align: right;
}
main aside {
background-color: white;
float: right;
width: 20%;
padding: 10px;
}
main video {
width: 80%;
display: block;
margin: 0 auto;
}
.content {
background-color: white;
width: 80%;
padding: 20px;
margin: 4%;
}
.content img {
display: block;
margin-bottom: 20px;
}
.content h1 {
font-size: 2em;
margin: 0 0 20px;
margin-top: 20px;
}
.content figure {
letter-spacing: 1px;
line-height: 1.5;
text-align: justify;
margin-top: 3px;
}
.gomore {
background-color: white;
color: black;
padding: 8px;
border: none;
font-size: 18px;
letter-spacing: 2px;
padding: 10px 12px;
border-radius: 8px 8px 0 0;
}
footer {
background-color: darkblue;
color:#fff;
text-align: center;
padding: 1em;
}
.footer-content{
margin-left: 20px;
}
img {
width: 25%;
height: 300px;
margin-top: auto;
margin-bottom: auto;
float: left;
}
/* 按鈕樣式 */
.dropbtn {
background-color: white;
color: black;
padding: 10px 10px;
border: none;
}
.dropbtn img {
width: 15px;
height: 15px;
float: right;
margin-top: auto;
margin-bottom: auto;
}
/* 下拉菜單容器 */
.dropdown {
position: relative;
display: inline-block;
}
/* 下拉菜單內容(隱藏起來) */
.dropdown-content {
display: none;
position: absolute;
background-color: #f1f1f1;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
z-index: 1;
}
/* 下拉菜單內容中的選項 */
.dropdown-content a {
padding: 12px 16px;
text-align: left;
text-decoration: none;
display: block;
}
/* 滑鼠懸停時,顯示下拉菜單內容 */
.dropdown:hover .dropdown-content {
display: block;
}
</style>
<!-- 左右方向鍵 -->
<button class="carousel-control-prev" type="button" data-bs-target="#sec1Slider" data-bs-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="visually-hidden">Previous</span>
</button>
<button class="carousel-control-next" type="button" data-bs-target="#sec1Slider" data-bs-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="visually-hidden">Next</span>
</button>
<!-- 換頁控制器 -->
<div class="carousel-indicators">
<button type="button" data-bs-target="#sec1Slider" data-bs-slide-to="0" class="active"
aria-current="true" aria-label="Slide 1"></button>
<button type="button" data-bs-target="#sec1Slider" data-bs-slide-to="1" aria-label="Slide 2"></button>
<button type="button" data-bs-target="#sec1Slider" data-bs-slide-to="2" aria-label="Slide 3"></button>
<button type="button" data-bs-target="#sec1Slider" data-bs-slide-to="3" aria-label="Slide 3"></button>
</div>
</div>
</section>
<header class="sticky-header">
<div class="header">
<img src="./images/02.png" alt="./images/02.png">
</div>
<div class="dropdown">
<button class="dropbtn">
<a class="gomore" href="https://www.itsesg.com/" target="_blank">首頁</a>
</button>
</div>
<div class="dropdown">
<button class="dropbtn">
產品介紹
</button>
<div class="dropdown-content">
<a href="test003.html">BAS建築自動化系統</a>
<a href="test004.html">雲管家物管系統</a>
<a href="text005.html">AI智能影像辨識系統</a>
<a href="text006.html">智慧綠建築顧問</a>
<a href="text007.html">健康建築顧問</a>
</div>
</div>
<div class="dropdown">
<button class="dropbtn">
專案
</button>
<div class="dropdown-content">
<a href="text008.html">成功案例</a>
<a href="text008.html">團隊證照</a>
<a href="text008.html">專業顧問群</a>
</div>
</div>
<div class="dropdown">
<button class="dropbtn">
聯絡我們
</button>
<div class="dropdown-content">
<a class="gomore" href="test002.html" target="_blank">聯絡我們</a>
</div>
</div>
</header>
<main class="scrol-+ling-content">
<div class="content">
<hr class="my-4">
<div class="row">
<div class="col-lg-4 col-sm-6 mb-3">
<div class="card">
<img class="card-img-top" src="images/01.jpg" alt="./images/01.jpg">
<div class="card-body">
<h5 class="card-title text_limit2">BAS建築自動化系統</h5>
<a href="test003.html" class="btn btn-primary">More...</a>
</div>
</div>
</div>
<div class="col-lg-4 col-sm-6 mb-3">
<div class="card">
<img class="card-img-top" src="images/07.jpg" alt="./images/07.jpg">
<div class="card-body">
<h5 class="card-title text_limit2">雲管家物管系統</h5>
<a href="test004.html" class="btn btn-primary">More...</a>
</div>
</div>
</div>
<div class="col-lg-4 col-sm-6 mb-3">
<div class="card">
<img class="card-img-top" src="images/08.jpg" alt="./images/08.jpg">
<div class="card-body">
<h5 class="card-title text_limit2">AI智能影像辨識系統</h5>
<a href="text005.html" class="btn btn-primary">More...</a>
</div>
</div>
</div>
<div class="col-lg-4 col-sm-6 mb-3">
<div class="card">
<img class="card-img-top" src="images/09.jpg" alt="./images/09.jpg">
<div class="card-body">
<h5 class="card-title text_limit2">智慧綠建築顧問</h5>
<a href="text006.html" class="btn btn-primary">More...</a>
</div>
</div>
</div>
<div class="col-lg-4 col-sm-6 mb-3">
<div class="card">
<div class="card-body">
<h5 class="card-title text_limit2">健康建築顧問</h5>
<a href="text007.html" class="btn btn-primary">More...</a>
</div>
</div>
</div>
</div>
<h1>ITsESG 官網影片</h1>
<video id="test" controls width="640" height="360">
<source src="001.mp4" type="video/mp4">
</video>
</main>
<script src="script.js"></script>
<footer>
<p>Copyright ©2023 ITsESG Corporation 版權所有</p>
<footer id="footer">
<div class="container">
<div class="row">
<div class="col-12 col-md-10 col-lg-10">
<div class="footer-content">
<ul>
<li><a href="text009.html">About Us</a></li>
</footer>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/js/bootstrap.bundle.min.js"
integrity="sha384-/bQdsTh/da6pkI1MST/rWKFNjaCP5gBSY4sEBT38Q/9RBh9AH40zEOg7Hlq2THRZ"
crossorigin="anonymous"></script>
<script src="https://code.jquery.com/jquery-3.7.0.min.js"
integrity="sha256-o88AwQnZB+VDvE9tvIXrMQaPlFFSUTR+nldQm1LuPXQ=" crossorigin="anonymous"></script>
學任何語言, 一定都先從 Hello World 開始:
https://v1.vuejs.org/guide/
下一個挑戰通常是九九乘法表:
用 Vue 寫出九九乘法表
至少有個工具書在手上:
Vue 入門
或許也要去了解一下, 它的前世今生:
重新認識 Vue.js
以上都熟練了之後, 才來開始寫你自己的專案....
看起來臨時要套框架應該不是你自己決定的,那就從最基本的開始說起吧
在 Vue 裡面第一步是會把你所指定的內容轉換成 Vurtual DOM 來執行,因此你需要的是將 html 的元件內容包覆進去,若是用 CDN 導入的建議去看一下 #app 跟 el/mount() 的關係
那至於使用 jQuery 與 bootstrap 的專案臨時要轉到 Vue 會因為生命週期的問題改一點寫法,這可能要跟你們家大頭詢問必要性了,若是個人學習建議先搞懂 Vue 在做什麼以及什麼時候需要用它再開始吧