воскресенье, 13 мая 2018 г.

CSS. Делаем пунктирную рамку с кружком в центре. 2 варианта




index.html
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<link rel="stylesheet" href="css/main.css">
</head>
<body>
<header>
<div class="overlay"></div>
<div class="header">
<div class="container">
<div class="box"></div>
</div>

<div class="container">
<div class="box2">
<span class="circle">
<i class="fa fa-caret-down"></i>
</span>
</div>
</div>
</div>
</header>

<script src="https://use.fontawesome.com/0279959ac4.js"></script>
</body>
</html>

main.css
header {
background: url(../img/bulgaria.jpg) no-repeat center top / cover;
height: 100vh; /* нужно задать такую высоту */
}

.header {
background: rgba(0,0,0,0.25);
height: 100px;
position: relative;
}

/* Делаем рамочку */
.box {
border: 1px dashed #fff;
height: 100px;
width: 500px;
margin: 0 auto;
position: relative;
margin-top: 15px;
}

/* Делаем стрелочку к рамке */
.box:before {
content: '';
display: block;
width: 30px;
height: 30px;
background: #fff;
border-radius: 50%;
position: absolute;
left: 50%;
margin-left: -15px;

}

/* Второй вариант */
.box2 {
border: 1px dashed #fff;
height: 100px;
width: 500px;
margin: 0 auto;
position: relative;
margin-top: 15px;
}

.circle {
display: block;
width: 30px;
height: 30px;
border: 1px dashed #fff;
border-radius: 50%;
text-align: center;
line-height: 30px;
color: #fff;
position: absolute;
left: 50%;
margin-left: -15px;
}

Комментариев нет:

Отправить комментарий

Materialize-css. Футер

Сделаем футер и прижмем к низу страницы. Документация: https://materializecss.com/footer.html