Solved

Adding Pipe Delimeter  between buttons in css

Posted on 2016-11-09
4
37 Views
Last Modified: 2016-11-14
How to adding Pipe Delimeter  between buttons in css
0
Comment
Question by:Member_2_7967608
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 9

Assisted Solution

by:Paweł
Paweł earned 250 total points
ID: 41880390
you could but the buttons in spans
give the span a padding
and then give them a left border or right border

or you could use css glyphs
https://css-tricks.com/snippets/html/glyphs/
| for |

check this out for example
http://codepen.io/chooch/pen/YpyQPv

or you could just use the | character between the buttons there's a bunch of ways to skin this cat.

<div>
  <button>my button</button>
  <span>|</span>
  <button>my button</button>
  <span>|</span>
  <button>my button</button>
  <span>|</span>
  <button>my button</button>
  <span>|</span>
  <button>my button</button>

</div>

Open in new window

0
 
LVL 56

Accepted Solution

by:
Julian Hansen earned 250 total points
ID: 41880690
There are two ways of doing this.
1. Using borders
2. Using :after and content: "|"
CSS
.piped span {
  border-left: 1px solid #ccc;
  padding: 0 10px;
}
.piped span:first-child {
  border-left: none;
  padding-left: 0;
}
.text-piped span:after {
  content: "|";
  margin: 0 10px;
}
.text-piped span:last-child:after {
  content: '';
  margin: 0 10px;
}

Open in new window

HTML
  <div class="piped">
    <span>One</span> <span>Two</span> <span>Three</span>
  </div>
  <div class="text-piped">
    <span>One</span> <span>Two</span> <span>Three</span>
  </div>

Open in new window

Working sample here
0
 

Author Closing Comment

by:Member_2_7967608
ID: 41886254
Thanks for the quick solution
0
 
LVL 56

Expert Comment

by:Julian Hansen
ID: 41886315
You are welcome.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

So you have coded your own WordPress plugin and now you want to allow users to upload images to a folder in the plugin folder rather than the default media location? Follow along and this article will show you how to do just that!
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…

735 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question