2016-06-29 13 views
1

I別のクラスで別のdivにあるクラスでdiv要素をターゲットしたい、これは私が何をしたいのか、基本的である:再帰CSSセレクタ?

.footer { 
    position: sticky; 
    bottom: 0; 
    width: 100%; 
    /* Set the fixed height of the footer here */ 
    height: 60px; 
    background-color: #2f2f2f; 
    .container { 
     width: auto; 
     max-width: 680px; 
     padding: 0 15px; 

     .text-muted { 
      margin: 20px 0; 
     } 
    } 
} 

しかし、私は他の人の内側にクラスセレクタを置くことができない、私は条LESSやSASSなどのCSSフレームワークを使用し始めますか?

よろしく、

+2

* *別のクラスに別のdivにあるクラスでdiv要素をターゲットしたい - これをしない理由CSSだけで?なぜあなたがLess/Sassを見ているのか分かりません。 – Harry

答えて

2

あなたが使用して、純粋なCSSのようにそれを行うことができます。

.footer { 
position: sticky; 
bottom: 0; 
width: 100%; 
/* Set the fixed height of the footer here */ 
height: 60px; 
background-color: #2f2f2f; 
} 

.footer .container { 
    width: auto; 
    max-width: 680px; 
    padding: 0 15px; 
} 

.footer .container .text-muted { 
     margin: 20px 0; 
}