0

i have tried designing my own input file base on this fiddle i need to align properly the button in input text of a bootstrap.

this is my code to design my input type. also the button of bootstrap is not aligning.

.forUplBtn {
    background-color:#427db8; 
    width:50px;

    display:inline-block;
    border: none;
    color: #fff; 
    padding:5px 20px 5px 20px;
    border:none;
    overflow:hidden;
    text-align:center;
    position:relative;
    margin:0;
}
.forUplBtn a{
    z-index:-1;
}



.forUplBtn input[type="file"]{
    /*margin-left:-145px;*/
    width: 100%;height:100%; position:absolute; left:0;top:0; opacity:0
}

2 Answers 2

1

Try adding vertical-align:top to .forUplBtn and add this for the upload button:

.uplPhot a button{
 vertical-align:top;
}
Sign up to request clarification or add additional context in comments.

Comments

1

Add the below css to your code

button {
     position: absolute;
     margin-left: -90px;
     width: 90px;
     margin-top:4px
 }

Check this Fiddle

Also check Jasny's fork Bootstrap for file upload, easy to integrate.

1 Comment

there is a space on top and left of the upload button..but thanks for the link

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.