I am trying to replicate the below image
This is a placeholder image what I want for SEO purposes is to have three columns/boxes and center the small graphic associated with each box half over the box border and centered. Below is the code I have tried so far.
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
* {
box-sizing: border-box;
}
/* Create three equal columns that floats next to each other */
.column {
float: left;
width: 33.33%;
padding: 10px;
height: 300px; /* Should be removed. Only for demonstration */
}
/* Clear floats after the columns */
.row:after {
content: "";
display: table;
clear: both;
}
.container{
position:relative;
width:100%;
height:200px;
}
.image{
position:absolute;
top:0;
left:60%;
width:40%;
height:100%;
}
</style>
</head>
<body>
<h2>Three Equal Columns</h2>
<div class="row">
<div class="column" style="background-color:#aaa;">
<div class="container">
<center>
<img class="alignnone size-blogimage wp-image-6540"
src="https://service-works.com/wp-
content/uploads/2018/10/services_icons_website-2.png" alt=""
width="80" height="80"/>
</center> </div>
<p>Some text..</p>
</div>
<div class="column" style="background-color:#bbb;">
<h2>Column 2</h2>
<p>Some text..</p>
</div>
<div class="column" style="background-color:#ccc;">
<h2>Column 3</h2>
<p>Some text..</p>
</div>
I have also tried the following CSS
img {
vertical-align: middle;
line-height: 0.5;
}
2
Answers
try this
convert this
to
Try negative margin.
here is updated fiddle.