Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

css:how to get spaces in between 2 labels on the same line?

Tags:

html

css

i am trying to display a few labels with a fair bit of space in between them on the same line in an html document. This does work. How to get this working in a nicer way?

<div>
firstlabel &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp secondlabel

</div>
like image 800
user603007 Avatar asked Dec 15 '11 10:12

user603007


1 Answers

You could wrap your 'labels' in <span> tags, give them classes, and add margin with CSS.

Example here: http://jsfiddle.net/peduarte/Rf5kB/

HTML

<div>
    <span class="firstLabel">firstlabel</span>
    <span class="secondLabel">secondlabel</span>
</div>

CSS

.firstLabel {
    margin-right: 50px;
}
like image 110
peduarte Avatar answered Oct 25 '22 05:10

peduarte