Search code examples
asp.netcssskin

Do you mix and match CSS 'and' ASP.NET .Skin files?


Is it CSS for HTML elements and SKINS for ASP controls? Or is it CSS all the way even thought it seems to take longer? And what has Specivity SKINS or CSS?

I ask because I'm creating my first ASP.NET web application (using a book), while at the same time reading another about CSS. I'm now at the point where I need to start thinking about layout in my ASP book, and I'm slightly confused.

According to book: SKINS allow me to tell all Web Controls like TextBoxes/Labels to be a certain colour, font, etc site wide quite easily and centrally.

CSS is wonderful at managing layout and style as well and is easy (wrong word but correct sentiment I think) to implement,

However, when it comes to ASP.NET it will require more work. I will need to add the CssControl property to all Web Controls to attach my style/Class. Which seems to make using SKINS the better option when thinking about WEB Controls.


Solution

  • Each for its own. They do not overlap. CSS is the only thing that actually makes difference in appearance. Skins or not, in the end it boils down to CSS classes and style attributes, because that is the only thing that the browser understands.

    Skins however allow you to globally set some properties for a type of control. It's not limited only to appearance things. Yes, you can set the CssClass and Style properties, but you can also set other properties as well. It's like a global override and default value storage.