Search Options
close
Search the following clips:
All Clips
news
science
politics
food
economy
art
technology
health
internet
religion
psychology
Sign Up
Install
Learn More
Login
CSS Adjacent Sibling Selectors
CyanSmoker
follow
0
3-23-2008 3:53 AM
263 views
tags:
css
Add a Comment
Login
to Comment. Not a member yet?
Sign up
Today's Top Clips
Red Kidney Bean Poisoning
The Plague of Eyam: The Village That Died To Save Its Neighbors
Operation, the Human Body, and 15 things you didn't know [INFOGRAPHIC]
7 Writing Mistakes that Make Me Want to Kill You
What being an American means to me
Clipmarks and Webmynd - Clipping Issue - FYI
Why Won’t the MSM Cover Islam? What Are They Afraid Of?
Ireland: Harshest Winter Weather in over 30 years
Kindness of a Stranger: Stranded Elderly Woman Meets Shiny-Shoed Stranger
The Happiest People
visit the
Top Clips page
View the Top Clips from
March 23, 2008
Embed This Clip In Your Site...
<div style="margin: 12px 0px; font-family: arial; color: #333333; background: #ffffff; border: solid 4px #e5e5e5; width: 100%; clear: left;"><div class="CM_CTB_Content_Wrap" style="margin: 0px; padding: 0px;background-color: #ffffff;"><div style="border-bottom: solid 1px #dcdcdc; white-space: nowrap; margin-bottom: 8px; background-color: #eeeeee ;background-image: url(http://clipmarks.com/images/source-bg.gif); background-repeat: repeat-x; height: 24px; line-height: 24px; vertical-align: middle; padding-bottom: 4px; color: #666666; font-size: 10px;" ><a href="http://clipmarks.com/clip-to-blog/" title="see clips that are hot right now"><img src="http://content.clipmarks.com/blog_embed/3480c7a7-f451-4b63-a476-7f2b8601c072/AADF8C33-5184-49A6-9F45-D91C2895A846/" alt="" width="19" height="19" border="0" style="vertical-align: middle; margin: 0px 4px; display: inline; border: none; float:none;" /></a>clipped from <a title="http://eriwen.com/css/css-adjacent-sibling-selectors/" href="http://eriwen.com/css/css-adjacent-sibling-selectors/" style="font-size: 11px;">eriwen.com</a></div><blockquote style="text-align: left; padding: 0px 8px; margin: 4px 0px 8px 0px; background: transparent; border: none;" cite="http://eriwen.com/css/css-adjacent-sibling-selectors/"><P>Among the types of <ACRONYM title="Cascading Style Sheets">CSS</ACRONYM> selectors, one that is often overlooked is the <A href="http://www.w3.org/TR/REC-CSS2/selector.html#adjacent-selectors">CSS Adjacent Selector</A>.</p> <BLOCKQUOTE><P>Adjacent sibling selectors have the following syntax: E1 + E2, where E2 is the subject of the selector. The selector matches if E1 and E2 share the same parent in the document tree and E1 immediately precedes E2.</P></BLOCKQUOTE> <H4>The CSS code</H4> <DIV class="dp-highlighter"><DIV class="bar"><DIV class="tools"><A href="#">view plain</A><A href="#">copy to clipboard</A><A href="#">print</A><A href="#">?</A></DIV></DIV><OL start="1" class="dp-css"><LI class="alt"><DIV class="alt"><SPAN>h</SPAN><SPAN class="value">4</SPAN><SPAN> + p { </SPAN></DIV></LI><LI class=""><DIV class=""> <SPAN class="keyword">font-weight</SPAN><SPAN>: </SPAN><SPAN class="value">bold</SPAN><SPAN>; </SPAN></DIV></LI><LI class="alt"><DIV class="alt"> <SPAN class="keyword">color</SPAN><SPAN>: </SPAN><SPAN class="value">#FFFFFF</SPAN><SPAN>; </SPAN></DIV></LI><LI class=""><DIV class="">} </DIV></LI></OL></DIV><PRE class="syntax-highlight:css">h4 + p { font-weight: bold; color: #FFFFFF; } </PRE> <P>The text below is a simple example of the above code:</p> <H4 class="example">This is normal heading 4 text</H4> <P>This is the <p> after the heading. It should be bold and white.</P></blockquote></div><div style="margin: 0px 6px 6px 4px;"><table style="font-size: 11px;border-spacing: 0px;padding: 0px;" cellpadding="0" cellspacing="0" width="100%"><tr><td style="background:transparent;border-width:0px;padding:0px;"> </td><td align="right" style="background:transparent;border-width:0px;padding:0px;width:107px" width="107"><a href="http://clipmarks.com/share/AADF8C33-5184-49A6-9F45-D91C2895A846/blog/" title="blog or email this clip"><img src="http://content9.clipmarks.com/images/c2b-foot.png" border="0" alt="blog it" width="107" height="17" style="border-width:0px;padding:0px;margin:0px;" /></a></td></tr></table></div></div>
New from the makers of Clipmarks:
Amplify.com - Don't just share the news...Amplify it!
Clipmarks
Home
New Clips
Top Clips
Dashboard
Popular Topics
News
Life
Science
Technology
Entertainment
Get Started
Sign Up
Install Clipping Tool
How Clipping Works
Clip-to-Blog™
ClipSearch
Tools and Resources
FAQ
ClipWeek
Top Clippers
Top Tags
Site Map
About Clipmarks
About Us
Contact
Copyright
Privacy
EULA
OK