How to put bull inside css circle - html

I need to create a line with a few circles inside and with a dot inside these circles.. They should look like radio buttons - how can I align the dot vertically?
JSfiddle
HTML
<div class="round" id="round-vertically">
<div class="circle img1" id="circle-star"><span>•</span></div>
<div class="circle-line"></div>
<div class="circle img2" id="circle-key"><span>•</span></div>
<div class="circle-line"></div>
<div class="circle img3" id="circle-cursor"><span>•</span></div>
<div class="circle-line"></div>
<div class="circle img4" id="circle-mobile"><span>•</span></div>
</div>

Don't use characters, create it by css:
HTML:
<div class="eye"></div>
CSS:
.eye{
border: 2px solid red;
border-radius: 100%;
position: relative;
width: 2em; height: 2em;
}
.eye::before{
content: "";
display: block;
position: absolute;
width: 1em; height: 1em;
top: 50%; left: 50%;
transform: translate(-50%, -50%);
background: red;
border-radius: 100%;
}
http://codepen.io/anon/pen/ZOaBKg

Flexbox can do that:
.circle {
width: 15px;
height: 15px;
border: 1px #d3d4de solid;
margin: auto;
display: flex;
justify-content: center;
align-items: center;
}
.circle-line {
width: 1px;
background-color: #d3d4de;
height: 191px;
margin: auto;
}
.circle {
width: 15px;
height: 15px;
border: 1px #d3d4de solid;
margin: auto;
display: flex;
justify-content: center;
align-items: center;
}
#round-vertically {
padding-top: 95px;
}
#round-vertically SPAN {
color: #d3d4de;
text-align: center;
font-size: 30px;
}
.circle {
border-radius: 50%;
}
<div class="round" id="round-vertically">
<div class="circle img1" id="circle-star"><span>•</span>
</div>
<div class="circle-line"></div>
<div class="circle img2" id="circle-key"><span>•</span>
</div>
<div class="circle-line"></div>
<div class="circle img3" id="circle-cursor"><span>•</span>
</div>
<div class="circle-line"></div>
<div class="circle img4" id="circle-mobile"><span>•</span>
</div>
</div>

One approach is by using translate css property
#round-vertically SPAN {
color: #d3d4de;
font-size:30px;
left: 50%;
position: absolute;
font-size: 30px;
top: 50%;
transform: translate(-50%,-50%);
}
Updated fiddle

You can try below code:
Working demo
.circle {
width: 15px;
height: 15px;
border:1px #d3d4de solid;
margin: auto;
position:relative;
}
#round-vertically SPAN {
color: #d3d4de;
text-align:center;
font-size:30px;
position:absolute;
top:50%; left:50%;
transform: translate(-50%, -50%);
}

Add text-align:center in class 'circle'. Use line-height property line-height: 50%. See below snippet:
.circle-line {
width: 1px;
background-color: #d3d4de;
height: 191px;
margin: auto;
}
.circle {
width: 15px;
height: 15px;
border:1px #d3d4de solid;
margin: auto;
text-align: center;
}
#round-vertically {
padding-top:95px;
}
#round-vertically SPAN {
color: #d3d4de;
font-size:30px;
line-height: 50%
}
.circle {
border-radius: 50%;
}
<div class="round" id="round-vertically">
<div class="circle img1" id="circle-star"><span>•</span></div>
<div class="circle-line"></div>
<div class="circle img2" id="circle-key"><span>•</span></div>
<div class="circle-line"></div>
<div class="circle img3" id="circle-cursor"><span>•</span></div>
<div class="circle-line"></div>
<div class="circle img4" id="circle-mobile"><span>•</span></div>
</div>

Related

How can I center this image inside of this div?

How can I center this image that I have in this div in a way that it won't move the 'line' div? I want the line to be touching the top of the square too.
.black {
background: black;
}
.square {
width: 200px;
height: 500px;
margin: 37px auto;
border-radius: 2px;
}
.image {
height: 60px;
width: 60px;
}
.line {
width: 4px;
height: 500px;
background-color: red;
}
<div class="container">
<div class="square black">
<img class="image" src="https://c.neh.tw/thumb/f/720/5659673474629632.jpg">
<div class="wrapper">
<div class="line"></div>
<div class="rectangle"></div>
</div>
</div>
Here is one way to prevent it from disrupting the flow layout of your container:
you can make the container a position of relative, and the image a position of absolute, positioned off the top and left by 50%, then transform it so that the center of the image is in the center position.
You could also just make the image a background-image of the div instead of using an image element, which may be easier to manipulate.
.black {
background: black;
}
.square {
position: relative;
width: 200px;
height: 500px;
margin: 37px auto;
border-radius: 2px;
}
.image {
height: 60px;
width: 60px;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.line {
width: 4px;
height: 500px;
background-color: red;
}
<div class="container">
<div class="square black">
<img class="image" src="https://c.neh.tw/thumb/f/720/5659673474629632.jpg">
<div class="wrapper">
<div class="line"></div>
<div class="rectangle"></div>
</div>
</div>
</div>
I'm not sure I understand your exact desired end goal. But, if I understand correctly, you could create a flex parent to justify the image, and then position the line absolutely within that. See -
.black {
background: black;
}
.square {
width: 200px;
height: 500px;
margin: 37px auto;
border-radius: 2px;
overflow: hidden;
display: flex;
align-items: center;
justify-content: center;
position: relative;
}
.image {
height: 60px;
width: 60px;
}
.line {
width: 4px;
background-color: red;
position: absolute;
left: 0;
top: 0;
bottom: 0
}
<div class="square black">
<div class="line"></div>
<img class="image" src="https://c.neh.tw/thumb/f/720/5659673474629632.jpg">
</div>
You can just use these css for .square and .image
.square {
width: 200px;
height: 500px;
margin: 37px auto;
border-radius: 2px;
position: relative;
}
.image {
height: 60px;
width: 60px;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}
You can easily center a image by using CSS position absolute. By making the position of square black class "absolute" and apply to properties "top: 45%;" and "left: 47%" . By applying this your problem will be definitely solve.
.black {
background: black;
}
.square {
display: flex;
align-item: center;
justify-content: center;
width: 200px;
height: 500px;
border-radius: 2px;
}
.image {
height: 60px;
width: 60px;
}
<div class="container">
<div class="square black">
<img class="image" src="https://c.neh.tw/thumb/f/720/5659673474629632.jpg">
</div>
</div>
.black {
background: black;
}
.square {
position: absolute;
top: 45%;
left: 47%;
width: 200px;
height: 500px;
margin: 37px auto;
border-radius: 2px;
}
.image {
height: 60px;
width: 60px;
position: absolute;
top:50%;
left:50%;
}
.line {
width: 4px;
height: 500px;
background-color: red;
}
<div class="container">
<div class="square black">
<img class="image" src="https://c.neh.tw/thumb/f/720/5659673474629632.jpg">
<div class="wrapper">
<div class="line"></div>
<div class="rectangle"></div>
</div>
</div>
.black {
background: black;
}
.square {
width: 200px;
height: 500px;
margin: 37px auto;
border-radius: 2px;
}
.image {
height: 60px;
width: 60px;
}
.line {
width: 4px;
height: 500px;
background-color: red;
}
<div class="container">
<div class="square black">
<img class="image" src="https://c.neh.tw/thumb/f/720/5659673474629632.jpg">
<div class="wrapper">
<div class="line"></div>
<div class="rectangle"></div>
</div>
</div>

Vertical Bar Chart - HTML and CSS

I am trying to do a vertical bar chart like this
But I am getting like this
At bottom of my vertical bar chart, both lines are attached together, I am trying to fix that.
I am trying to set that 0 line down but it's attached
And for example, bar height should get increase 25% if we give height: 25%; on inline CSS.
.barchart-Wrapper {
display: table;
position: relative;
margin: 20px 0;
height: 252px;
}
.barChart-Container {
display: table-cell;
width: 100%;
height: 100%;
padding-left: 15px;
}
.barchart {
display: table;
table-layout: fixed;
height: 100%;
width: 100%;
border-bottom: 3px solid tomato;
}
.barchart-Col {
position: relative;
vertical-align: bottom;
display: table-cell;
height: 100%;
}
.barchart-Col + .barchart-Col {
border-left: 4px solid transparent;
}
.barchart-Bar {
position: relative;
height: 0;
transition: height 0.5s 2s;
width: 66px;
margin: auto;
}
.barchart-Bar:after {
content: attr(attr-height);
color: white;
position: absolute;
text-align: center;
width: 100%;
}
.barchart-BarFooter {
position: absolute;
text-align: center;
height: 10%;
width: 100%;
}
.barchart-BarFooter h3 {
color: darkred;
}
.barchart-TimeCol {
position: absolute;
top: 0;
height: 100%;
width: 100%;
}
.barchart-Time {
height: 25%;
vertical-align: middle;
position: relative;
}
.barchart-Time:after {
border-bottom: 3px solid black;
content: "";
position: absolute;
width: 100%;
left: 0;
top: 0em;
}
.barchart-TimeText {
position: absolute;
top: -8px;
z-index: 1;
background: white;
padding-right: 5px;
color: #4d4d4d;
font-size: 15px;
font-family: 'Avenir Medium';
}
.html-bar {
background-color: deepskyblue;
}
.css-bar {
background-color: greenyellow;
}
.js-bar {
background-color: peachpuff;
}
.python-bar {
background-color: darkolivegreen;
}
.java-bar {
background-color: cornflowerblue;
}
<div class="barchart-Wrapper">
<div class="barchart-TimeCol">
<div class="barchart-Time">
<span class="barchart-TimeText">125</span>
</div>
<div class="barchart-Time">
<span class="barchart-TimeText">100</span>
</div>
<div class="barchart-Time">
<span class="barchart-TimeText">75</span>
</div>
<div class="barchart-Time">
<span class="barchart-TimeText">50</span>
</div>
<div class="barchart-Time">
<span class="barchart-TimeText">25</span>
</div>
</div>
<div class="barChart-Container">
<div class="barchart">
<div class="barchart-Col">
<div class="barchart-Bar html-bar" style="height: 75%;"></div>
<div class="barchart-BarFooter">
<h3>HTML</h3>
</div>
</div>
<div class="barchart-Col">
<div class="barchart-Bar css-bar" style="height: 75%;"></div>
<div class="barchart-BarFooter">
<h3>CSS</h3>
</div>
</div>
<div class="barchart-Col">
<div class="barchart-Bar js-bar" style="height: 75%;"></div>
<div class="barchart-BarFooter">
<h3>JS</h3>
</div>
</div>
<div class="barchart-Col">
<div class="barchart-Bar python-bar" style="height: 75%;"></div>
<div class="barchart-BarFooter">
<h3>PYTHON</h3>
</div>
</div>
<div class="barchart-Col">
<div class="barchart-Bar java-bar" style="height: 75%;"></div>
<div class="barchart-BarFooter">
<h3>JAVA</h3>
</div>
</div>
</div>
</div>
</div>
I guess doing a small change will help. Updated barchart-Time height to be 20%. Given 100% as 125. I believe this makes sense
.barchart-Wrapper {
display: table;
position: relative;
margin: 20px 0;
height: 252px;
}
.barChart-Container {
display: table-cell;
width: 100%;
height: 100%;
padding-left: 15px;
}
.barchart {
display: table;
table-layout: fixed;
height: 100%;
width: 100%;
border-bottom: 3px solid tomato;
}
.barchart-Col {
position: relative;
vertical-align: bottom;
display: table-cell;
height: 100%;
}
.barchart-Col+.barchart-Col {
border-left: 4px solid transparent;
}
.barchart-Bar {
position: relative;
height: 0;
transition: height 0.5s 2s;
width: 66px;
margin: auto;
}
.barchart-Bar:after {
content: attr(attr-height);
color: white;
position: absolute;
text-align: center;
width: 100%;
}
.barchart-BarFooter {
position: absolute;
text-align: center;
height: 10%;
width: 100%;
}
.barchart-BarFooter h3 {
color: darkred;
}
.barchart-TimeCol {
position: absolute;
top: 0;
height: 100%;
width: 100%;
}
.barchart-Time {
height: 20%;
vertical-align: middle;
position: relative;
}
.barchart-Time:after {
border-bottom: 3px solid black;
content: "";
position: absolute;
width: 100%;
left: 0;
top: 0em;
}
.barchart-TimeText {
position: absolute;
top: -8px;
z-index: 1;
background: white;
padding-right: 5px;
color: #4d4d4d;
font-size: 15px;
font-family: 'Avenir Medium';
}
.html-bar {
background-color: deepskyblue;
}
.css-bar {
background-color: greenyellow;
}
.js-bar {
background-color: peachpuff;
}
.python-bar {
background-color: darkolivegreen;
}
.java-bar {
background-color: cornflowerblue;
}
<div class="barchart-Wrapper">
<div class="barchart-TimeCol">
<div class="barchart-Time">
<span class="barchart-TimeText">125</span>
</div>
<div class="barchart-Time">
<span class="barchart-TimeText">100</span>
</div>
<div class="barchart-Time">
<span class="barchart-TimeText">75</span>
</div>
<div class="barchart-Time">
<span class="barchart-TimeText">50</span>
</div>
<div class="barchart-Time">
<span class="barchart-TimeText">25</span>
</div>
</div>
<div class="barChart-Container">
<div class="barchart">
<div class="barchart-Col">
<div class="barchart-Bar html-bar" style="height: 75%;"></div>
<div class="barchart-BarFooter">
<h3>HTML</h3>
</div>
</div>
<div class="barchart-Col">
<div class="barchart-Bar css-bar" style="height: 50%;"></div>
<div class="barchart-BarFooter">
<h3>CSS</h3>
</div>
</div>
<div class="barchart-Col">
<div class="barchart-Bar js-bar" style="height: 75%;"></div>
<div class="barchart-BarFooter">
<h3>JS</h3>
</div>
</div>
<div class="barchart-Col">
<div class="barchart-Bar python-bar" style="height: 25%;"></div>
<div class="barchart-BarFooter">
<h3>PYTHON</h3>
</div>
</div>
<div class="barchart-Col">
<div class="barchart-Bar java-bar" style="height: 100%;"></div>
<div class="barchart-BarFooter">
<h3>JAVA</h3>
</div>
</div>
</div>
</div>
</div>
Have you tried padding/ margin on the h3 element?
Try this:
h3 {
margin-top: 10px;
}
If this doesn't work there wil be a run around like this:
h3 {
position: relative;
top: 10px
}
If neither of these solutions work, feel free to command below.

Vertically Align Divs

I am trying to vertically align a div in my code but with no success. This div contains sub divs. The first one
I want this to look like this :
but at the moment it is not aligned. This is my HTML code :
body {
display: block;
margin-left: auto;
margin-right: auto;
background: #f1f1f1;
}
.content {
float: left;
margin: 20px auto;
text-align: center;
width: 300px;
}
.content h1 {
text-transform: uppercase;
font-weight: 700;
margin: 0 0 40px 0;
font-size: 25px;
line-height: 30px;
}
.circle {
width: 100px;
height: 100px;
line-height: 100px;
border-radius: 50%;
/* the magic */
-moz-border-radius: 50%;
-webkit-border-radius: 50%;
text-align: center;
color: white;
font-size: 16px;
text-transform: uppercase;
font-weight: 700;
margin: 0 auto 20px;
}
.blue {
background-color: #052D72;
}
.green {
background-color: #16a085;
}
.red {
background-color: #e74c3c;
}
<div class="content">
<div class="circle blue"></div>
</div>
<div class="content">
<div class="circle blue">Blue</div>
<div class="circle blue"></div>
<div class="circle blue"></div>
<div class="circle blue"></div>
</div>
<div class="content">
<div class="circle blue"></div>
<div class="circle blue"></div>
</div>
So, in the .content I tried adding this :
vertical-align:baseline;
but I saw no difference.
Add display:inline-block & Remove float for #content
.content {
display: inline-block;
margin: 20px auto;
text-align: center;
vertical-align: middle;
width: 200px;
}
https://jsfiddle.net/k0fx384a/1/
EDIT with class: https://jsfiddle.net/k0fx384a/2/
You have used same #id with multiple elements. That is not allowed in HTML across all browsers(seems like IE and FF allow multiple #ids).
So just change all the occurances of id="content" to class="content" and the CSS should start working.
DEMO
change <div id="content"> to <div class="content"> so the styles will be applied.
If you want them both vertically and horizontally aligned, I would recommend using flex. This offers more flexibility and is more forward-facing.
Mozilla Docs on Flex
If you use the rules align-items and justify-content, you'll get magic workings. Check out an example: https://jsfiddle.net/vrad7yuj/
.container {
display: flex;
flex-direction: row;
height: 100%;
width: 100%;
border: 2px solid #f00;
}
.col {
border: 2px solid #00f;
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.ball {
border-radius: 50%;
border: 1px solid #0f0;
height: 60px;
width: 60px;
}
<div class="container">
<div class="col">
<div class="ball"></div>
</div>
<div class="col">
<div class="ball"></div>
<div class="ball"></div>
<div class="ball"></div>
<div class="ball"></div>
</div>
<div class="col">
<div class="ball"></div>
<div class="ball"></div>
</div>
</div>
Alternative, if you want to do this with a little count of codelines, you can use flexbox:
body {
display: flex;
margin-left: auto;
margin-right: auto;
background: #f1f1f1;
}
.content {
display: flex;
flex-direction: column;
margin: 20px auto;
text-align: center;
width: 300px;
}
.content h1 {
text-transform: uppercase;
font-weight: 700;
margin: 0 0 40px 0;
font-size: 25px;
line-height: 30px;
}
.circle {
width: 100px;
height: 100px;
line-height: 100px;
border-radius: 50%;
/* the magic */
-moz-border-radius: 50%;
-webkit-border-radius: 50%;
text-align: center;
color: white;
font-size: 16px;
text-transform: uppercase;
font-weight: 700;
margin: 0 auto 20px;
}
.blue {
background-color: #052D72;
}
.green {
background-color: #16a085;
}
.red {
background-color: #e74c3c;
}
<div class="content">
<div class="circle blue"></div>
</div>
<div class="content">
<div class="circle blue">Blue</div>
<div class="circle blue"></div>
<div class="circle blue"></div>
<div class="circle blue"></div>
</div>
<div class="content">
<div class="circle blue"></div>
<div class="circle blue"></div>
</div>
Take a look on flexbox: https://css-tricks.com/snippets/css/a-guide-to-flexbox/
Should just be an alternative solution and new knowledge for you. ;-) Cheers.

overflow-y is affecting overflow-x

I want the left column (#left) to have overflow-y: scroll and overflow-x: visible. However, the overflow-x ends up being scroll when I test it despite the code saying different. What am I doing wrong? Thanks.
$(document).ready(function(){
$("#title").click(function(){
$("#title").hide();
});
$("#one").click(function(){
$("#one").addClass("open");
$("#oneBottom").addClass("clicked");
$("#two").removeClass("open");
$("#twoBottom").removeClass("clicked");
$("#three").removeClass("open");
$("#threeBottom").removeClass("clicked");
$("#four").removeClass("open");
$("#fourBottom").removeClass("clicked");
$("#five").removeClass("open");
$("#fiveBottom").removeClass("clicked");
});
$("#two").click(function(){
$("#two").addClass("open");
$("#twoBottom").addClass("clicked");
$("#one").removeClass("open");
$("#oneBottom").removeClass("clicked");
$("#three").removeClass("open");
$("#threeBottom").removeClass("clicked");
$("#four").removeClass("open");
$("#fourBottom").removeClass("clicked");
$("#five").removeClass("open");
$("#fiveBottom").removeClass("clicked");
});
$("#three").click(function(){
$("#three").addClass("open");
$("#threeBottom").addClass("clicked");
$("#one").removeClass("open");
$("#oneBottom").removeClass("clicked");
$("#two").removeClass("open");
$("#twoBottom").removeClass("clicked");
$("#four").removeClass("open");
$("#fourBottom").removeClass("clicked");
$("#five").removeClass("open");
$("#fiveBottom").removeClass("clicked");
});
$("#four").click(function(){
$("#four").addClass("open");
$("#fourBottom").addClass("clicked");
$("#one").removeClass("open");
$("#oneBottom").removeClass("clicked");
$("#two").removeClass("open");
$("#twoBottom").removeClass("clicked");
$("#three").removeClass("open");
$("#threeBottom").removeClass("clicked");
$("#five").removeClass("open");
$("#fiveBottom").removeClass("clicked");
});
$("#five").click(function(){
$("#five").addClass("open");
$("#fiveBottom").addClass("clicked");
$("#one").removeClass("open");
$("#oneBottom").removeClass("clicked");
$("#two").removeClass("open");
$("#twoBottom").removeClass("clicked");
$("#three").removeClass("open");
$("#threeBottom").removeClass("clicked");
$("#four").removeClass("open");
$("#fourBottom").removeClass("clicked");
});
});
.open{
margin-left: 124% !important;
margin-top: 18% !important;
width: 187% !important;
height: 80% !important;
font-size: 250% !important;
}
.clicked{
border: red solid 3px !important;
}
html{
width: 100%;
height: 100%;
margin: 0px;
border: 0px;
}
body{
width: 100%;
height: 100%;
margin: 0px;
border: 0px;
}
#title{
height: 10%;
width: 100%;
margin-bottom: 1%;
background-color: rgba(0, 0, 255, 0.5);
}
h1{
text-align: center;
}
#left{
width: 30%;
height: 100%;
position: absolute;
overflow-y: scroll;
overflow-x: visible;
}
#right{
width: 70%;
height: 100%;
position: absolute;
margin-left: 30%;
border-left: solid 2px black;
}
.card{
height: 20%;
width: 80%;
margin-left: 10%;
position: absolute;
background-color: blue;
border-radius: 5px;
border: grey solid 2px;
}
.first{
margin-top: 6.5%;
}
#one{
background-color: green;
}
.second{
margin-top: 50%;
}
#two{
background-color: green;
}
.third{
margin-top: 93%;
}
#three{
background-color: green;
}
.fourth{
margin-top: 136%;
}
#four{
background-color: green;
}
.fith{
margin-top: 179%;
}
#five{
background-color: green;
}
#main{
width: 80%;
height: 80%;
margin-left: 10%;
margin-top: 7.5%;
background-color: white;
border-radius: 5px;
border: grey solid 3px;
opacity: 0.5;
}
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
</head>
<body>
<div id="title">
<h1>Blah Blah Blah</h1>
</div>
<div id="left">
<div class="card first" id="oneBottom">
<h1>Hello</h1>
<p>Heljaldf</p>
</div>
<div class="card first" id="one">
<h1>Hello</h1>
<p>Heljaldf</p>
</div>
<div class="card second" id="twoBottom">
<h1>Sup</h1>
</div>
<div class="card second" id="two">
<h1>Sup</h1>
</div>
<div class="card third" id="threeBottom">
</div>
<div class="card third" id="three">
</div>
<div class="card fourth" id="fourBottom">
</div>
<div class="card fourth" id="four">
</div>
<div class="card fith" id="fiveBottom">
</div>
<div class="card fith" id="five">
</div>
</div>
<div id="right">
<div id="main">
</div>
</div>
</body>
</html>
The issue you're having with #left is that you're mixing visible with scroll. Because you're mixing values it's going to treat visible as auto instead.
Check out the W3 documentation on this here: http://www.w3.org/TR/css3-box/#collapse-scroll

Positioning circle and line together for timeline

I would like to implement timeline part on my website.
I have picture how it should look but I can't think any good way to do it.
How it should look:
Actual code:
js fiddle
<div class="right ">
what should I put here to get that circle?
</div>
Most confusing part is how to get that circle and that line together?
Could anyone suggest anything?
Thank you.
You could use :after, changing the styles to your liking.
.border needs to be positioned non-statically.
.wrapper {
width: 1030px;
background-color: #534741;
height: 500px;
}
.right {
color: #fff;
width: 90%;
text-align: right;
padding: 10px 10px 0 0;
display: block;
}
.border {
border-bottom: 2px solid #000;
width: 50%;
float: right;
margin: 10px 140px 0 10px;
position: relative;
}
.border:after {
/* Position and border */
display: block;
content: '';
border: 2px solid #000;
position: absolute;
width: 32px;
right: -34px; /*** -(Width+Border) ***/
height: 32px;
bottom: -18px; /*** -((Height/2)+Border) ***/
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
border-radius: 50%;
}
.text {
float: right;
width: 300px;
margin-right: 90px;
}
<div class="wrapper">
<div class="right">
<h2>Text</h2>
</div>
<div class="right">
<h3>2014</h3>
</div>
<div class="right "></div>
<div class="right border"></div>
<div class="right text">
<p>Lorem ipsum doloremLorem ipsum doloremLorem ipsum doloremLorem ipsum doloremLorem ipsum dolorem</p>
</div>
</div>
JSFiddle
Try to make it with positioning and borer radius. Or simply use images.
.content-wrapper {
position: relative;
width: 400px;
margin-bottom: 30px;
}
.line .circle {
width: 50px;
height: 50px;
border-radius: 25px;
border: 1px solid black;
position: absolute;
top: -25px;
}
.line {
position: relative;
border-bottom: 1px solid black;
}
.odd .line {
margin-right: 50px;
}
.even .line {
margin-left: 50px;
}
.odd .circle {
right: -50px;
}
.even .circle {
left: -50px;
}
.content,
.header {
padding: 0 60px;
}
.odd .content,
.odd .header {
text-align: right;
}
.even .content,
.even .header {
text-align: left;
}
<div class="content-wrapper odd">
<div class="header">Some title</div>
<div class="line">
<div class="circle"></div>
</div>
<div class="content">Loerm ipsum dolerom</div>
</div>
<div class="content-wrapper even">
<div class="header">Some title</div>
<div class="line">
<div class="circle"></div>
</div>
<div class="content">Loerm ipsum dolerom</div>
</div>
Below code should work:
.box-with-circle {
width: 90%;
position: relative;
}
.box-with-circle .circle {
width: 40px;
height: 40px;
position: absolute;
top: 0;
left: 0;
margin -20px 0 0 -20px;
border: 1px solid #000;
background-color: #fff;
z-index: 1;
border-radius: 50%;
}
.box-with-circle hr {
position: relative;
top: 20px;
}
<div class="box-with-circle">
<div class="circle"></div>
<hr />
</div>