Make a half row break

前端 未结 6 1559
难免孤独
难免孤独 2021-02-07 12:03

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<

相关标签:
6条回答
  • 2021-02-07 12:39

    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.

    0 讨论(0)
  • 2021-02-07 12:40

    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 */
    }
    
    0 讨论(0)
  • 2021-02-07 12:47

    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" />

    0 讨论(0)
  • 2021-02-07 12:58

    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;" />
    
    0 讨论(0)
  • 2021-02-07 12:58

    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;
    }
    
    0 讨论(0)
  • 2021-02-07 12:59

    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.

    0 讨论(0)
提交回复
热议问题