HTML5 and CSS: 21-30
21 Link to External Pages with Anchor Elements
Anchor Element
<a>錨點<a href="http://freecatphotoapp.com">cat photos</a>
<link href="https://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
.red-text {
color: red;
}
h2 {
font-family: Lobster, Monospace;
}
p {
font-size: 16px;
font-family: Monospace;
}
.thick-green-border {
border-color: green;
border-width: 10px;
border-style: solid;
border-radius: 50%;
}
.smaller-image {
width: 100px;
}
</style>
<h2 class="red-text">CatPhotoApp</h2>
<img class="smaller-image thick-green-border" src="https://bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying on its back. ">
<a href="http://freecatphotoapp.com">cat photos</a>
<p class="red-text">Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
<p class="red-text">Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>22 - Nest an Anchor Element within a Paragraph
例子
作業
23 - Make Dead Links using the Hash Symbol
不想那麼早放上連結,就用
#井字號代替
24 - Turn an Image into a Link
25 - Create a Bulleted Unordered List
26 - Create an Ordered List
27 - Create a Text Field
原來建立輸入方塊這麼簡單 @@
<input type="text">
28 - Add Placeholder Text to a Text Field
能預先顯示佔位符,當作預先定義文本
<input type="text" placeholder=" cat photo URL">
29 - Create a Form Element
能夠傳送表單,
action定義傳送的方式像範例,回車後,會傳送一個網址
30 - Add a Submit Button to a Form
透過 button 的 type="submit",點擊 button 後,可以將資料透過 form 的 acton="path",傳送到某個位址上
Submit
Last updated
Was this helpful?