Witten
Bainbridge
Nichols
HOME HELP PREFERENCES SEARCHFIGURESTABLES

Context-sensitive CSS example

/* Contextual Cascading Style Sheet instructions for UN Example */
@import url("un_basic.css");
Agency > Photo[desc]:before  { content: "Available: " attr(desc) }
Body Photo[desc="A photo"]   { display: none }
Agency + Agency              { color: red;
                               background: #ffa080 }
Name[hq="Rome, Italy"]       { background: rgb(%0,%50,%0); 
                               color: rgb(255,160,80) }
Agency                       { font-size: 20pt; }

Figure 4.12a: Context-sensitive CSS example; CSS style sheet illustrating context-sensitive formatting