Jump to content

css nesting


hackalive

Recommended Posts

Hi guys,

 

I saw this in some CSS ages ago and cannot remember where so cannot remember how it goes exactly ... but i'd like to do somehting like this with my css:

 

<htmi id="something">

 

<style>

#something {

 

 h1 {

}

 

}

 

#other {

 

 h1 {

}

 

}

 

so if anyone know how it works or how to make it work thatd be great!

 

cheers

Link to comment
https://forums.phpfreaks.com/topic/278661-css-nesting/
Share on other sites

CSS doesn't have "nesting" like that but you can

 

 

CSS doesn't have it, but SASS does. SASS is pretty much CSS on steroids. It saves a lot of time and aggravation. Not only does it let you nest elements, but it also lets you assign variables to values. So instead of having to scroll through your style sheet for that hex-code or rearrange and reorganize your structure, you can do something like $white=#fff; and use it over and over again.

 

Give it a try. 

Link to comment
https://forums.phpfreaks.com/topic/278661-css-nesting/#findComment-1434949
Share on other sites

Its actually NOT tedious at all. I use Less for everything, running a program call WinLess in the background. Every time I change a Less file, the Less gets compiled into a bootstrap.css file in the css folder automatically. Bootstrap.css is also minified!

 

Couldnt be easier. Use it.

Link to comment
https://forums.phpfreaks.com/topic/278661-css-nesting/#findComment-1435024
Share on other sites

  • 2 weeks later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.