19

If i want to remove the space between rows of those two element's how would i do that. Example:

Example 1 http://pokit.org/get/img/6be8921b47ff746c1bf297cf87ab0950.jpg

If i remove the <br> it would be like this then this is how it looks like:

Example 2 http://pokit.org/get/img/1924cb8a9b344bb4f4eda1a98760fd3e.jpg

The rows are to close one to other. I wonder how can i make like half of the <br> tag . If you understand my question ?

The space between two rows should be less than in example 1. but higher then in example 2.

This is code used

    <span class="tekst">Sie besuchten Düsseldorf als:</span><br>
    <select name="posjeta" class="optiontekst">
        <option>- bitte wählen -</option>
        <option>Geschäftsreisende</option>
        <option>Privatperson</option>
    </select>
    <br><br>

And the class tekst

.tekst{
    font-family: 'Bree Serif', serif;
    color: #2980b9;
    }

I know i didn't explained well but i tried my best.

chris97ong
  • 6,870
  • 7
  • 32
  • 52
t3cho
  • 365
  • 1
  • 6
  • 18
  • 1
    While you're at it, might as well make the `` a label instead: `` and ` – misterManSam Jun 28 '14 at 14:58

7 Answers7

27

The <br> tag just adds in a standard line break to the document. You can adjust the size of the <br> element in your CSS:

  br {
    line-height: 10px;
 }

Or you can use a trick with <hr>; setting the height and making it invisible

<hr style="height:10px; visibility:hidden;" />
Syx
  • 485
  • 3
  • 10
12

If you only want to do it in one place, you can apply line-height directly to the
element as: <br style="line-height: 10px" />

Chuck Bevitt
  • 535
  • 4
  • 13
6

A few options:

  • add a margin-bottom or padding-bottom to the element on top
  • add a margin-top to the select

There are probably many other possibilities to achieve this.

jcaron
  • 17,302
  • 6
  • 32
  • 46
  • 1
    yes - or even a simple 'blank' block level div between would also work -
    Hopefully the user already has defined divs and can use those already in use.
    – B. Shea Oct 05 '18 at 17:38
6

This worked for me:-

<p style="margin:10px;"></p>
Amar Kumar
  • 2,392
  • 2
  • 25
  • 33
3

You can use margins :

DEMO

HTML :

 <span class="tekst">Sie besuchten Düsseldorf als:</span>
<select name="posjeta" class="optiontekst">
    <option>- bitte wählen -</option>
    <option>Geschäftsreisende</option>
    <option>Privatperson</option>
</select>
<br>
<br>

CSS :

.tekst {
    font-family:'Bree Serif', serif;
    color: #2980b9;
    display:block;
    margin-bottom:10px;   /* adapt the margin value to the desire space between span and select box */
}
web-tiki
  • 99,765
  • 32
  • 217
  • 249
2

add a margin-bottom span element

OR

add a margin-top to the select element

For example:

tekst {
     margin-bottom: 10px;
} 

OR

optiontekst {
    margin-top: 10px;
}
Kalpesh Prajapati
  • 1,703
  • 1
  • 12
  • 15
0

HTML :

<span class="tekst">Sie besuchten Düsseldorf als:</span>
    <select name="posjeta" class="optiontekst">
        <option>- bitte wählen -</option>
        <option>Geschäftsreisende</option>
        <option>Privatperson</option>
    </select>
    <br><br>

CSS :

.tekst{
    font-family: 'Bree Serif', serif;
    color: #2980b9;
    margin-bottom: 10px;
    padding-bottom: 10px;
    }

Try this code it will work for you.

J Prakash
  • 1,323
  • 8
  • 13