Msg#: 4284681 posted 6:06 pm on Mar 20, 2011 (gmt 0)
Hi! I'm looking for 'best practices' advice concerning external style sheets. When developing a webpage, I first keep my styles internally within the page HTML. Then I try to move most of the styles to an external style sheet(s). However, after moving the styles to the external sheet, priority conflicts occur affecting the webpage layout and I spend no end of time trying to debug the conflicts. After awhile, I give up and just move the styles back into the HTML file for the page, which defeats the purpose of the external sheet. It makes no sense to write code this way. What is the 'best practices' way to proceed with the placement of CSS styles? Appreciate any advice.
Msg#: 4284681 posted 6:27 pm on Mar 20, 2011 (gmt 0)
Creating the site with an external stylesheet from the start would be best.
This way, all the styles are in one spot for easier maintenance but it also makes it easier to troubleshoot.
Styles are applied in the order the browser finds them. If you have something in the internal stylesheet or an inline style those will override the external stylesheet.
With an external stylesheet you also have to be careful what order you add styles but it is easier to rearrange the styles in the external stylesheet or make them container specific by applying them to a specific div id.