This is the result I have so far:
I have as doubt how it would be possible to make the image be above the line that hides it.
This is my code:
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Open Sans', sans-serif;
color: #ffffff;
font-weight: 400;
font-size: 16px;
line-height: 1.7;
}
.container {
height: 95vh;
}
.header {
background-image: linear-gradient(to right bottom, rgb(97, 166, 14, .7), rgb(0, 73, 135, .7));
/*url(img/fondo.jpg);*/
background-size: cover;
background-position: top;
clip-path: polygon(0 0, 100% 0, 100% 60%, 0 100%);
}
.header .logo-box img {
height: 5vh;
}
.imagen-data .img-data {
max-width: 100%;
}
.data-planning {
text-align: center;
}
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<!-- fonts -->
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,700,800&display=swap" rel="stylesheet">
<!-- css -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<link rel="stylesheet" href="estilos.css">
<title>Data Planning</title>
</head>
<body>
<header class="header">
<div class="container">
<div class="row d-flex align-items-center mt-4">
<div class="col-4 data-planning">
<h1>Data Planning</h1>
<p>Lorem, ipsum dolor sit amet consectetur adipisicing elit. Unde, totam?.</p>
<button type="button" class="btn btn-primary">Empezemos</button>
</div>
<div class="col-8 imagen-data">
<img src="https://placehold.it/400x400" alt="data" class="img-data">
</div>
</div>
</div>
</header>
</body>
</html>
The problem you are encountering is because with
clip-path
itoverflow
it will always be hidden. So the image will always be cut by the diagonal line.To avoid this you can opt for several alternatives:
Try to mimic the behavior of
clip-path
using backgrounds and gradients (you already have one, but you can have more than one and they will overlap). This can be a bit tricky as you will have to play around with the values a bit to get it how you want it.Use pseudo-elements to put the background you want and cut it out. This way, the content of the
header
will not be cut off by theclip-path
.You should use the CSS property
z-index
which receives a number as its value, the higher the value then it will place this element above its predecessor; namely:The Div:
The above will cause it to be seen above the div that contains the
h1
one that says Data Planning