Tự học HTML và CSS trong 1 giờ - part 19

Tham khảo tài liệu 'tự học html và css trong 1 giờ - part 19', công nghệ thông tin, đồ họa - thiết kế - flash phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | 156 LESSON 7 Formatting Text with HTML and CSS The catch here is that several units of measure are available. Perhaps the simplest is the percentage size relative to the current font size being used. So to make the font twice as large as it is currently just use the following p This text is normal sized and this text is span style font-size 200 twice that size span . p A number of length units are also available that you can use to specify the font size in absolute terms. I discuss the popular ones in Lesson 10. In the meantime just know that there are two kinds of length units relative units and absolute units. Relative units are sized based on the size of other elements on the page and based on the dots per inch setting of the user s display. Absolute units are sized based on some absolute reference. For example the pt point unit is measured in absolute pixels. To set your text to be exactly 12 pixels high the following specification is used p style font-size 12px This text is 12 pixels tall. p CAUTION__ One thing to watch out for When you specify units in CSS you must leave no spaces between the number of units and unit specification. In other words 12pt and 100 are valid and 12 pt and 100 aren t. You can do another thing with the font-size property that s not possible with the font tag specify line height. Let s say you want to use double-spaced text on your page. Before CSS the only way to achieve the effect was to use the br tag inside paragraphs to skip lines but this approach is fraught with peril. Depending on how the user has sized her browser window pages formatted using br in this manner can look truly awful. To set the line height using CSS you can include it in your font size specification like this font-size 100 200 . In this case the size of the font is 100 the default and the line height is 200 twice the standard line height. DON T Do list backup fonts when specifying a font family to make it more likely that your users will have one of the fonts .

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU MỚI ĐĂNG
25    80    2    29-04-2024
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.