iT邦幫忙

0

Day 2 (html)

  • 分享至 

  • twitterImage
  •  

特別叮囑禁止的錯誤

1.不要行內包區塊

  • 行內:(inline) span
  • 區塊:(block) p ha div
    使用區塊包行內,雖然效果有時候會一樣
    但是不要行內包區塊

2.CSS相對應用法

(1). => class

        .opName
        {
            color: #AC915D;
        }

(2)XXX => < XXX >標籤

        table {
            border-collapse: collapse;
        }
<table>
    <tr>
        <th class="opName" colspan="4">跨4列</th>
    </tr>
    <tr>
        <td rowspan="2"><img src="./img/op_01.jpg" alt=""></td>
        <td class="opName">B1</td>
        <td rowspan="2"><img src="./img/op_02.jpg" alt=""></td>
        <td class="opName">D1</td>
    </tr>
    <tr>
        <td class="opText">B2</td>
        <td class="opText">D3</td>
    </tr>

    <tr>
        <td rowspan="2"><img src="./img/op_03.jpg" alt=""></td>
        <td class="opName">B3</td>
        <td rowspan="2"><img src="./img/op_04.jpg" alt=""></td>
        <td class="opName">D3</td>
    </tr>
    <tr>
        <td class="opText">B4</td>
        <td class="opText">D4</td>
    </tr>
</table>

(3)#=>id


<head>
    <style>
        span{
            color: red;
        }
        #g{
            color: green;
        }
        #b{
            color: blue;
        }

    </style>
</head>
<body>
    三原色有,
    <span style="color:red";>紅</span><span style="color:green";>綠</span><span style="color:blue";>藍</span>三種顏色
</body>

3.設定Tab

https://ithelp.ithome.com.tw/upload/images/20210524/20137684ezTgjjn7Fj.png
選擇空格4格比較好用


4.課後練習的發現

如果要使用同一個固定的路徑可以先把大路徑用base設在

<head>
        <base href="http://sheng.phy.nknu.edu.tw/shengwjs08MY/">
</head>

但是
1.如果此處放置#TOP會錯誤跑到前述網址+/#top

<a href="#top">到TOP</a>

2.注意不要放相對位置亦會錯誤

<a href="03-2.3.html">
    <p>大路徑的使用方式,配合<head></p>
    <a href="wjs-1305.htm">素材網01</a><br>
    <a href="wjs-1304.htm">素材網02</a>

圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言