Duration: 16 minutes
Summary: In this video, we will discuss which style to apply on an element when the same style is declared in different places. In previous videos, we learned that the style could be applied inline (within the element using the style attribute), or in the style section within the head of the page, or in an outer css file. Then the question is if the same style is declared in all three places, which style will win? The answer is the style that is closest to the element (the inline one). This is because the order is as follows: first the style in the outer css file is applied. Then the one in the style section in the header is applied. Finally the inline style is applied. So the inline style will override the values declared in other sections. We will illustrate how that works using an example. Using styles with attribute selectors is also discussed.
Methodology: Using simple examples to illustrate the key points.
Technology Used: CSS, HTML and Visual Studio 2010
Keyword: CSS, HTML, Visual Studio 2010, style, background-color.