• Complain

Eric A. Meye - Selectors, Specificity, and the Cascade

Here you can read online Eric A. Meye - Selectors, Specificity, and the Cascade full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. year: 2012, publisher: OReilly Media, genre: Computer. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

Eric A. Meye Selectors, Specificity, and the Cascade
  • Book:
    Selectors, Specificity, and the Cascade
  • Author:
  • Publisher:
    OReilly Media
  • Genre:
  • Year:
    2012
  • Rating:
    3 / 5
  • Favourites:
    Add to favourites
  • Your mark:
    • 60
    • 1
    • 2
    • 3
    • 4
    • 5

Selectors, Specificity, and the Cascade: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "Selectors, Specificity, and the Cascade" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

Exactly how does the cascade in Cascading Style Sheets work? This concise guide demonstrates the power and simplicity of CSS selectors for applying style rules to different web page elements. Youll learn how your pages presentation depends on a multitude of style rules and the complex ways they functionand sometimes collidewithin the documents structure.

This guide is a chapter from the upcoming fourth edition of CSS: The Definitive Guide. When you purchase either the print or the ebook edition of Selectors, Specificity, and the Cascade, youll receive a significant discount on the entire Definitive Guide when its released. Why wait when you can learn how to use selectors and other key CSS 3 features right away?

  • Learn how to create CSS rules that apply to a large number of similar elements
  • Group rules to make style sheets smaller and download times faster
  • Understand how elements inherit styles from their parents
  • Discover how reader and browser preferences affect your page presentation
  • Examine specificitythe method browsers use to choose between two conflicting style rules
  • Get a handle on how specificity and inheritance combine to form the cascade
  • Get details on all of the CSS3 selectors

Eric A. Meye: author's other books


Who wrote Selectors, Specificity, and the Cascade? Find out the surname, the name of the author of the book and a list of all author's works by series.

Selectors, Specificity, and the Cascade — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "Selectors, Specificity, and the Cascade" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make
CSS: The Definitive Guide."/>
Selectors, Specificity, and the Cascade
Eric A. Meyer
Published by OReilly Media

Beijing Cambridge Farnham Kln Sebastopol Tokyo Preface Conventions Used in - photo 1

Beijing Cambridge Farnham Kln Sebastopol Tokyo

Preface
Conventions Used in This Book

The following typographical conventions are used in this book:

Italic

Indicates new terms, URLs, email addresses, filenames, and file extensions.

Constant width

Used for program listings, as well as within paragraphs to refer to program elements such as variable or function names, databases, data types, environment variables, statements, and keywords.

Constant width bold

Shows commands or other text that should be typed literally by the user.

Constant width italic

Shows text that should be replaced with user-supplied values or by values determined by context.

Tip

This icon signifies a tip, suggestion, or general note.

Caution

This icon indicates a warning or caution.

Using Code Examples

This book is here to help you get your job done. In general, you may use the code in this book in your programs and documentation. You do not need to contact us for permission unless youre reproducing a significant portion of the code. For example, writing a program that uses several chunks of code from this book does not require permission. Selling or distributing a CD-ROM of examples from OReilly books does require permission. Answering a question by citing this book and quoting example code does not require permission. Incorporating a significant amount of example code from this book into your products documentation does require permission.

We appreciate, but do not require, attribution. An attribution usually includes the title, author, publisher, and ISBN. For example: Selectors, Specificity, and the Cascade by Eric A. Meyer (OReilly). Copyright 2012 OReilly Media, Inc., 978-1-449-34249-4.

If you feel your use of code examples falls outside fair use or the permission given above, feel free to contact us at .

Safari Books Online
Note

Safari Books Online (www.safaribooksonline.com) is an on-demand digital library that delivers expert content in both book and video form from the worlds leading authors in technology and business.

Technology professionals, software developers, web designers, and business and creative professionals use Safari Books Online as their primary resource for research, problem solving, learning, and certification training.

Safari Books Online offers a range of product mixes and pricing programs for organizations, government agencies, and individuals. Subscribers have access to thousands of books, training videos, and prepublication manuscripts in one fully searchable database from publishers like OReilly Media, Prentice Hall Professional, Addison-Wesley Professional, Microsoft Press, Sams, Que, Peachpit Press, Focal Press, Cisco Press, John Wiley & Sons, Syngress, Morgan Kaufmann, IBM Redbooks, Packt, Adobe Press, FT Press, Apress, Manning, New Riders, McGraw-Hill, Jones & Bartlett, Course Technology, and dozens more. For more information about Safari Books Online, please visit us online.

How to Contact Us

Please address comments and questions concerning this book to the publisher:

OReilly Media, Inc.
1005 Gravenstein Highway North
Sebastopol, CA 95472
800-998-9938 (in the United States or Canada)
707-829-0515 (international or local)
707-829-0104 (fax)

We have a web page for this book, where we list errata, examples, and any additional information. You can access this page at http://oreil.ly/selector-specificity-cascade.

To comment or ask technical questions about this book, send email to .

For more information about our books, courses, conferences, and news, see our website at http://www.oreilly.com.

Find us on Facebook: http://facebook.com/oreilly

Follow us on Twitter: http://twitter.com/oreillymedia

Watch us on YouTube: http://www.youtube.com/oreillymedia

Chapter 1. Selectors

One of the primary advantages of CSSparticularly to designersis its ability to easily apply a set of styles to all elements of the same type. Unimpressed? Consider this: by editing a single line of CSS, you can change the colors of all your headings. Dont like the blue youre using? Change that one line of code, and they can all be purple, yellow, maroon, or any other color you desire. That lets you, the designer, focus on design, rather than grunt work. The next time youre in a meeting and someone wants to see headings with a different shade of green, just edit your style and hit Reload. Voil! The results are accomplished in seconds and there for everyone to see.

Of course, CSS cant solve all your problemsyou cant use it to change the colorspace of your PNGs, for example, at least not yetbut it can make some global changes much easier. So lets begin with selectors and structure.

Basic Style Rules

As stated, a central feature of CSS is its ability to apply certain rules to an entire set of element types in a document. For example, lets say that you want to make the text of all h2 elements appear gray. Using old-school HTML, youd have to do this by inserting ... tags in all your h2 elements:

This is h2 text

Obviously, this is a tedious process if your document contains a lot of h2 elements. Worse, if you later decide that you want all those h2s to be green instead of gray, youd have to start the manual tagging all over again. (Yes, this is really how it used to be done!)

CSS allows you to create rules that are simple to change, edit, and apply to all the text elements you define (the next section will explain how these rules work). For example, simply write this rule once to make all your h2 elements gray:

h2 {color: gray;}

If you want to change all h2 text to another colorsay, silversimply alter the value:

h2 {color: silver;}
Element Selectors

An element selector is most often an HTML element, but not always. For example, if a CSS file contains styles for an XML document, element selectors might look something like this:

QUOTE {color: gray;}BIB {color: red;}BOOKTITLE {color: purple;}MYElement {color: red;}

In other words, the elements of the document serve as the most basic selectors. In XML, a selector could be anything, since XML allows for the creation of new markup languages that can have just about anything as an element name. If youre styling an HTML document, on the other hand, the selector will generally be one of the many HTML elements such as p, h3, em, a, or even html itself. For example:

html {color: black;}h1 {color: gray;}h2 {color: silver;}

The results of this style sheet are shown in .

Figure 1-1 Simple styling of a simple document Once youve globally applied - photo 2

Figure 1-1. Simple styling of a simple document

Once youve globally applied styles directly to elements, you can shift those styles from one element to another. Lets say you decide that the paragraph text, not the

Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «Selectors, Specificity, and the Cascade»

Look at similar books to Selectors, Specificity, and the Cascade. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «Selectors, Specificity, and the Cascade»

Discussion, reviews of the book Selectors, Specificity, and the Cascade and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.