Jump to content

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

Edited by hackalive
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.

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

  • 2 weeks later...

Nesting is cool and all, but the real reason I use SASS is for variables like I said before. Saves a lot of time! You don't have to address multiple id's for just one CSS statement. Makes things a lot more organized. For me at least. 

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.