【发布时间】:2021-12-21 01:26:46
【问题描述】:
我正在创建一个网站,我在其中添加了社交媒体图标,但它们在屏幕上不可见。我在我的 CSS 文件中添加了所有图标的颜色。它也不显示这些图标的标题。我是网络开发的新手,所以请多多包涵。 下面是我的 HTML 代码:
.h1 {
font-size: '150%';
color: 'beige';
}
.h3 {
color: 'beige';
}
.contact-header {
display: flex;
justify-content: center;
align-items: center;
height: 100%;
width: 100%;
}
.contact-content {
display: flex;
justify-content: center;
align-items: center;
height: 100%;
width: 100%;
}
.container {
background-color: black;
height: 600 px;
padding: 30px;
justify-content: center;
}
.social-buttons {
display: flex;
justify-content: center;
align-items: center;
height: 100%;
width: 100%;
margin: 2 px;
flex-wrap: wrap;
gap: 15px;
}
.blue-circle2 {
background-color: rgb(0, 89, 255);
}
.red-circle1 {
background-color: red;
}
.pink-circle1 {
background-color: rgb(251, 57, 88);
}
.blue-circle3 {
background-color: blue;
}
<html>
<head>
<title>Home page</title>
<link rel="style" href="CSS/style.css">
<meta charset="UTF-8">
</head>
<body>
<div className="container">
<div className="contact-header">
<h1>Contact Us</h1>
</div>
<div className="contact-content">
<h3>Reach out to us at <a className="email-link" href="ourlibrary@gmail.com">email</a></h3>
</div>
<div className="social-buttons">
<!--- <a href=>--->
<div className="red-circle1">
<img src="./img/youtube.svg" alt="YouTube icon" width='40' height='40' />
</div>
</a>
<!--- <a href="https://twitter.com/CampusAndroid">---->
<div className="blue-circle2">
<img src="./img/twitter.svg" alt="Twitter icon" width='40' height='40' />
</div>
</a>
<!--- <a href=>--->
<div className="blue-circle3">
<img src="./img/facebook.svg" alt="Facebook icon" width='40' height='40' />
</div>
</a>
<!--- <a href=>--->
<div className="pink-circle1">
<img src="./img/instagram.svg" alt="Instagram icon" width='40' height='40' />
</div>
</a>
<!--- <a href=>--->
<div className="blue-circle2">
<img src="./img/linkedin.svg" alt="LinkedIn icon" width='40' height='40' />
</div>
</a>
</div>
</div>
</body>
我哪里错了?请提出建议。
【问题讨论】:
-
您的意思是
class而不是className? -
className用于React.js以消除与JavaScript中的class的冲突。这似乎是基于html/css的正常网站。正如@SebastianSimon 所说,将className替换为class,然后您的css将被应用。 :) -
我改变了它,但它仍然显示相同的东西:(
-
当我将图像从 .svg 更改为 .png 时它起作用了
标签: javascript html css bootstrap-4