0

I am trying to put a margin in left and right of the rhombus but couldn't.

Basically I am styling < hr > in to a custom styled hr

Code:

<div class="container">
    <hr class="square gold">
    <p>some text</p>
</div>

Demo :http://jsfiddle.net/squidraj/03xw85w0/

Any help is highly appreciated. Thanks in advance.

Raj
  • 1,377
  • 6
  • 23
  • 48

1 Answers1

2

Basically, you can't do this with an hr...you would have to use a span or some such other element.

Then you can follow the techniques as detailed in the linked question HERE.

body {
  text-align: center;
}
.divider {
  width: 70%;
  margin: 20px auto;
  overflow: hidden;
  text-align: center;
  line-height: 1.2em;
  display: inline-block;
}
.divider:before,
.divider:after {
  content: "";
  vertical-align: top;
  display: inline-block;
  width: 50%;
  height: 0.65em;
  border-bottom: 1px solid black;
  margin: 0 2% 0 -55%;
}
.divider:after {
  margin: 0 -55% 0 2%;
}
<span class="divider">◊◊</span>
Community
  • 1
  • 1
Paulie_D
  • 107,962
  • 13
  • 142
  • 161