怎么CSS tag styles applies to the following code

问题描述 投票:-1回答:1

这是带有标记的CSS样式。现在我想了解样式如何与HTML一起使用。

<!DOCTYPE html> 
<html> 
    <head> 
        <title>Internal CSS</title> 
        <style> 
            .main { 
                text-align:center; 
            } 
            .GFG { 
                color:#009900; 
                font-size:50px; 
                font-weight:bold; 
            } 
            .geeks { 
                font-style:bold; 
                font-size:20px; 
            } 
        </style> 
    </head> 
    <body> 
        <div class = "main"> 
        <div class ="GFG">GeeksForGeeks</div> 
        <div class ="geeks">A computer science portal for geeks</p> 
        </div> 
    </body> 
</html>                  

The image shows the output

html css
1个回答
-2
投票

你一定要看看https://www.w3schools.com/css/default.asp(这是我如何学习我现在知道的关于html的一切)。您的代码如何工作的简要说明是您可以使用类似的创建样式

.GFG { 
            color:#009900; 
            font-size:50px; 
            font-weight:bold; 
}

你复制了,你可以把它们称为文本类型

<p class = "GFG">Hello World!</p>

他们将以所选的风格输出。祝好运!

© www.soinside.com 2019 - 2024. All rights reserved.