Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 145 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
145
Dung lượng
4,54 MB
Nội dung
[...]... … Third Title … The value of the rel attribute must be stylesheet andthe type must be text /css The href attribute indicates the location and name of the style sheet file The linked styles .css file contains the style definition: Take control of your web site's design using these pro CSS techniques! 6 TheCSS Anthology h1, h2 { font-family: sans-serif; color: #3366CC;... represent the state of the target elements, and is indicated by the colon (:) at the beginning Here are the commonly used pseudo-classes for links: ■ :link applies to unvisited links only, and specifies that they should be blue ■ :visited applies to visited links, and makes them magenta ■ :hover overrides the first two definitions by making links light blue when the cursor moves over them, whether they’ve... begin with the earlier chapters These will build on the knowledge you gained in this chapter to start you using and, I hope, enjoying CSS 3 http://reference.sitepoint.com /css/ specificity/ Take control of your web site's design using these pro CSS techniques! TheCSS Anthology (www.sitepoint.com) Chapter 2 Text Styling and Other Basics This chapter explores the applications of CSS for styling text and covers... when they’re clicked on The order in which you specify these pseudo-class selectors in your style sheet is important; because :active appears last, it overrides the first three selectors, so it Take control of your web site's design using these pro CSS techniques! 14 TheCSS Anthology will take effect regardless of whether the links have been visited or not, or whether the cursor is over them or not The. .. The only other possible origin for style sheets are user style sheets—custom styles written by the browser users and even these are overridden by the author style sheet except in rare circumstances Again, if you’d like to know more the SitePoint CSS Reference2 has a whole section about it The two parts of the cascade that will affect your daily CSS work the most are spe cificity and source order The. .. 1.1 Figure 1.1 The components of a CSS rule: a list of selectors and a declaration block Property declarations set the values for fonts, colors, and other settings that should be applied by the style The solutions throughout the book focus mainly on the different properties andthe values they can take Figure 1.1 also illustrates that a style rule can be written in a single line Some CSS authors prefer... font-size and nested elements Let’s say we wanted to set the font-size of the above text to 130% of the default size, and we made the mistake of setting it like so: chapter02/nesting .css (excerpt) div, p, em, a, code { font-size: 130%; } The effect of the above style rule is to the make the font-size of the nested elements progressively bigger—130% of the font-size of the parent element,... http://reference.sitepoint.com /css/ importantdeclarations/ http://reference.sitepoint.com /css/ cascade/ TheCSS Anthology (www.sitepoint.com) Making a Start with CSS 17 The four selectors above all match the paragraph element in the example HTML and set the text color What color will be applied to the paragraph? If you guessed #FF0000 or red, you’d be right The selectors p (any p element) and message (any element... you a taste of CSSand its usage at the most basic level We’ve even touched on the sometimes difficult concept of the cascade If you’re a newbie to CSS but have an understanding of the concepts discussed in this chapter, you should be able to start using the examples in this book The examples in the early chapters are simpler than those found near the end, so if you’ve yet to work with CSS, you might... essential to the layout of your page then I’d advise finding another way to target the element Pseudo-class Selectors for Links The formatting options available for links in HTML—created using thethe a, or anchor element—are more extensive than those on offer for most other elements CSS provides a way of setting link styles according to their state—if they’ve been visited or remain unvisited, if the .
Thank you for downloading these sample chapters of The CSS Anthology: 101 Es-
sential Tips, Tricks & Hacks, 3rd Edition, by Rachel Andrew, published by.
</html>
The value of the rel attribute must be stylesheet and the type must be text /css.
The href attribute indicates the location and name of the style