【发布时间】:2020-08-23 07:35:02
【问题描述】:
我一直在研究我的在线作品集的 React 版本,但遇到了一些问题。将我的投资组合部署到 GitHub 页面后,我注意到我无法再在登录和联系页面上看到任何文本。主页和联系人组件页面中的链接仍然存在,但不可见。我假设它们隐藏在页面的背景图像下方,但是从页面中删除背景图像后,文本仍然隐藏。我已经为这两个页面提供了指向我部署的投资组合和代码的链接。有什么想法吗?
部署站点: https://swordspeare09.github.io/react_portfolio_site
Github 源代码: https://github.com/Swordspeare09/react_portfolio_site
import React from "react";
import Pic from "../../images/HeadSnipePic.jpg";
import LinkedInIcon from "@material-ui/icons/LinkedIn";
import GitHubIcon from "@material-ui/icons/GitHub";
import { teal } from "@material-ui/core/colors";
import Background from "../../images/CityPic.jpg";
import "../../CSS/Styles.css";
function Home() {
return (
<div>
<div className="text">
<h1>Full Stack Web Developer</h1>
</div>
<img className="headSnipe" src={Pic} alt="avatar" />
<div className="text">
<p>
HTML/CSS | JavaScript | C++ | Java | ReactJS | NodeJS | Express |
MongoDB | mySQL | Bootstrap | Materialize | Bulma
</p>
<p>
US Air Force veteran turned Full Stack Web Developer hoping to use
experience and logic acquired over the years to help create
technologies and applications that will change the world.
</p>
</div>
<div className="Social-Links">
<a
href="https://www.linkedin.com/in/franciscojcortez2009/"
target="_blank"
rel="noreferrer noopener"
>
<LinkedInIcon style={{ fontSize: 80, color: teal[300] }} />
</a>
<a
href="https://github.com/Swordspeare09"
target="_blank"
rel="noreferrer noopener"
>
<GitHubIcon style={{ fontSize: 80, color: teal[300] }} />
</a>
</div>
</div>
);
}
export default Home;
import React from "react";
import LinkedInIcon from "@material-ui/icons/LinkedIn";
import MailOutlineIcon from "@material-ui/icons/MailOutline";
import GitHubIcon from "@material-ui/icons/GitHub";
import { teal} from "@material-ui/core/colors";
import Background from "../../images/CityPic.jpg";
function Contact() {
return (
<div
style={{
height: "100vh",
width: "100%",
margin: "auto",
backgroundImage: `url(${Background})`,
backgroundSize: `cover`,
backgroundRepeat: "no-repeat",
zIndex: "-1"
}}
>
<h1 className="text2">Connect With Me</h1>
<div className="Social-Links2">
<a
href="https://www.linkedin.com/in/franciscojcortez2009/"
target="_blank"
rel="noreferrer noopener"
>
<LinkedInIcon style={{ fontSize: 100, color: teal[300] }} />
</a>
</div>
<div className="Social-Links2">
<a
href="mailto:cortez.francisco.j.2009@gmail.com?subject:subject text"
target="_blank"
rel="noreferrer noopener"
>
<MailOutlineIcon style={{ fontSize: 100, color: teal[300] }} />
</a>
</div>
<div className="Social-Links2">
<a
href="https://github.com/Swordspeare09"
target="_blank"
rel="noreferrer noopener"
>
<GitHubIcon style={{ fontSize: 100, color: teal[300] }} />
</a>
</div>
</div>
);
}
export default Contact;
【问题讨论】:
-
我认为您的网站没有任何问题。
-
在有图片的首页,应该有文字。
-
现在我看到了问题。在您的代码中,
.text和.text2的不透明度设置为85%,但这不是您发布的代码。在已发布的代码中,不透明度设置为 1%,因此实际上并不可见。 -
我将不透明度符号更改为十进制而不是使用百分比,并且它为两个页面都修复了它。谢谢。
标签: javascript css reactjs material-ui github-pages