|
ต่อจากนี้เป็นตัวอย่างที่ขึ้นบรรทัดใหม่โดยใช้แท็ก <br> |
<!DOCTYPE html>
<html>
<head>
<title> Line break Tag </title>
</head>
<body>
The code within an HTML file consists of text surrounded by tags.
these tags indicate where the formatting should be applied, how the
layout should appear, what pictures should be placed in certain
locations, and more. <br>
For example, suppose you wanted a certain word to be italicized,
like this: <br>
Everything in on sale.
</body>
</html> |
ผลที่ได้บนเว็บเบราว์เซอร์ |
ถูกตัดขึ้นบรรทัดใหม่
>>
>>
|
|
1.3 การยกเลิกการตัดคำ (No Break Rule) |
โดยปกติโปรแกรมเบราว์เซอร์จะแสดงเอกสาร HTML โดยจะทำการตัดคำเพื่อจัดข้อความให้พอดี
กับการปรับเปลี่ยน
ขนาดของหน้าต่างโปรแกรม
โดยที่เราไม่ต้องใช้แถบเลื่อนหน้าจอ (Scroll Bar)
เลื่อนหน้าจอไปดูแต่ละส่วนของข้อความ
แต่ถ้าเราต้องการจะยกเลิกการตัดคำโดยอัตโนมัติดังกล่าวนี้ ให้ใช้คำสั่งนี้
รูปแบบ |
ตัวอย่างการยกเลิกการตัดคำในโปรแกรมเว็บเบราว์เซอร์ |
<!DOCTYPE html>
<html>
<head>
<title > Line break Tag </title>
</head>
<body>
<nobr>
The code within an THML file consists of text surrounded by tags.
these tags indicate where the formatting should be applied, how
the layout should appear, what pictures should pleaced in
certain location, and more.
</nobr>
<br>
For example, suppose you wanted a certain word to be italicized,
like this: <br>
Everything in on sale.
</body>
</html> |
|
ผลที่ได้บนเว็บเบราว์เซอร์ |
จากตัวอย่างให้สังเกตว่าที่ย่อหน้าแรก (The code…) ข้อความจะถูกพิมพ์ล้นหน้าต่างของเบราว์เซอร์
เนื่องจากมีการใช้แท็ก <nobr> ยกเลิการตัดคำเพื่อปรับข้อความตามขนาดของหน้าต่างโปรแกรม นอกจากนี้
ยังปรากฏแถบเลื่อน (Scroll bar) ที่ด้านล่างของหน้าต่าง
จากย่อหน้าที่สอง (For example…) ย่อหน้านี้ไม่ได้ใช้แท็ก <nobr> เพื่อยกเลิกการปรับข้อความ
ตามขนาดของหน้าต่าง เพียงแต่ใช้เท็ก <br> ขอขึ้นบรรทัดใหม่เพื่อย่อหน้าใหม่ ข้อความของย่อหน้านี้
ยังคงมีการตัดคำเพื่อปรับข้อความให้พอดีกับหน้าต่างโปรแกรม |
|
|