At the top of the file you should also see a element, which is discussed next.
6. Open the page in your browser by pressing Ctrl+F5, or by right-clicking the page in the Solution
Explorer and choosing View in Browser.
How It Works
When you use the various Formatting toolbar buttons, like Foreground Color, VS inserts the appropriate
HTML and CSS code for you. For example, when you click the B button, VS inserts a pair of
tags around the selected text. When you click the I button, VS adds a pair of tags to
italicize the text. In this exercise, VS also inserted a class attribute (shown in the previous code example)
that points to a class called auto-style1 when you changed the text color. The code for this style
has been added to the top of your file and looks similar to this:
.auto-style1
{
color: #FF0000;
}
Your code may look slightly different if you chose a different color. The code you see here is
explained in the next chapter. For now, just remember that this code sets the color of the text it is
applied to as red. If the opening curly bracket is on the same line as the class, choose Tools Í Options
Í Text Editor Í CSS Í Formatting and set the Formatting Style to Expanded. This is just a matter of
preference and doesn’t change the effect of the code.
Note that VS replaced the apostrophe character (’) in “we’re” in the welcome message with its HTMLcompatible
variant: '. Using this kind of code enables you to insert characters in your page that
a browser may have trouble displaying, or that have special meaning within HTML itself, like the
ampersand character (&), which is written as &. When you type text in Design View, VS automatically
inserts the coded equivalents of relevant characters for you; however, if you type in Markup View
directly, you’ll have to do this yourself.
Don’t worry if your code looks different from what is shown here. Many settings in VS influence the
code that is generated for you.
So far, the exercises have been concerned with adding and styling text in your page. However, VS
enables you to insert other HTML elements as well, like tables and bullets. The next section shows
you how this works.
Adding Tables and Other Markup
HTML tables are great if you need to present structured or repeating data, like a list of products in
a shopping cart, photos in a photo album, or input controls in a form. There is a lot of debate on
the Internet about whether you should use tables to lay out your page as well. For example, if your
page contains a header with a logo, a main content area, and a footer at the bottom, you could use a
table with three rows to accomplish this. In general, it’s considered bad practice to use tables for this
purpose because they add a lot of extraneous markup to the page and are often difficult to maintain.
Besides, quite often the same result can be accomplished using CSS, which you learn about in
the next chapter. Despite the disadvantages that tables may bring, they are still an invaluable asset in
your HTML toolbox when it comes to displaying tabular or otherwise structured information.
ที่ด้านบนของแฟ้ม คุณควรดู element, which is discussed next.
6. Open the page in your browser by pressing Ctrl+F5, or by right-clicking the page in the Solution
Explorer and choosing View in Browser.
How It Works
When you use the various Formatting toolbar buttons, like Foreground Color, VS inserts the appropriate
HTML and CSS code for you. For example, when you click the B button, VS inserts a pair of
tags around the selected text. When you click the I button, VS adds a pair of tags to
italicize the text. In this exercise, VS also inserted a class attribute (shown in the previous code example)
that points to a class called auto-style1 when you changed the text color. The code for this style
has been added to the top of your file and looks similar to this:
.auto-style1
{
color: #FF0000;
}
รหัสของคุณอาจดูแตกต่างกันเล็กน้อยถ้าคุณเลือกสีที่แตกต่างกัน รหัสที่คุณเห็นที่นี่อธิบายในบทถัดไป สำหรับตอนนี้ เพียงแค่จำว่า รหัสนี้ตั้งค่าสีของข้อความที่เป็นใช้จะเป็นสีแดง ถ้าวงเล็บหยักเปิดอยู่บรรทัดเดียวกับคลาส เลือกตัวเลือกปริมาณคงเหลือของเครื่องมืออัพแก้ไขอัพ CSS อัพรูปและกำหนดลักษณะรูปแบบที่จะขยาย นี้เป็นเพียงเรื่องของชอบ และไม่เปลี่ยนแปลงผลของรหัสหมายเหตุว่า VS แทนอักขระเครื่องหมายอัญประกาศเดี่ยว (') ใน "เรา" ในข้อความต้อนรับของ HTMLcompatibleตัวแปร: ' ใช้รหัสชนิดนี้ช่วยให้คุณสามารถแทรกอักขระในเพจของคุณที่เบราว์เซอร์อาจมีปัญหาในการแสดง หรือที่มีความหมายพิเศษใน HTML เอง ต้องการเครื่องหมาย ampersand อักขระ (&), ซึ่งเขียนเป็นและการ เมื่อคุณพิมพ์ข้อความในมุมมองออกแบบ VS โดยอัตโนมัติแทรกเทียบเท่ารหัสอักขระที่เกี่ยวข้องสำหรับคุณ อย่างไรก็ตาม ถ้าคุณพิมพ์ในมุมมองมาร์กอัปโดยตรง คุณจะต้องทำนี้เองไม่ต้องกังวลถ้ารหัสของคุณดูแตกต่างจากสิ่งที่จะแสดงที่นี่ การตั้งค่าต่าง ๆ ใน VS อิทธิพลรหัสที่สร้างขึ้นสำหรับคุณเพื่อห่างไกล ออกกำลังกายมีการเกี่ยวข้องกับเพิ่มและแต่งข้อความในเพจของคุณ อย่างไรก็ตาม VSช่วยให้คุณสามารถแทรกองค์ประกอบ HTML อื่น ๆ เช่น เช่นตารางและกระสุน แสดงหัวข้อถัดไปคุณวิธีการนี้ทำงานเพิ่มตารางและมาร์กอัปอื่น ๆตาราง HTML ดีถ้าคุณต้องการนำเสนอโครงสร้าง หรือทำซ้ำข้อมูล เช่นรายการของผลิตภัณฑ์ในตะกร้าช้อปปิ้ง อัลบั้มรูปภาพ หรือควบคุมป้อนข้อมูลในฟอร์ม มีอยู่มากมายของการอภิปรายอินเทอร์เน็ตว่าคุณควรใช้ตารางเพื่อจัดเค้าโครงของหน้าและ ตัวอย่าง ถ้าคุณประกอบด้วยส่วนหัวที่ มีโลโก้ พื้นที่เนื้อหาหลัก และส่วนท้ายที่ด้านล่าง คุณสามารถใช้การตารางที่ มีแถวที่สามจะทำ ทั่วไป ถือว่าปฏิบัติไม่ถูกต้องจะใช้ตารางนี้วัตถุประสงค์เนื่องจากพวกเขาเพิ่มมากของมาร์กอัปที่ไม่เกี่ยวข้องกับหน้า และมักยากที่จะรักษานอกจาก ค่อนข้างบ่อยผลลัพธ์เดียวกันนี้สามารถทำได้โดยใช้ CSS ที่คุณได้เรียนรู้เกี่ยวกับในบทถัดไป แม้ มีข้อเสียที่ตารางอาจนำ พวกเขาจะยังคงเป็นสินทรัพย์ที่ล้ำค่าในของ HTML กล่องเครื่องมือเมื่อมันมาถึงการแสดงข้อมูลโครงสร้างตาราง หรืออื่น ๆ
การแปล กรุณารอสักครู่..

ที่ด้านบนของไฟล์ที่คุณควรจะดูรหัสของคุณอาจจะดูแตกต่างกันเล็กน้อยถ้าคุณเลือกสีที่แตกต่าง รหัสที่คุณเห็นนี่จะอธิบายในบทต่อไป สำหรับตอนนี้เพียงแค่จำไว้ว่ารหัสนี้ตั้งค่าสีของข้อความที่มันจะถูกนำไปใช้เป็นสีแดง ถ้าเปิดปีกกาอยู่ในสายเดียวกับระดับให้เลือกตัวเลือกเครื่องมือÍÍแก้ไขข้อความÍÍ CSS การจัดรูปแบบและการตั้งค่ารูปแบบการจัดรูปแบบการขยายตัว นี่เป็นเพียงเรื่องของการตั้งค่าและไม่มีการเปลี่ยนแปลงผลของรหัส. โปรดทราบว่า VS แทนที่ตัวอักษร apostrophe (') ใน "เรา" ในที่มีข้อความต้อนรับ HTMLcompatible ที่แตกต่าง: ใช้ชนิดของรหัสนี้ช่วยให้คุณสามารถแทรกตัวอักษรในหน้าเว็บของคุณที่เบราว์เซอร์อาจมีปัญหาในการแสดงหรือว่ามีความหมายพิเศษภายใน HTML ของตัวเองเช่นเดียวกับตัวละครที่เครื่องหมาย(&) ซึ่งเขียนเป็นและ เมื่อคุณพิมพ์ข้อความในมุมมองออกแบบ, VS อัตโนมัติแทรกเทียบเท่ารหัสของตัวละครที่เกี่ยวข้องสำหรับคุณ แต่ถ้าคุณพิมพ์ในมาร์กอัปดูโดยตรงคุณจะต้องทำด้วยตัวเอง. ไม่ต้องกังวลถ้ารหัสของคุณมีลักษณะแตกต่างจากสิ่งที่จะแสดงที่นี่ การตั้งค่าต่างๆใน VS มีอิทธิพลต่อรหัสที่สร้างขึ้นสำหรับคุณ. เพื่อให้ห่างไกลการออกกำลังกายที่ได้รับการที่เกี่ยวข้องกับการเพิ่มและข้อความจัดแต่งทรงผมของคุณในหน้า อย่างไรก็ตาม VS ช่วยให้คุณเพิ่มองค์ประกอบ HTML อื่น ๆ เช่นกันเช่นตารางและกระสุน ส่วนถัดไปจะแสดงให้คุณเห็นวิธีการทำงานนี้. เพิ่มตารางและมาร์กอัปอื่น ๆตาราง HTML ที่ดีถ้าคุณต้องการที่จะนำเสนอโครงสร้างหรือการทำซ้ำข้อมูลเช่นรายการสินค้าในตะกร้าสินค้า, ภาพในอัลบั้มภาพหรือควบคุมการนำเข้าในรูปแบบ . มีจำนวนมากของการอภิปรายเกี่ยวกับเป็นอินเทอร์เน็ตเกี่ยวกับว่าคุณควรจะใช้ตารางที่จะออกวางหน้าเว็บของคุณได้เป็นอย่างดี ตัวอย่างเช่นถ้าคุณหน้ามีส่วนหัวที่มีโลโก้เป็นพื้นที่เนื้อหาหลักและส่วนท้ายที่ด้านล่างคุณสามารถใช้ตารางที่มีสามแถวที่จะบรรลุนี้ โดยทั่วไปก็ถือว่าการปฏิบัติที่ดีที่จะใช้ตารางในการนี้เพื่อจุดประสงค์เพราะพวกเขาเพิ่มมากมาร์กอัปภายนอกไปที่หน้าและมักจะยากที่จะรักษา. นอกจากนี้ค่อนข้างบ่อยผลเดียวกันสามารถทำได้โดยใช้ CSS ที่คุณได้เรียนรู้เกี่ยวกับในบทต่อไป แม้จะมีข้อเสียที่อาจนำตารางพวกเขายังคงเป็นสินทรัพย์ที่ทรงคุณค่าในกล่องเครื่องมือ HTML ของคุณเมื่อมันมาถึงการแสดงตารางหรือข้อมูลที่มีโครงสร้างเป็นอย่างอื่น element, which is discussed next.
6. Open the page in your browser by pressing Ctrl+F5, or by right-clicking the page in the Solution
Explorer and choosing View in Browser.
How It Works
When you use the various Formatting toolbar buttons, like Foreground Color, VS inserts the appropriate
HTML and CSS code for you. For example, when you click the B button, VS inserts a pair of
tags around the selected text. When you click the I button, VS adds a pair of tags to
italicize the text. In this exercise, VS also inserted a class attribute (shown in the previous code example)
that points to a class called auto-style1 when you changed the text color. The code for this style
has been added to the top of your file and looks similar to this:
.auto-style1
{
color: #FF0000;
}
การแปล กรุณารอสักครู่..
