试图让我的span文本变为粗体并且字体更大

时间:2017-11-06 21:07:54

标签: html css

我正在努力让我的跨度变得大胆,并且字体与我的段落不同。 CSS正确链接到我的HTML。

span.bold {
  font-size: 20px;
  font-weight: 700;
}

p {
  font-size: 16px;
  color: black;
  font-family: sans-serif;
  padding: 22px;
  max-width: 60%;
  display: inline-block;
  margin-top: 0px;
}
<p align="center">
  <span="bold">Welcome to Coding Club for Web Developers</span> <br> Coding Club web developers is specifically designed to teach the basics of making a website by learning HTML, Javascript, and CSS. Using Discord, we talk with our team to learn from each other and
    to design for our upcoming projects. As a beginner or an amateur, you'll learn everything you need to know about Web Development. To practice, you can go to W3Schools, Sololearn, or Codecademy. <br>

2 个答案:

答案 0 :(得分:5)

您需要指定class关键字span=bold并不代表任何内容

&#13;
&#13;
span.bold {
  font-size: 20px;
  font-weight: 700;
}

p {
  font-size: 16px;
  color: black;
  font-family: sans-serif;
  padding: 22px;
  max-width: 60%;
  display: inline-block;
  margin-top: 0px;
}
&#13;
<p align="center">
  <span class="bold">Welcome to Coding Club for Web Developers</span> <br> Coding Club web developers is specifically designed to teach the basics of making a website by learning HTML, Javascript, and CSS. Using Discord, we talk with our team to learn from each other and
    to design for our upcoming projects. As a beginner or an amateur, you'll learn everything you need to know about Web Development. To practice, you can go to W3Schools, Sololearn, or Codecademy. <br>
&#13;
&#13;
&#13;

答案 1 :(得分:0)

如果要将名为bold的类分配给span元素,请执行以下操作:

<span class="bold">

不是

<span="bold">