Creating Cool Web Sites with HTML, XHTML, and CSS- P3
Số trang: 50
Loại file: pdf
Dung lượng: 2.02 MB
Lượt xem: 10
Lượt tải: 0
Xem trước 5 trang đầu tiên của tài liệu này:
Thông tin tài liệu:
Creating Cool Web Sites with HTML, XHTML, and CSS- P3: This book walks readers through the process of creating a basic Web site from scratch using HMTL, the basis for billions of Web pages, and then jazzing it up with advanced techniques from the author’s award-winning sites. This updated edition features new material that shows readers how to attract visitors to a site and keep them there, including new JavaScript examples and coverage of cascading style sheets and XHTML, technologies that make building successful Web sites even easier...
Nội dung trích xuất từ tài liệu:
Creating Cool Web Sites with HTML, XHTML, and CSS- P3 74 Creating Cool Web Sites with HTML, XHTML, and CSS The effects of both word and line spacing are shown in Figure 4-7. Figure 4-7: Word and line spacing can dramatically change the way text looks on a page. Not all possible settings are good, of course. A line height that’s too small results in the lines of text becoming illegible as they’re overlapped. The single addition of line-height: 1.25, however, can significantly improve the appearance of a page, and you can increase line height for the entire document by changing the style of the body tag. Adding the following code to the top block changes all the text on the page: body { line-height: 1.25 } Cool, eh? I tweak the body container again and again as I proceed. It’s very useful! Text alignment HTML includes some attributes for the tag that let you specify if you want the text to be left, center, or right aligned, or justified, where both the left and right margins are aligned. These attributes are replaced in CSS with the text-align style, which has the following possible values: • left • right • center • justify Vertical text alignment Here’s one feature that you don’t see in HTML except in the exceptionally awkward form of and for superscripts and subscripts, respectively. Instead, use vertical-align and pick one of the values shown in Table 4-3.Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. Chapter 4: Moving into the 21st Century with Cascading Style Sheets 75 Table 4.3: CSS Vertical Alignment Values Value Explanation top Specifies that top of element aligns with top of highest element in line middle Specifies that middle of element aligns with middle of line bottom Specifies that bottom of element aligns with bottom of lowest element in line text-top Specifies that top of element aligns with top of highest text element in line text-bottom Specifies that bottom of element aligns with bottom of lowest text element in line super Indicates superscript sub Indicates subscript A nice demonstration of this capability is a technique for having trademark (tm) character sequences displayed attractively on a page: .tm { vertical-align: top; font-size: 33%; font-weight: bold; } In use, this might appear as Though just about lost to common parlance, it remains the case that Xeroxtm is a trademark of Xerox Corporation. Text decorations One HTML text decoration that, surprisingly, made it to CSS is underlining. As discussed in Chapter 3, underlining text on a Web page is somewhat problematic because it can become quite difficult to differentiate links from underlined text. But the CSS text-decoration style enables more than just underlining. It provides the following four values: • underline • overline • line-through • blink With the exception of overline, these all have HTML equivalents: for underline, for line-through, and for blink. In CSS, however, it’s much easier to apply a number of them simultaneously, like this: h1 { text-decoration: overline underline; } By using the underlining styles, you can rather dramatically change the appearance of head ers throughout a document.Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. 76 Creating Cool Web Sites with HTML, XHTML, and CSS Changing text case This is the last new CSS style for this chapter, I promise. I know that this chapter must seem like quite a monster with all this thrown at you at once! That’s why it’s incredibly important that you try things on your computer as you read about them. If you just sip your latté while you go through this book, your retention is likely to be minimal. But if you’re trying each and every style and example on your computer, you’ll have lots of “a ha!” moments, and you should start to see the tremendous value of CSS for even the most rudimentary pages. Don’t forget, all the code listing ...
Nội dung trích xuất từ tài liệu:
Creating Cool Web Sites with HTML, XHTML, and CSS- P3 74 Creating Cool Web Sites with HTML, XHTML, and CSS The effects of both word and line spacing are shown in Figure 4-7. Figure 4-7: Word and line spacing can dramatically change the way text looks on a page. Not all possible settings are good, of course. A line height that’s too small results in the lines of text becoming illegible as they’re overlapped. The single addition of line-height: 1.25, however, can significantly improve the appearance of a page, and you can increase line height for the entire document by changing the style of the body tag. Adding the following code to the top block changes all the text on the page: body { line-height: 1.25 } Cool, eh? I tweak the body container again and again as I proceed. It’s very useful! Text alignment HTML includes some attributes for the tag that let you specify if you want the text to be left, center, or right aligned, or justified, where both the left and right margins are aligned. These attributes are replaced in CSS with the text-align style, which has the following possible values: • left • right • center • justify Vertical text alignment Here’s one feature that you don’t see in HTML except in the exceptionally awkward form of and for superscripts and subscripts, respectively. Instead, use vertical-align and pick one of the values shown in Table 4-3.Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. Chapter 4: Moving into the 21st Century with Cascading Style Sheets 75 Table 4.3: CSS Vertical Alignment Values Value Explanation top Specifies that top of element aligns with top of highest element in line middle Specifies that middle of element aligns with middle of line bottom Specifies that bottom of element aligns with bottom of lowest element in line text-top Specifies that top of element aligns with top of highest text element in line text-bottom Specifies that bottom of element aligns with bottom of lowest text element in line super Indicates superscript sub Indicates subscript A nice demonstration of this capability is a technique for having trademark (tm) character sequences displayed attractively on a page: .tm { vertical-align: top; font-size: 33%; font-weight: bold; } In use, this might appear as Though just about lost to common parlance, it remains the case that Xeroxtm is a trademark of Xerox Corporation. Text decorations One HTML text decoration that, surprisingly, made it to CSS is underlining. As discussed in Chapter 3, underlining text on a Web page is somewhat problematic because it can become quite difficult to differentiate links from underlined text. But the CSS text-decoration style enables more than just underlining. It provides the following four values: • underline • overline • line-through • blink With the exception of overline, these all have HTML equivalents: for underline, for line-through, and for blink. In CSS, however, it’s much easier to apply a number of them simultaneously, like this: h1 { text-decoration: overline underline; } By using the underlining styles, you can rather dramatically change the appearance of head ers throughout a document.Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. 76 Creating Cool Web Sites with HTML, XHTML, and CSS Changing text case This is the last new CSS style for this chapter, I promise. I know that this chapter must seem like quite a monster with all this thrown at you at once! That’s why it’s incredibly important that you try things on your computer as you read about them. If you just sip your latté while you go through this book, your retention is likely to be minimal. But if you’re trying each and every style and example on your computer, you’ll have lots of “a ha!” moments, and you should start to see the tremendous value of CSS for even the most rudimentary pages. Don’t forget, all the code listing ...
Tìm kiếm theo từ khóa liên quan:
lập trình web nhập môn lập trình ngôn ngữ lập trình html phương pháp lập trình lập trình CSSGợi ý tài liệu liên quan:
-
Đề cương chi tiết học phần Cấu trúc dữ liệu và giải thuật (Data structures and algorithms)
10 trang 309 0 0 -
Giáo trình Lập trình logic trong prolog: Phần 1
114 trang 183 0 0 -
Giáo trình Lập trình C căn bản: Phần 1
64 trang 165 0 0 -
Giáo trình Lập trình C căn bản
135 trang 156 0 0 -
Bài giảng Nhập môn về lập trình - Chương 1: Giới thiệu về máy tính và lập trình
30 trang 154 0 0 -
Giáo trình nhập môn lập trình - Phần 22
48 trang 136 0 0 -
14 trang 132 0 0
-
[Thảo luận] Học PHP như thế nào khi bạn chưa biết gì về lập trình?
5 trang 130 0 0 -
161 trang 129 1 0
-
Giáo trình lập trình hướng đối tượng - Lê Thị Mỹ Hạnh ĐH Đà Nẵng
165 trang 111 0 0