Reputation: 375
If I want to remove the space between rows of two elements separated by a <br>
tag, how would I do that? The rows are too close one to other. How can I make like half of the height of the <br>
tag?
This is the code used
.tekst {
font-family: 'Bree Serif', serif;
color: #2980b9;
}
<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>
Upvotes: 20
Views: 96600
Reputation: 1
<div style="height:3px;"><br></div>
use whatever px you want use in html
example
<div style="height:5px;"><br></div>
<span style="font-size:3em; color:#ff0000;">
<strong>IMPORTANT</strong></span>
<div style="height:10px;"><br></div>
Upvotes: 0
Reputation: 1711
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;
}
Upvotes: 0
Reputation: 565
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" />
Upvotes: 15
Reputation: 1333
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.
Upvotes: 0
Reputation: 103790
You can use margins :
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 */
}
Upvotes: 3
Reputation: 505
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;" />
Upvotes: 29
Reputation: 17710
A few options:
margin-bottom
or padding-bottom
to the element on topmargin-top
to the selectThere are probably many other possibilities to achieve this.
Upvotes: 6