<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Understanding Style Precedence in CSS: Specificity, Inheritance, and the Cascade</title>
	<atom:link href="http://www.vanseodesign.com/css/css-specificity-inheritance-cascaade/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.vanseodesign.com/css/css-specificity-inheritance-cascaade/</link>
	<description>Helping you build search engine friendly websites</description>
	<lastBuildDate>Sun, 12 Feb 2012 17:29:40 -0700</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
	<item>
		<title>By: Steven Bradley</title>
		<link>http://www.vanseodesign.com/css/css-specificity-inheritance-cascaade/comment-page-2/#comment-163991</link>
		<dc:creator>Steven Bradley</dc:creator>
		<pubDate>Fri, 09 Dec 2011 03:47:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.vanseodesign.com/blog/?p=686#comment-163991</guid>
		<description>Thanks Andy. Ideally you wouldn&#039;t be using inline styles at all, :) but if you are they&#039;d take precedence since they&#039;re closer to the html element.

Interesting about the html attributes. When I wrote this post I wasn&#039;t thinking at all about attributes or how they fit into all of this. Maybe I should do some experimenting myself and a little research and refresh this post or write a new one.

Thanks for pointing it out.</description>
		<content:encoded><![CDATA[<p>Thanks Andy. Ideally you wouldn&#8217;t be using inline styles at all, <img src='http://www.vanseodesign.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  but if you are they&#8217;d take precedence since they&#8217;re closer to the html element.</p>
<p>Interesting about the html attributes. When I wrote this post I wasn&#8217;t thinking at all about attributes or how they fit into all of this. Maybe I should do some experimenting myself and a little research and refresh this post or write a new one.</p>
<p>Thanks for pointing it out.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andy Thomas</title>
		<link>http://www.vanseodesign.com/css/css-specificity-inheritance-cascaade/comment-page-2/#comment-163445</link>
		<dc:creator>Andy Thomas</dc:creator>
		<pubDate>Wed, 07 Dec 2011 19:35:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.vanseodesign.com/blog/?p=686#comment-163445</guid>
		<description>Great post. (Some more discussion about in-line styling would be helpful too.) It inspired me to experiment a bit.
I notice that the CSS settings based on html attributes override classes, so for instance &quot;input:read-only&quot; overrides &quot;input.mycssclass&quot;. Moreover, specifying the type of element overrides both class and attributes, so for instance  &quot;input[type=&quot;text&quot;].mycssclass&quot; overrides both &quot;input:read-only&quot; and &quot;input.mycssclass&quot;.</description>
		<content:encoded><![CDATA[<p>Great post. (Some more discussion about in-line styling would be helpful too.) It inspired me to experiment a bit.<br />
I notice that the CSS settings based on html attributes override classes, so for instance &#8220;input:read-only&#8221; overrides &#8220;input.mycssclass&#8221;. Moreover, specifying the type of element overrides both class and attributes, so for instance  &#8220;input[type="text"].mycssclass&#8221; overrides both &#8220;input:read-only&#8221; and &#8220;input.mycssclass&#8221;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steven Bradley</title>
		<link>http://www.vanseodesign.com/css/css-specificity-inheritance-cascaade/comment-page-2/#comment-155100</link>
		<dc:creator>Steven Bradley</dc:creator>
		<pubDate>Wed, 16 Nov 2011 07:31:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.vanseodesign.com/blog/?p=686#comment-155100</guid>
		<description>Glad I could help clear things up a little. Yeah, sometimes things aren&#039;t as intuitive as we&#039;d like.

I take it you were able to sort out the issue you had.</description>
		<content:encoded><![CDATA[<p>Glad I could help clear things up a little. Yeah, sometimes things aren&#8217;t as intuitive as we&#8217;d like.</p>
<p>I take it you were able to sort out the issue you had.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Rayson</title>
		<link>http://www.vanseodesign.com/css/css-specificity-inheritance-cascaade/comment-page-2/#comment-154802</link>
		<dc:creator>John Rayson</dc:creator>
		<pubDate>Tue, 15 Nov 2011 15:40:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.vanseodesign.com/blog/?p=686#comment-154802</guid>
		<description>Very nicely explained, has cleared up a few things for me.

What always causes me issues is that its counter intuitive, in that styles declare further away from an element take precedence over ones declared closer. What lead me here today were these two styles:

.mimic_adminAddObject &gt; DIV SELECT
{ width: 150px; }
.mimic_adminAddObjectSize SELECT
{ width: 70px; }
In the structure:
&lt;div class=&#039;mimic_adminAddObject&gt;
	&lt;select /&gt;
	&lt;div class=&#039;mimic_adminAddObjectSize&#039;&gt;
		&lt;select /&gt;
	&lt;/div&gt;
&lt;/div&gt;
Crazily both were set as width 150, now at least I understand why, even though logically its wrong.</description>
		<content:encoded><![CDATA[<p>Very nicely explained, has cleared up a few things for me.</p>
<p>What always causes me issues is that its counter intuitive, in that styles declare further away from an element take precedence over ones declared closer. What lead me here today were these two styles:</p>
<p>.mimic_adminAddObject &gt; DIV SELECT<br />
{ width: 150px; }<br />
.mimic_adminAddObjectSize SELECT<br />
{ width: 70px; }<br />
In the structure:<br />
&lt;div class=&#8217;mimic_adminAddObject&gt;<br />
	&lt;select /&gt;<br />
	&lt;div class=&#8217;mimic_adminAddObjectSize&#8217;&gt;<br />
		&lt;select /&gt;<br />
	&lt;/div&gt;<br />
&lt;/div&gt;<br />
Crazily both were set as width 150, now at least I understand why, even though logically its wrong.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: CSS Tips &#38; Tricks To Take Your Site To The Next Level &#124; Pixel2Pixel Design</title>
		<link>http://www.vanseodesign.com/css/css-specificity-inheritance-cascaade/comment-page-2/#comment-131928</link>
		<dc:creator>CSS Tips &#38; Tricks To Take Your Site To The Next Level &#124; Pixel2Pixel Design</dc:creator>
		<pubDate>Tue, 16 Aug 2011 12:37:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.vanseodesign.com/blog/?p=686#comment-131928</guid>
		<description>[...] to a single html element, a choice must be made as to which styles to apply. This is done through CSS specificity calculations and is expressed in the form of [...]</description>
		<content:encoded><![CDATA[<p>[...] to a single html element, a choice must be made as to which styles to apply. This is done through CSS specificity calculations and is expressed in the form of [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steven Bradley</title>
		<link>http://www.vanseodesign.com/css/css-specificity-inheritance-cascaade/comment-page-2/#comment-123960</link>
		<dc:creator>Steven Bradley</dc:creator>
		<pubDate>Tue, 21 Jun 2011 15:06:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.vanseodesign.com/blog/?p=686#comment-123960</guid>
		<description>Sorry it too so long to reply Eric. Your html didn&#039;t come through in the comment. Could you post it again or email it to me. If you want to place the code here you have to use the html entity for the angle brackets.

I&#039;m guessing the issue is that since the p is inside the div it&#039;s forcing the div to be wider. That&#039;s not really an issue of css precedence. Since you&#039;re specifically setting the width on the paragraph it will be that width (200px) and overflow the div, even though the div is set to be smaller (100px)

You could set the paragraph to use max-width instead of width

p {max-width: 200px}

Then it would never get wider than it&#039;s parent container. Of course you don&#039;t need to set the width at all in this case.</description>
		<content:encoded><![CDATA[<p>Sorry it too so long to reply Eric. Your html didn&#8217;t come through in the comment. Could you post it again or email it to me. If you want to place the code here you have to use the html entity for the angle brackets.</p>
<p>I&#8217;m guessing the issue is that since the p is inside the div it&#8217;s forcing the div to be wider. That&#8217;s not really an issue of css precedence. Since you&#8217;re specifically setting the width on the paragraph it will be that width (200px) and overflow the div, even though the div is set to be smaller (100px)</p>
<p>You could set the paragraph to use max-width instead of width</p>
<p>p {max-width: 200px}</p>
<p>Then it would never get wider than it&#8217;s parent container. Of course you don&#8217;t need to set the width at all in this case.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: eric</title>
		<link>http://www.vanseodesign.com/css/css-specificity-inheritance-cascaade/comment-page-2/#comment-123257</link>
		<dc:creator>eric</dc:creator>
		<pubDate>Wed, 15 Jun 2011 22:48:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.vanseodesign.com/blog/?p=686#comment-123257</guid>
		<description>Hi Steven, thanks for the article but I had a question:




p {width:200px;}
#a {background-color:yellow;width:100px}




abcde fghij klmno pqrst uvwxy




In the above example, whenever I open it in a browser, the width is 200px (which is the paragraph&#039;s) even though I set the div to 100px. Could you please explain why the p is getting the precedence? Thanks</description>
		<content:encoded><![CDATA[<p>Hi Steven, thanks for the article but I had a question:</p>
<p>p {width:200px;}<br />
#a {background-color:yellow;width:100px}</p>
<p>abcde fghij klmno pqrst uvwxy</p>
<p>In the above example, whenever I open it in a browser, the width is 200px (which is the paragraph&#8217;s) even though I set the div to 100px. Could you please explain why the p is getting the precedence? Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Totti Anh Nguyen</title>
		<link>http://www.vanseodesign.com/css/css-specificity-inheritance-cascaade/comment-page-2/#comment-118182</link>
		<dc:creator>Totti Anh Nguyen</dc:creator>
		<pubDate>Fri, 20 May 2011 06:28:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.vanseodesign.com/blog/?p=686#comment-118182</guid>
		<description>Hi Steven,

Thanks for the very nice &amp; detailed write-up :D</description>
		<content:encoded><![CDATA[<p>Hi Steven,</p>
<p>Thanks for the very nice &amp; detailed write-up <img src='http://www.vanseodesign.com/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: zefciu</title>
		<link>http://www.vanseodesign.com/css/css-specificity-inheritance-cascaade/comment-page-2/#comment-117463</link>
		<dc:creator>zefciu</dc:creator>
		<pubDate>Thu, 12 May 2011 10:30:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.vanseodesign.com/blog/?p=686#comment-117463</guid>
		<description>You just saved my day :)</description>
		<content:encoded><![CDATA[<p>You just saved my day <img src='http://www.vanseodesign.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Francisc</title>
		<link>http://www.vanseodesign.com/css/css-specificity-inheritance-cascaade/comment-page-2/#comment-116525</link>
		<dc:creator>Francisc</dc:creator>
		<pubDate>Fri, 06 May 2011 08:50:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.vanseodesign.com/blog/?p=686#comment-116525</guid>
		<description>Good article, thank you.</description>
		<content:encoded><![CDATA[<p>Good article, thank you.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

