Reputation: 331
I need to draw 2 circle connected with css so that i will use flight search website if you can let me get you answer this is what i want
pure css or materializecss thanks
Upvotes: 0
Views: 1980
Reputation: 53674
This is the general idea using a single element and pseudo elements for the circles. Position them over the line, and use a background color in the circle that matches the background of the page
body {
padding: 2em;
}
div {
background: blue;
height: 1px;
position: relative;
}
div:before, div:after {
position: absolute;
top: 50%; left: 0;
transform: translateY(-50%);
content: '';
height: 1em; width: 1em;
border: 1px solid blue;
border-radius: 50%;
background: #fff;
}
div:after {
left: auto;
right: 0;
}
<div></div>
Or you can position the circles outside of the parent element instead of using a background image.
body {
padding: 2em;
}
div {
background: blue;
height: 1px;
position: relative;
}
div:before, div:after {
position: absolute;
top: 50%; left: 0;
transform: translate(-100%,-50%);
content: '';
height: 1em; width: 1em;
border: 1px solid blue;
border-radius: 50%;
}
div:after {
left: auto;
right: 0;
transform: translate(100%,-50%);
}
<div></div>
Upvotes: 2