Jump to content


Photo

How can I add an image to an input id="file" ?


  • Please log in to reply
2 replies to this topic

#1 Chrisj

Chrisj

    Advanced Member

  • Members
  • PipPipPip
  • 189 posts

Posted 26 June 2014 - 05:14 PM

I'm using an Upload Form and I believe this line of code, shown below, is what the attached image shows (see attached image).

 

How can I add a different image button to replace the "Choose File" button that's currently there?

 

Also, how can I put some space between the Choose File button and the "No File Chosen" function?

 

Thanks

<div class='controls'>
<input id="file" type="file" name="file" />
<?php //echo form_error('file');   ?></div>


#2 Azercii

Azercii

    Advanced Member

  • Members
  • PipPipPip
  • 47 posts
  • LocationUnited Kingdom
  • Age:22

Posted 29 June 2014 - 06:06 AM

You'd use css

input[type="submit"]
{
background: url(location here);
border: 0;
width: 180px;
height: 30px;
}


#3 Chrisj

Chrisj

    Advanced Member

  • Members
  • PipPipPip
  • 189 posts

Posted 01 July 2014 - 09:51 AM

Thank you for your reply.

Do I have to name your code something in CSS?






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com