Sams Teach Yourself CSS in 24 Hours- P2

Sams Teach Yourself CSS in 24 Hours- P2: Times have changed, thankfully, since those Dark Ages of CSS. All major browsers as well as some minor ones have increased support for Cascading Style Sheets in the latest versions. Web developers are aware of CSS and the vital role they play in designing great Web pages, and presumably you’ve got some idea of how important they are if you’ve bought this book. | 32 Hour 2 If the name of the font family has more than one word enclose it in quotes. Here are some examples of CSS rules using font-family body font-family Arial sans-serif hi font-family Courier New monospace h2 font-family Times New Roman serif You ll learn more about font families and how to use them in Hour 8. A Simple Style Sheet Using just the simple properties and values you ve learned so far this hour you already can create a basic style sheet an example of a complete style sheet is shown in Listing . Listing A Basic Style Sheet with Color Size and Font Declarations Written by Kynn Bartlett kynn@ body font-family Arial color black background-color white I think Verdana looks nice for headlines hi h2 h3 h4 h5 h6 font-family Verdana sans-serif This puts the second level heading in red h2 color red address font-family Verdana sans-serif font-size smaller You can find a copy of this style sheet on the Web at http 02 . Linking a Style Sheet to an HTML Page A style sheet by itself doesn t really do anything except sit there on your hard drive or Web server. If you try to load it in your browser it will just display as plain text. To actually use the CSS rules you need to have a file with markup such as an HTML page and you need to add an HTML tag to link the CSS file to the Web page. A Simple HTML Page for Styling Listing shows the structure of a basic HTML page like one you might find on the Web it has headlines paragraphs horizontal rules and even a little table on the side. You Getting Started with CSS 33 can download a copy of this file from http 02 because that s easier than typing in the whole thing. Listing A Simple HTML File That Needs Styling -- -- html head title Review - The Lord of the Rings Fellowship of the Ring title head body h1 Movie Review h1 table border 1 align right tr th colspan 2 Rating Scale th tr tr td One td td Not .

Không thể tạo bản xem trước, hãy bấm tải xuống
TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
Đã 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.