覆盖边框上的图标

时间:2018-05-18 12:40:39

标签: html css css3

我正在尝试创建一些覆盖边框的图标,如下所示: enter image description here

然而,当我尝试这样做时,我最终得到: enter image description here

我有办法解决这个问题吗?不要担心图标颜色,我把它改成黑色,以便它是可见的。有一种方法,我可以使用HTML和CSS实现这一点。

这是我的工作: https://codepen.io/anon/pen/YLdPjM



body {
  margin: 0;
  padding: 0;
  font-family: 'Oswald', sans-serif;
}
 .red {
  color: red;
}

.underline {
  text-decoration: underline;
}
.nav ul {
  list-style: none;
  background-color: #0F211E;
  text-align: center;
  padding: 0;
  margin: 0;

}
.nav li {
  font-size: 1.2em;
  line-height: 40px;
  height: 40px;
  border-bottom: 1px solid #888;
}
 
.nav a {
  text-decoration: none;
  color: #fff;
  display: block;
  transition: .3s background-color;
  text-transform: uppercase;
}
 .hero-image {
  background-image: url("1.jpg");
  height: 50%;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  position: relative;
  
}


@media screen and (min-width: 600px) {
  .nav li {
    width: 120px;
    border-bottom: none;
    height: 50px;
    line-height: 50px;
    font-size: 1.4em;
  }
 
  /* Option 1 - Display Inline */
  .nav li {
    display: inline-block;
    margin-right: -4px;
  }
 
  /* Options 2 - Float
  .nav li {
    float: left;
  }
  .nav ul {
    overflow: auto;
    width: 600px;
    margin: 0 auto;
  }
  .nav {
    background-color: #444;
  }
  */
}


section.hero {
  height: 75%;
  position: relative;
}

.hero-content {
  position: absolute;
  top: 50%;
  transform: translateY(5%);
  width: 100%;
}


.bgimg {
  /* The image used */
    background-image: url("bg.jpg");

    /* Set a specific height */
    height: 100%;

    /* Position and center the image to scale nicely on all screens */
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    position: relative;
}
.back .caption:before{
  border-top: 1px solid #fff;
  border-bottom: 1px solid #fff;
  transform: scale(0,1);
}

.back .caption:after{
  border-right: 1px solid #fff;
  border-left: 1px solid #fff;
  transform: scale(1,0);
}

.card.flipped .back .caption:before,
.card.flipped .back .caption:after {
  opacity: .9;
  transform: scale(1);  
}

.back dl{
  font-family:'Lato', Arial, sans-serif;
  font-weight:300;
  bottom:40px;
  left:40px;
  position: absolute;
  opacity: 0;
  transition: opacity .35s, transform .35s;
  transition-delay: .85s;
  transform: translate3d(-40px,0,0);
}

.card.flipped .back dl {
  opacity: 1;
  transform: translate3d(0,0,0);
}

dl dt{
  float: left;
  width: 60px;
  overflow: hidden;
  clear: left;
  text-align: right;
  font-weight:700;
}

dl dd{
  margin-left: 80px;
  text-align:left;
}

dl dd:before,
dl dd:after{
  display: table;
  content: " ";
}

dl dd:after{
  clear: both;
}

.front:hover p {
  opacity: 1;
  transform: translate3d(0,0,0);
}

figure a{
  z-index: 1000;
  text-indent: 200%;
  white-space: nowrap;
  font-size: 0;
  opacity: 0;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

@media (min-width: 450px) {
  .container{
    left: 50%;
    margin-left:-225px;
  }
}



body {
  background-color: #0F211E;

}

.recipe-card {
    border-top: 15px solid lightblue; 
    border-bottom: 50px solid red;
  background: #fff;
  margin: 0 auto;
  width: 90%;
  max-width: 496px;
  border-top-left-radius: 5px;
  border-top-right-radius: 5px;
  border-bottom-left-radius: 5px;
  border-bottom-right-radius: 5px;
}


.card-top {
  padding: 30px 15px;
  display: flex;
}

.card-top .right {
  padding-left: 20px;
}

<html>
<head>
	
<title>Portfolio</title>

<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.13/css/all.css" integrity="sha384-DNOHZ68U8hZfKXOrtjWvjxusGo9WQnrNx2sqG0tfsghAvtVlRW3tvkXWZh58N9jp" crossorigin="anonymous">
<link href="https://fonts.googleapis.com/css?family=Oswald" rel="stylesheet">

<link rel="stylesheet" href="style.css">
</style>
	
</head>

<body class="news" >


	<header>

		<div class="nav">
			<ul>
				<li class="two"><a href="#"> <span>About</span></a></li>
				<li class="three"><a class="active" href="#">Projects</a></li>
				<li class="four"><a href="#">Skills</a></li>
			</ul>
		</div>
	</header>
	

	<section class="hero">
		<div class="bgimg">
		</div>	


		<div class="hero-content">
			<div class="recipe-card">

				<aside>
					<div class="card-top">
						<div class="left">
							<img src="myAvatar.png" class="myavatar">
						</div>
						<div class="right">
							<h1>Hamza Wahbi</h1>
							<hr class="hrunder">
							<h5 style="color:#8B8B8B " >Web Developer</h5>
							<h1>Age: <font color="#8B8B8B">13</font></h1>
							<h1>Email: <font color="#8B8B8B">fxgfnxngfx@gmail.com</font></h1>
							<h1>Phone: <font color="#8B8B8B">0093836372</font></h1>
						</div>

					</div>

				</aside>
					<i class="fab fa-twitter fa-3x" style="color: black;"></i>
					<i class="fab fa-instagram fa-3x" style="color: black;"></i>
					<i class="fab fa-dribbble fa-3x" style="color: black;"></i>
					<i class="fab fa-facebook-f fa-3x" style="color: black;"></i>
					<i class="fab fa-snapchat-ghost fa-3x" style="color: black;"></i>
					<i class="fab fa-google-plus-g  fa-3x" style="color: black;"></i>
                    <i class="fab fa-youtube fa-3x" style="color: black;"></i>
                    <i class="fab fa-pinterest-p fa-3x" style="color: black;"></i>
			</div>

		</div><!-- .hero-content -->

	</section>
	
</div>






</html>
&#13;
&#13;
&#13;

4 个答案:

答案 0 :(得分:3)

为什么要使用边框?只需将div中的图标设置为div,然后将div的背景颜色设置为红色。请参阅下面的代码段。

&#13;
&#13;
body {
  margin: 0;
  padding: 0;
  font-family: 'Oswald', sans-serif;
}

.red {
  color: red;
}

.icon-bar {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: space-evenly;
  -ms-flex-pack: space-evenly;
  justify-content: space-evenly;
  background-color: #FC5558;
  padding: 5px;
}

.icon-bar i {
  color: #fff;
}

.underline {
  text-decoration: underline;
}

.nav ul {
  list-style: none;
  background-color: #0F211E;
  text-align: center;
  padding: 0;
  margin: 0;
}

.nav li {
  font-size: 1.2em;
  line-height: 40px;
  height: 40px;
  border-bottom: 1px solid #888;
}

.nav a {
  text-decoration: none;
  color: #fff;
  display: block;
  transition: .3s background-color;
  text-transform: uppercase;
}

.hero-image {
  background-image: url("1.jpg");
  height: 50%;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  position: relative;
}

@media screen and (min-width: 600px) {
  .nav li {
    width: 120px;
    border-bottom: none;
    height: 50px;
    line-height: 50px;
    font-size: 1.4em;
  }
  /* Option 1 - Display Inline */
  .nav li {
    display: inline-block;
    margin-right: -4px;
  }
  /* Options 2 - Float
  .nav li {
    float: left;
  }
  .nav ul {
    overflow: auto;
    width: 600px;
    margin: 0 auto;
  }
  .nav {
    background-color: #444;
  }
  */
}

section.hero {
  height: 75%;
  position: relative;
}

.hero-content {
  position: absolute;
  top: 50%;
  transform: translateY(5%);
  width: 100%;
}

.bgimg {
  /* The image used */
  background-image: url("bg.jpg");
  /* Set a specific height */
  height: 100%;
  /* Position and center the image to scale nicely on all screens */
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  position: relative;
}

.back .caption:before {
  border-top: 1px solid #fff;
  border-bottom: 1px solid #fff;
  transform: scale(0, 1);
}

.back .caption:after {
  border-right: 1px solid #fff;
  border-left: 1px solid #fff;
  transform: scale(1, 0);
}

.card.flipped .back .caption:before,
.card.flipped .back .caption:after {
  opacity: .9;
  transform: scale(1);
}

.back dl {
  font-family: 'Lato', Arial, sans-serif;
  font-weight: 300;
  bottom: 40px;
  left: 40px;
  position: absolute;
  opacity: 0;
  transition: opacity .35s, transform .35s;
  transition-delay: .85s;
  transform: translate3d(-40px, 0, 0);
}

.card.flipped .back dl {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

dl dt {
  float: left;
  width: 60px;
  overflow: hidden;
  clear: left;
  text-align: right;
  font-weight: 700;
}

dl dd {
  margin-left: 80px;
  text-align: left;
}

dl dd:before,
dl dd:after {
  display: table;
  content: " ";
}

dl dd:after {
  clear: both;
}

.front:hover p {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

figure a {
  z-index: 1000;
  text-indent: 200%;
  white-space: nowrap;
  font-size: 0;
  opacity: 0;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

@media (min-width: 450px) {
  .container {
    left: 50%;
    margin-left: -225px;
  }
}

body {
  background-color: #0F211E;
}

.recipe-card {
  border-top: 15px solid lightblue;
  background: #fff;
  margin: 0 auto;
  width: 90%;
  max-width: 496px;
  border-top-left-radius: 5px;
  border-top-right-radius: 5px;
  border-bottom-left-radius: 5px;
  border-bottom-right-radius: 5px;
}

.card-top {
  padding: 30px 15px;
  display: flex;
}

.card-top .right {
  padding-left: 20px;
}
&#13;
<html>

<head>

  <title>Portfolio</title>

  <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.13/css/all.css" integrity="sha384-DNOHZ68U8hZfKXOrtjWvjxusGo9WQnrNx2sqG0tfsghAvtVlRW3tvkXWZh58N9jp" crossorigin="anonymous">
  <link href="https://fonts.googleapis.com/css?family=Oswald" rel="stylesheet">

  <link rel="stylesheet" href="style.css">
  </style>

</head>

<body class="news">


  <header>

    <div class="nav">
      <ul>
        <li class="two">
          <a href="#"> <span>About</span></a>
        </li>
        <li class="three"><a class="active" href="#">Projects</a></li>
        <li class="four"><a href="#">Skills</a></li>
      </ul>
    </div>
  </header>


  <section class="hero">
    <div class="bgimg">
    </div>


    <div class="hero-content">
      <div class="recipe-card">

        <aside>
          <div class="card-top">
            <div class="left">
              <img src="myAvatar.png" class="myavatar">
            </div>
            <div class="right">
              <h1>Hamza Wahbi</h1>
              <hr class="hrunder">
              <h5 style="color:#8B8B8B ">Web Developer</h5>
              <h1>Age:
                <font color="#8B8B8B">13</font>
              </h1>
              <h1>Email:
                <font color="#8B8B8B">fxgfnxngfx@gmail.com</font>
              </h1>
              <h1>Phone:
                <font color="#8B8B8B">0093836372</font>
              </h1>
            </div>

          </div>

        </aside>
        <div class="icon-bar">
          <i class="fab fa-twitter fa-3x"></i>
          <i class="fab fa-instagram fa-3x"></i>
          <i class="fab fa-dribbble fa-3x"></i>
          <i class="fab fa-facebook-f fa-3x"></i>
          <i class="fab fa-snapchat-ghost fa-3x"></i>
          <i class="fab fa-google-plus-g  fa-3x"></i>
          <i class="fab fa-youtube fa-3x"></i>
          <i class="fab fa-pinterest-p fa-3x"></i>
        </div>
      </div>

    </div>
    <!-- .hero-content -->

  </section>

  </div>






</html>
&#13;
&#13;
&#13;

答案 1 :(得分:2)

您可以将DIV中的所有图标(下面的我的代码段中的icon_row类)包起来,将position: absolute应用于该DIV并将position: relative应用到recipe-card DIV以定义它作为图标DIV的位置锚点(并可选择使用bottomleft等位置设置来微调位置):

&#13;
&#13;
body {
  margin: 0;
  padding: 0;
  font-family: 'Oswald', sans-serif;
}

.red {
  color: red;
}

.underline {
  text-decoration: underline;
}

.nav ul {
  list-style: none;
  background-color: #0F211E;
  text-align: center;
  padding: 0;
  margin: 0;
}

.nav li {
  font-size: 1.2em;
  line-height: 40px;
  height: 40px;
  border-bottom: 1px solid #888;
}

.nav a {
  text-decoration: none;
  color: #fff;
  display: block;
  transition: .3s background-color;
  text-transform: uppercase;
}

.hero-image {
  background-image: url("1.jpg");
  height: 50%;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  position: relative;
}

@media screen and (min-width: 600px) {
  .nav li {
    width: 120px;
    border-bottom: none;
    height: 50px;
    line-height: 50px;
    font-size: 1.4em;
  }
  /* Option 1 - Display Inline */
  .nav li {
    display: inline-block;
    margin-right: -4px;
  }
  /* Options 2 - Float
  .nav li {
    float: left;
  }
  .nav ul {
    overflow: auto;
    width: 600px;
    margin: 0 auto;
  }
  .nav {
    background-color: #444;
  }
  */
}

section.hero {
  height: 75%;
  position: relative;
}

.hero-content {
  position: absolute;
  top: 50%;
  transform: translateY(5%);
  width: 100%;
}

.bgimg {
  /* The image used */
  background-image: url("bg.jpg");
  /* Set a specific height */
  height: 100%;
  /* Position and center the image to scale nicely on all screens */
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  position: relative;
}

.back .caption:before {
  border-top: 1px solid #fff;
  border-bottom: 1px solid #fff;
  transform: scale(0, 1);
}

.back .caption:after {
  border-right: 1px solid #fff;
  border-left: 1px solid #fff;
  transform: scale(1, 0);
}

.card.flipped .back .caption:before,
.card.flipped .back .caption:after {
  opacity: .9;
  transform: scale(1);
}

.back dl {
  font-family: 'Lato', Arial, sans-serif;
  font-weight: 300;
  bottom: 40px;
  left: 40px;
  position: absolute;
  opacity: 0;
  transition: opacity .35s, transform .35s;
  transition-delay: .85s;
  transform: translate3d(-40px, 0, 0);
}

.card.flipped .back dl {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

dl dt {
  float: left;
  width: 60px;
  overflow: hidden;
  clear: left;
  text-align: right;
  font-weight: 700;
}

dl dd {
  margin-left: 80px;
  text-align: left;
}

dl dd:before,
dl dd:after {
  display: table;
  content: " ";
}

dl dd:after {
  clear: both;
}

.front:hover p {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

figure a {
  z-index: 1000;
  text-indent: 200%;
  white-space: nowrap;
  font-size: 0;
  opacity: 0;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

@media (min-width: 450px) {
  .container {
    left: 50%;
    margin-left: -225px;
  }
}

body {
  background-color: #0F211E;
}

.recipe-card {
  border-top: 15px solid lightblue;
  border-bottom: 50px solid red;
  background: #fff;
  margin: 0 auto;
  width: 90%;
  max-width: 496px;
  border-top-left-radius: 5px;
  border-top-right-radius: 5px;
  border-bottom-left-radius: 5px;
  border-bottom-right-radius: 5px;
  position: relative;
}

.card-top {
  padding: 30px 15px;
  display: flex;
}

.card-top .right {
  padding-left: 20px;
}
.icon_row {
position: absolute;
left: 30px;
}
&#13;
<html>

<head>

  <title>Portfolio</title>

  <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.13/css/all.css" integrity="sha384-DNOHZ68U8hZfKXOrtjWvjxusGo9WQnrNx2sqG0tfsghAvtVlRW3tvkXWZh58N9jp" crossorigin="anonymous">
  <link href="https://fonts.googleapis.com/css?family=Oswald" rel="stylesheet">

  <link rel="stylesheet" href="style.css">
  </style>

</head>

<body class="news">


  <header>

    <div class="nav">
      <ul>
        <li class="two">
          <a href="#"> <span>About</span></a>
        </li>
        <li class="three"><a class="active" href="#">Projects</a></li>
        <li class="four"><a href="#">Skills</a></li>
      </ul>
    </div>
  </header>


  <section class="hero">
    <div class="bgimg">
    </div>


    <div class="hero-content">
      <div class="recipe-card">

        <aside>
          <div class="card-top">
            <div class="left">
              <img src="myAvatar.png" class="myavatar">
            </div>
            <div class="right">
              <h1>Hamza Wahbi</h1>
              <hr class="hrunder">
              <h5 style="color:#8B8B8B ">Web Developer</h5>
              <h1>Age:
                <font color="#8B8B8B">13</font>
              </h1>
              <h1>Email:
                <font color="#8B8B8B">fxgfnxngfx@gmail.com</font>
              </h1>
              <h1>Phone:
                <font color="#8B8B8B">0093836372</font>
              </h1>
            </div>

          </div>

        </aside>
        <div class="icon_row">
        <i class="fab fa-twitter fa-3x" style="color: black;"></i>
        <i class="fab fa-instagram fa-3x" style="color: black;"></i>
        <i class="fab fa-dribbble fa-3x" style="color: black;"></i>
        <i class="fab fa-facebook-f fa-3x" style="color: black;"></i>
        <i class="fab fa-snapchat-ghost fa-3x" style="color: black;"></i>
        <i class="fab fa-google-plus-g  fa-3x" style="color: black;"></i>
        <i class="fab fa-youtube fa-3x" style="color: black;"></i>
        <i class="fab fa-pinterest-p fa-3x" style="color: black;"></i>
        </div>
      </div>

    </div>
    <!-- .hero-content -->

  </section>

  </div>






</html>
&#13;
&#13;
&#13;

答案 2 :(得分:1)

尝试在div中包装图标,其位置为:fixed和bottom:0

body {
  margin: 0;
  padding: 0;
  font-family: 'Oswald', sans-serif;
}
 .red {
  color: red;
}

.underline {
  text-decoration: underline;
}
.nav ul {
  list-style: none;
  background-color: #0F211E;
  text-align: center;
  padding: 0;
  margin: 0;

}
.nav li {
  font-size: 1.2em;
  line-height: 40px;
  height: 40px;
  border-bottom: 1px solid #888;
}
 
.nav a {
  text-decoration: none;
  color: #fff;
  display: block;
  transition: .3s background-color;
  text-transform: uppercase;
}
 .hero-image {
  background-image: url("1.jpg");
  height: 50%;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  position: relative;
  
}


@media screen and (min-width: 600px) {
  .nav li {
    width: 120px;
    border-bottom: none;
    height: 50px;
    line-height: 50px;
    font-size: 1.4em;
  }
 
  /* Option 1 - Display Inline */
  .nav li {
    display: inline-block;
    margin-right: -4px;
  }
 
  /* Options 2 - Float
  .nav li {
    float: left;
  }
  .nav ul {
    overflow: auto;
    width: 600px;
    margin: 0 auto;
  }
  .nav {
    background-color: #444;
  }
  */
}


section.hero {
  height: 75%;
  position: relative;
}

.hero-content {
  position: absolute;
  top: 50%;
  transform: translateY(5%);
  width: 100%;
}


.bgimg {
  /* The image used */
    background-image: url("bg.jpg");

    /* Set a specific height */
    height: 100%;

    /* Position and center the image to scale nicely on all screens */
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    position: relative;
}
.back .caption:before{
  border-top: 1px solid #fff;
  border-bottom: 1px solid #fff;
  transform: scale(0,1);
}

.back .caption:after{
  border-right: 1px solid #fff;
  border-left: 1px solid #fff;
  transform: scale(1,0);
}

.card.flipped .back .caption:before,
.card.flipped .back .caption:after {
  opacity: .9;
  transform: scale(1);  
}

.back dl{
  font-family:'Lato', Arial, sans-serif;
  font-weight:300;
  bottom:40px;
  left:40px;
  position: absolute;
  opacity: 0;
  transition: opacity .35s, transform .35s;
  transition-delay: .85s;
  transform: translate3d(-40px,0,0);
}

.card.flipped .back dl {
  opacity: 1;
  transform: translate3d(0,0,0);
}

dl dt{
  float: left;
  width: 60px;
  overflow: hidden;
  clear: left;
  text-align: right;
  font-weight:700;
}

dl dd{
  margin-left: 80px;
  text-align:left;
}

dl dd:before,
dl dd:after{
  display: table;
  content: " ";
}

dl dd:after{
  clear: both;
}

.front:hover p {
  opacity: 1;
  transform: translate3d(0,0,0);
}

figure a{
  z-index: 1000;
  text-indent: 200%;
  white-space: nowrap;
  font-size: 0;
  opacity: 0;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

@media (min-width: 450px) {
  .container{
    left: 50%;
    margin-left:-225px;
  }
}



body {
  background-color: #0F211E;

}

.recipe-card {
    border-top: 15px solid lightblue; 
    border-bottom: 50px solid red;
  background: #fff;
  margin: 0 auto;
  width: 90%;
  max-width: 496px;
  border-top-left-radius: 5px;
  border-top-right-radius: 5px;
  border-bottom-left-radius: 5px;
  border-bottom-right-radius: 5px;
}


.card-top {
  padding: 30px 15px;
  display: flex;
}

.card-top .right {
  padding-left: 20px;
}
<html>
<head>

<title>Portfolio</title>

<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.13/css/all.css" integrity="sha384-DNOHZ68U8hZfKXOrtjWvjxusGo9WQnrNx2sqG0tfsghAvtVlRW3tvkXWZh58N9jp" crossorigin="anonymous">
<link href="https://fonts.googleapis.com/css?family=Oswald" rel="stylesheet">

<link rel="stylesheet" href="style.css">
</style>

</head>

<body class="news" >


<header>

	<div class="nav">
		<ul>
			<li class="two"><a href="#"> <span>About</span></a></li>
			<li class="three"><a class="active" href="#">Projects</a></li>
			<li class="four"><a href="#">Skills</a></li>
		</ul>
	</div>
</header>


<section class="hero">
	<div class="bgimg">
	</div>	


	<div class="hero-content">
		<div class="recipe-card">

			<aside>
				<div class="card-top">
					<div class="left">
						<img src="myAvatar.png" class="myavatar">
					</div>
					<div class="right">
						<h1>Hamza Wahbi</h1>
						<hr class="hrunder">
						<h5 style="color:#8B8B8B " >Web Developer</h5>
						<h1>Age: <font color="#8B8B8B">13</font></h1>
						<h1>Email: <font color="#8B8B8B">fxgfnxngfx@gmail.com</font></h1>
						<h1>Phone: <font color="#8B8B8B">0093836372</font></h1>
					</div>

				</div>

			</aside>
    <div style="position: fixed; bottom:0;">
				<i class="fab fa-twitter fa-3x" style="color: black;"></i>
				<i class="fab fa-instagram fa-3x" style="color: black;"></i>
				<i class="fab fa-dribbble fa-3x" style="color: black;"></i>
				<i class="fab fa-facebook-f fa-3x" style="color: black;"></i>
				<i class="fab fa-snapchat-ghost fa-3x" style="color: black;"></i>
				<i class="fab fa-google-plus-g  fa-3x" style="color: black;"></i>
                <i class="fab fa-youtube fa-3x" style="color: black;"></i>
                <i class="fab fa-pinterest-p fa-3x" style="color: black;"></i>
  </div>
		</div>

	</div><!-- .hero-content -->

</section>

</div>






</html>

答案 3 :(得分:1)

body {
  margin: 0;
  padding: 0;
  font-family: 'Oswald', sans-serif;
  background-color: #0F211E;
}

.red {
  color: red;
}

.icon-div{
   background-color: red;
   justify-content: space-evenly;
   display: flex;
   padding: 4px;
}

.icon-div i{
  color: #fff;;
}

.underline {
  text-decoration: underline;
}

.nav ul {
  list-style: none;
  background-color: #0F211E;
  text-align: center;
  padding: 0;
  margin: 0;
}

.nav li {
  font-size: 1.2em;
  line-height: 40px;
  height: 40px;
  border-bottom: 1px solid #888;
}

.nav a {
  text-decoration: none;
  color: #fff;
  display: block;
  transition: .3s background-color;
  text-transform: uppercase;
}

.hero-image {
  
  height: 50%;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  position: relative;
}

@media screen and (min-width: 600px) {
  .nav li {
    width: 120px;
    border-bottom: none;
    height: 50px;
    line-height: 50px;
    font-size: 1.4em;
  }
  /* Option 1 - Display Inline */
  .nav li {
    display: inline-block;
    margin-right: -4px;
  }
  /* Options 2 - Float
  .nav li {
    float: left;
  }
  .nav ul {
    overflow: auto;
    width: 600px;
    margin: 0 auto;
  }
  .nav {
    background-color: #444;
  }
  */
}

section.hero {
  height: 75%;
  position: relative;
}

.hero-content {
  position: absolute;
  top: 50%;
  transform: translateY(5%);
  width: 100%;
}

.bgimg {
  /* The image used */
  background-image: url("bg.jpg");
  /* Set a specific height */
  height: 100%;
  /* Position and center the image to scale nicely on all screens */
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  position: relative;
}

.back .caption:before {
  border-top: 1px solid #fff;
  border-bottom: 1px solid #fff;
  transform: scale(0, 1);
}

.back .caption:after {
  border-right: 1px solid #fff;
  border-left: 1px solid #fff;
  transform: scale(1, 0);
}

.card.flipped .back .caption:before,
.card.flipped .back .caption:after {
  opacity: .9;
  transform: scale(1);
}

.back dl {
  font-family: 'Lato', Arial, sans-serif;
  font-weight: 300;
  bottom: 40px;
  left: 40px;
  position: absolute;
  opacity: 0;
  transition: opacity .35s, transform .35s;
  transition-delay: .85s;
  transform: translate3d(-40px, 0, 0);
}

.card.flipped .back dl {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

dl dt {
  float: left;
  width: 60px;
  overflow: hidden;
  clear: left;
  text-align: right;
  font-weight: 700;
}

dl dd {
  margin-left: 80px;
  text-align: left;
}

dl dd:before,
dl dd:after {
  display: table;
  content: " ";
}

dl dd:after {
  clear: both;
}

.front:hover p {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

figure a {
  z-index: 1000;
  text-indent: 200%;
  white-space: nowrap;
  font-size: 0;
  opacity: 0;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

@media (min-width: 450px) {
  .container {
    left: 50%;
    margin-left: -225px;
  }
}


.recipe-card {
  border-top: 15px solid lightblue;
  
  background: #fff;
  margin: 0 auto;
  width: 90%;
  max-width: 496px;
  border-top-left-radius: 5px;
  border-top-right-radius: 5px;
  border-bottom-left-radius: 5px;
  border-bottom-right-radius: 5px;
}

.card-top {
  padding: 30px 15px;
  display: flex;
}

.card-top .right {
  padding-left: 20px;
}
<html>

<head>

  <title>Portfolio</title>

  <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.13/css/all.css" integrity="sha384-DNOHZ68U8hZfKXOrtjWvjxusGo9WQnrNx2sqG0tfsghAvtVlRW3tvkXWZh58N9jp" crossorigin="anonymous">
  <link href="https://fonts.googleapis.com/css?family=Oswald" rel="stylesheet">

  <link rel="stylesheet" href="style.css">
  </style>

</head>

<body class="news">


  <header>

    <div class="nav">
      <ul>
        <li class="two">
          <a href="#"> <span>About</span></a>
        </li>
        <li class="three"><a class="active" href="#">Projects</a></li>
        <li class="four"><a href="#">Skills</a></li>
      </ul>
    </div>
  </header>


  <section class="hero">
    <div class="bgimg">
    </div>


    <div class="hero-content">
      <div class="recipe-card">

        <aside>
          <div class="card-top">
            <div class="left">
              <img src="myAvatar.png" class="myavatar">
            </div>
            <div class="right">
              <h1>Hamza Wahbi</h1>
              <hr class="hrunder">
              <h5 style="color:#8B8B8B ">Web Developer</h5>
              <h1>Age:
                <font color="#8B8B8B">13</font>
              </h1>
              <h1>Email:
                <font color="#8B8B8B">fxgfnxngfx@gmail.com</font>
              </h1>
              <h1>Phone:
                <font color="#8B8B8B">0093836372</font>
              </h1>
            </div>

          </div>

        </aside>
        
        <div class="icon-div">
        <i class="fab fa-twitter fa-3x" ></i>
        <i class="fab fa-instagram fa-3x" ></i>
        <i class="fab fa-dribbble fa-3x" ></i>
        <i class="fab fa-facebook-f fa-3x"></i>
        <i class="fab fa-snapchat-ghost fa-3x" ></i>
        <i class="fab fa-google-plus-g  fa-3x" ></i>
        <i class="fab fa-youtube fa-3x" ></i>
        <i class="fab fa-pinterest-p fa-3x" ></i>
        </div>
        
      </div>

    </div>
    <!-- .hero-content -->

  </section>

  </div>

</html>