Javascript-форум (https://javascript.ru/forum/)
-   (X)HTML/CSS (https://javascript.ru/forum/xhtml-html-css/)
-   -   ПРОБЛЕМА С ИКОНКАМИ }:help: (https://javascript.ru/forum/xhtml-html-css/72086-problema-s-ikonkami-%7D-help.html)

daramylove 07.01.2018 22:10

ПРОБЛЕМА С ИКОНКАМИ }:help:
 
ВСЕМ ПРИВЕТ, ПОДСКАЖИТЕ ПОЧЕМУ ИКОНКИ НАХОДЯТСЯ ПОД ЭЛЕМЕНТОМ :before ? И КАК ЭТО МОЖНО ИСПРАВИТЬ ?

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>about</title>
	<link rel="stylesheet" type="text/css" href="css/style.css">
	<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
</head>
<body>
	<div class="wrap">
		<div class="social">
			<ul>
				<li><a href=""><i class="fa fa-facebook" aria-hidden="true"></i></a></li>
				<li><a href=""><i class="fa fa-instagram" aria-hidden="true"></i></a></li>
				<li><a href=""><i class="fa fa-twitter" aria-hidden="true"></i></a></li>
				<li><a href=""><i class="fa fa-vk" aria-hidden="true"></i></a></li>
			</ul>
		</div>
	</div>
</body>
</html>


Код:

* {
        padding: 0;
        margin: 0;
}

body {
        padding: 0;
        margin: 0;
}

ul {
        padding: 0;
        margin: 0;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%,-50%);
}

ul li {
        list-style-type: none;
}

ul li a {
        position: relative;
        text-decoration: none;
        width: 40px;
        height: 40px;
        text-align: center;
        line-height: 40px;
        display: block;
        margin: 10px;
        border: 1px solid #232323FF;
        overflow: hidden;
        transition: .2s;
}

ul li a .fa {       
}

ul li a::before {
        content: '';
        position: absolute;
        width: 100%;
        height: 100%;
        background: #81F0C9FF;
        bottom: -100%;
        left: 0;
        transition: .2s;
}

ul li a:hover::before {
        bottom: 0;


рони 07.01.2018 22:29

daramylove,
цвета странные ...
Цитата:

Сообщение от daramylove
background: #81F0C9FF;

Цитата:

Сообщение от daramylove
И КАК ЭТО МОЖНО ИСПРАВИТЬ ?

ul li a::before {
content: '';
position: absolute;
width: 100%;
height: 100%;
background: #B8DEFF;
bottom: -100%;
left: 0;
transition: .2s;
z-index: -1;
}

рони 07.01.2018 22:36

daramylove,
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>about</title>
  <link rel="stylesheet" type="text/css" href="css/style.css">
  <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
  <style type="text/css">*{
    padding:0;
    margin:0;
  }

  body{
    padding:0;
    margin:0;
  }

  ul{
    padding:0;
    margin:0;
    position:absolute;
    top:50%;
    left:50%;
    transform:translate(-50%,-50%);
  }

  ul li{
    list-style-type:none;
  }

  ul li a{
    position:relative;
    text-decoration:none;
    width:40px;
    height:40px;
    text-align:center;
    line-height:40px;
    display:block;
    margin:10px;
    border:1px solid #0000CD;
    overflow:hidden;
    transition:.2s;
  }

  ul li a .fa{
    color:#0000CD;
  }

  ul li a::before{
    content:'';
    position:absolute;
    width:100%;
    height:100%;
    background:#0067C2;
    bottom:-100%;
    left:0;
    transition:.2s;
    z-index:-1;
  }

  ul li a:hover::before{
    bottom:0;
  }

  ul li a:hover .fa{
    color:#FFFFFF;
  }
  </style>
</head>
<body>
  <div class="wrap">
    <div class="social">
      <ul>
        <li><a href=""><i class="fa fa-facebook" aria-hidden="true"></i></a></li>
        <li><a href=""><i class="fa fa-instagram" aria-hidden="true"></i></a></li>
        <li><a href=""><i class="fa fa-twitter" aria-hidden="true"></i></a></li>
        <li><a href=""><i class="fa fa-vk" aria-hidden="true"></i></a></li>
      </ul>
    </div>
  </div>
</body>
</html>


Часовой пояс GMT +3, время: 12:31.