week2.md - z22756392z/wp109b GitHub Wiki

第二周筆記

HTML Attribute

attribute的使用要用小寫 且 要加""在數值兩側

使用同樣attribute的項目 直接用逗號連接 ex:

<p style = "color:#ff0000; background-color : #00ff00;"> Hello </p>

image

<!DOCTYPE html>
<html>
<body>

<h2>The src Attribute</h2>
<p>HTML images are defined with the img tag, and the filename of the image source is specified in the src attribute:</p>

<img src="img_girl.jpg" width =" 200" heigh ="200" alt = "a girl with jacket">

</body>
</html>

style

<html>
<body>

<h2>The style Attribute</h2>
<p>The style attribute is used to add styles to an element, such as color:</p>

<p style="color:red;">This is a red paragraph.</p>
<p style="color:#ff0000;">This is a red paragraph.</p>

</body>
</html>

title

<!DOCTYPE html>
<h2 title = "This is the header"> I'm header </h2>
<body>
<p title = "This is the Paragraphs"> I'm Paragraphs </p>

</body>
</html>

Html Paragraphs

<!DOCTYPE html>
<html>
<h1>This is heading 1</h1>
<p>This is some text.</p>
<hr>

<h2>This is heading 2</h2>
<p>This is<br>a paragraph<br>with line breaks.</p>
<hr>

<h2>This is heading 2</h2>
<pre>H   E    
LL 
O~   This is 
   preformatted 
</pre>

</html>
⚠️ **GitHub.com Fallback** ⚠️