Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Regions in CSS like C# regions?

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?

like image 943
Adnan Bhatti Avatar asked Sep 22 '11 18:09

Adnan Bhatti


People also ask

Can you make regions in CSS?

No there is no support for regions in CSS.

What is region chain?

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.

What are C# regions?

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.


2 Answers

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 */ 
like image 141
Whimsical Avatar answered Oct 12 '22 04:10

Whimsical


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... 
like image 31
Andrew Barber Avatar answered Oct 12 '22 05:10

Andrew Barber