2016-03-25 16 views
1

Marj altının işe yaramayacağı, ancak kenar boşluğu ve kenar boşluğunun mükemmel çalıştığı bu çok sinir bozucu bir sorun yaşıyorum. Sadece farklı form alanları arasında bir boşluk istiyorum.CSS- Marj alt çalışma çalışmıyor

HTML

<input type="text" name="address2" id="address2" value="<?php echo $_SESSION['address2']; ?>" placeholder="Address Line 2" tabindex="5"> 
<br> 

<input type="text" name="city" id="city" value="<?php echo $_SESSION['city']; ?>"placeholder="Town/City" tabindex="6"> 
<br> 
<input type="text" name="pcode" id="pcode" value="<?php echo $_SESSION['pcode']; ?>" placeholder="Postcode" tabindex="7"> 

Bu çok uzun öylesine dan ı tüm alanları bu bana bir sorun veriyor alanlardır dahil değildir olması.

CSS

input#address2{ 
border: 1px solid #6d6e70; 
border-radius: 5px; 
width: 43%; 
height: 33px; 
display: inline-block; 
line-height: 33px; 
float: left; 
position: relative; 
margin-bottom: 10px; 
} 

input#city{ 
border: 1px solid #6d6e70; 
border-radius: 5px; 
width: 43%; 
height: 33px; 

line-height: 33px; 
float: left; 
margin-left: -431px; 
position: relative; 
margin-top: 10px; 
} 

input#pcode{ 
border: 1px solid #6d6e70; 
border-radius: 5px; 
width: 20%; 
height: 33px; 
line-height: 33px; 
float: left; 
margin-left: -431px; 
position: relative; 
margin-top: 10px;  
} 

cevap

1

Sen süzülüyor unsurları temizlemek için gerekir. See more

İhtiyacınız olan şey bu mu?

input#address2{ 
 
    border: 1px solid #6d6e70; 
 
    border-radius: 5px; 
 
    width: 43%; 
 
    height: 33px; 
 
    display: inline-block; 
 
    line-height: 33px; 
 
    float: left; 
 
    position: relative; 
 
    margin-bottom: 10px; 
 
} 
 

 
input#city{ 
 
    border: 1px solid #6d6e70; 
 
    border-radius: 5px; 
 
    width: 43%; 
 
    height: 33px; 
 
    line-height: 33px; 
 
    float: left; 
 
    position: relative; 
 
    margin-top: 10px; 
 
} 
 

 
input#pcode{ 
 
    border: 1px solid #6d6e70; 
 
    border-radius: 5px; 
 
    width: 20%; 
 
    height: 33px; 
 
    line-height: 33px; 
 
    float: left; 
 
    position: relative; 
 
    margin-top: 10px;  
 
} 
 
.clr { 
 
    clear: both; 
 
}
<input type="text" name="address2" id="address2" value="<?php echo $_SESSION['address2']; ?>" placeholder="Address Line 2" tabindex="5"> 
 
<div class="clr"></div> 
 
<input type="text" name="city" id="city" value="<?php echo $_SESSION['city']; ?>"placeholder="Town/City" tabindex="6"> 
 
<div class="clr"></div> 
 
<input type="text" name="pcode" id="pcode" value="<?php echo $_SESSION['pcode']; ?>" placeholder="Postcode" tabindex="7"> 
 
<div class="clr"></div>

+1

WOW! teşekkür ederim. Bunu yapabileceğini bilmiyordum bir şey öğrendim. Sadece 2 tane alan için şamandıra işlerini temizlemek artık neden emin, ama üzerinde okuyacağım. – jerneva

+0

Rica ederim. – Ferrrmolina