热线电话:13121318867

登录
2019-01-26 阅读量: 832
如何用CSS替代div标签

我们知道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>

0.0000
3
关注作者
收藏
评论(0)

发表评论

暂无数据
推荐帖子