Regions in CSS such as C # regions?

Is there a way to define regions in a CSS file in the same way as regions in C #?

As in C #, you define areas as follows

#region My Region //your code here #endregion 

My problem is that I do not want to use separate CSS files for my asp.net project, but I also want to organize, so I can define specific sections, for example, for the CSS of the main page and one for FormUser, etc., so it is easy to troubleshoot if necessary. Is it possible?

+43
css visual-studio-2010
Sep 22 '11 at 18:50
source share
7 answers

You can use this for regions ... works well for creating dropable regions

 /*#region RegionName*/ /*#endregion RegionName*/ 

RegionName is optional in endregion

+130
Nov 24. '11 at 7:35
source share

You cannot make regions, but you can always just use intervals and comments to add an organization if you want.

 /*Layout rules*/ body{} div{} etc{} /*Typography Rules*/ etc{} etc... 
+7
Sep 22 '11 at 18:51
source share

There is no support for regions in CSS.

The usual approach is to split into different CSS files, and then use the CSS minimization tool for production releases, which integrates and minimizes your CSS, i.e. see minify or YUI Compressor .

+3
Sep 22 '11 at 18:52
source share

You must use different CSS files and move them to 1 file when creating the application. There are special tools for this that do just that, since this is the only way.

+2
Sep 22 '11 at 18:52
source share

You can add regions to your CSS exactly as you describe using a visual studio plugin called "Web Essentials" (this is VS2012, but earlier versions are available)

Then you can simply add regions to your CSS by doing the following:

 /*#region Footer ---------------------------------------------------- */ .footerHyperlinks{ decoration:none; } /*#endregion*/ 

Combined with the keyboard shortcut (ctrl + M, ctrl + L), this is invaluable to me. since it instantly reduces your huge long page, which you have to scroll through MUCH, MUCH faster. Hope this helps you!

+2
Mar 22 '13 at 15:28
source share

enter region and press tab , you will get the following

 /*#region name */ /*#endregion */ 

where you can edit name to give the region the name of your choice.

Hope this helps.

+1
Jul 25 '16 at 11:28
source share

There is nothing like regions in CSS. In most cases, different sections of the code are separated by comments like /* Header Styles */ , etc. I would recommend splitting CSS into at least two files and importing them into the CSS files that they need, for example, you included class definitions in C # ...

@import url("reset.css");

-one
Sep 22 '11 at 18:57
source share



All Articles