我们知道div标签用于将HTML元素组合在一起,并在其上应用CSS和Web布局。让我们看看下面的示例,不使用div标签。我们需要为每个标签应用CSS(在示例中使用H1 H2和两个段落p标签)
<html>
<head>
<title>gfg</title>
<style type=text/css>
p{
color: white;
background-color: 009900;
width: 400px;
}
h1
{
color: white;
background-color: 009900;
width: 400px;
}
h2
{
color: white;
background-color: 009900;
width: 400px;
}
</style>
</head>
<body>
<h1>GeeksforGeeks</h1>
<p>How many times were you frustrated while looking out
for a good collection of programming/algorithm/interview
questions? What did you expect and what did you get?
This portal has been created to provide well written,
well thought and well-explained solutions for selected questions.
</p>
<h2>GeeksforGeeks</h2>
<p>GCET is an entrance test for the extensive classroom programme
by GeeksforGeeks to build and enhance Data Structures and Algorithm
concepts, mentored by Sandeep Jain (Founder & CEO, GeeksforGeeks).
He has 7 years of teaching experience and 6 years of industry experience.
</p>
</body>
</html>








暂无数据