Is there a way to define regions in CSS file just like regions in C#?
Like in C# you define regions as follows
#region My Region //your code here #endregion
My problem is I don't want to use separate CSS files for my asp.net project but I also want to organinze so I can define specific sections like one for Master Page CSS and one for FormUser and so forth so it is easy to troubleshoot when needed. Is it possible?
No there is no support for regions in CSS.
A region chain is the sequence of regions that are associated with a named flow. CSS Regions in a region chain receive content from the named flow following their order in the chain. CSS Regions are organized into a region chain according to the document order.
C# region. Regions in C# is a useful feature that helps manage code in areas that can be hidden or visible. Learn how to use regions in Visual Studio to improve code readability. An instructor I once had made a statement that has echoed in my head for years.
You can use this for regions...works well to make collapsible regions
/*#region RegionName*/ /*#endregion RegionName*/
The RegionName is optional in endregion, you can also use
/*#region RegionName*/ /*#endregion */
You can't do regions, but you can always just use spacing and comments to add some organization if you like.
/*Layout rules*/ body{} div{} etc{} /*Typography Rules*/ etc{} etc...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With