Skip to content Skip to sidebar Skip to footer

Css: How To Make Circles Connected By Lines Responsive With Bootstrap?

I have the code which got me three circles connected by two lines. Have a look here: JSFIDDLE Here is my code: HTML
Copy

& less HTML

<div class="form-group">
    <div class="circle" style="float:left"></div>
    <div class="circle" style="float: right;"></div>
    <div class="circle"></div>
</div>

Solution 2:

The simplest solution contains two divs and two pseudo elements. position: absolute keeps the circles over the parents border and position: relative keeps the circles positioned relative to the parent.

Have an example!

HTML

<div class="parent"><div class="child"></div></div>

CSS

* {
  margin:0;
  padding:0;
}

.parent {
  margin:100px 0 0;
  width:100%;
  border-bottom:2px solid #CCC;
  position:relative;
  z-index:-1;
}

.parent:before,.parent:after,.child {
  background:#CCC;
  width:15px;
  height:15px;
  border-radius:50%;
  border:1px solid #CCC;
  position:absolute;
  content:'';
  top:-8px;
}

.parent:before {
  left:0;
}

.parent:after {
  right:0;
}

.child {
  left:50%;
  margin-left:-8px;
}

Solution 3:

Try this:

html:

<div class="responsive-circle"><i></i></div>

css:

.responsive-circle {
    height: 2px;
    background-color: #CCC;
    overflow: visible;
    position: relative;
}

.responsive-circle:before,
.responsive-circle:after,
.responsive-circle > i {
    background: #CCCCCC;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    border:1px solid #CCCCCC;
    position: absolute;
    content: "";
    top: -7px;
}

.responsive-circle:after {
    right: 0;
}

.responsive-circle > i {
    left: 50%;
    left: calc(50% - 9px);
}

demo: http://jsfiddle.net/m787ydjz/


Post a Comment for "Css: How To Make Circles Connected By Lines Responsive With Bootstrap?"