Cascading of styles is one in which an element called as child element placed with another element called as parent element inherit the styles of the parent. Cascading of styles also comes into picture when there is an overlap of styles defined. That is in other words usually among the three styles namely embedded style, external style and inline style. The general method of execution is to check for the external style by checking for the tag. If it is found it gets placed in memory and gets executed. Otherswise the next choice is to check for embedded styles and then only the inline styles gets executed. But in all situations proper flow may not occur. There may b scenarios in which these type definitions gets overlapped. In such situations cascading takes places by which the style which is nearest to the content gets executed. There may be also scenarios in which conflict can occur among styles of same type. In such a situation the rule whichever occurs last takes the winning step to be applied.
inside the head section of an HTML page(internal style sheet)
in an external CSS file(external style sheet)
When more than one style is specified for an HTML document , Cascading order determines the style to be used.
Generally speaking we can say that all the styles will "cascade" into a new "virtual" style sheet by the following rules, where number four has the highest priority:
Browser default
External style sheet
Internal style sheet (in the head section)
Inline style (inside an HTML element)
So, an inline style (inside an HTML element) has the highest priority, which means that it will override a style defined inside the <head> tag, or in an external style sheet, or in a browser (a default value)
What is meant by cascading of styles?
Profile Answers by GeekAdmin Questions by GeekAdmin
Questions by GeekAdmin answers by GeekAdmin
Related Answered Questions
Related Open Questions