2017-09-13 10 views
0

爲了解釋我想實現的目標,可以說我有很多類的css文檔。我有幾個不同的「h1」標籤和「h2」標籤,「iframe」,「ul」,許多都有不同的類別。是否可以將所有「h1」或其他標籤(無論類別)分組在一起,並且所有「iframe」都在Notepad ++中分組在一起。我可以通過他們的標籤來組織CSS嗎,而不是所有的人都是獨立的?

h1.left { 
 
\t font-family: Papyrus; 
 
\t font-size: 45px; 
 
\t color: white; 
 
\t margin-left: 15px; 
 
} 
 
h1.center { 
 
\t font-family: Papyrus; 
 
\t font-size: 30px; 
 
\t color: white; 
 
\t text-align: center;
<!DOCTYPE html> 
 
<html> 
 
<head> 
 
</head> 
 
<body> 
 
    <pre>PS: All code in this document is just 
 
     so it would be seen as I meant it to be, 
 
     and I hope you can read it right.<pre> 
 
    <!--For example:--> 
 
    + h1 
 
    <!--And if i roll the h1 down, i can get all h1 in the document:--> 
 
    <ul> 
 
    <li> h1.left</li> 
 
    <li>h1.center <li> 
 
    <li>h1.right<li> 
 
    <!--And if i open those again, I will get all the code that is inside them--> 
 
</body> 
 
</html>

+0

你想在哪裏分組標籤?在CSS文件? – Emaro

+0

我認爲他的意思是生成一種樣式指南 – lumio

+0

在Notepad ++中,如果給出語言,您可以隱藏代碼並只能看到標籤。我想要的是,即使具有相同的標籤,即使它們具有不同的類別,也可以放入一個組中,因此我不必製作具有多個單個標籤的文檔。如果我需要編輯或製作一個新的特定標籤,我會進入主要組並將其添加到那裏。 – rhopland

回答

0

不知道是否記事本+ +可以運行SASS但聽起來好像你所追求的。

h1 { 
    color: white; 
    font-family: Papyrus; 
    text-align: center; 

    &.left { 
     font-size: 45px; 
    } 
    &.center { 
     font-size: 30px; 
    } 
} 
相關問題