Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    Regular Coder
    Join Date
    Jul 2002
    Posts
    165
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question CSS on an input of type file

    Code:
    <style>
    .uploadBtn
    	{
    		font-size: 15px;
    		font-family: arial;
    		border : thin groove;
    	}
    </style>
    	<input type="file" name="filename" class="uploadBtn" size="30" id="file0" onclick="setId(this.id)">
    Hiya, I am trying to change the background color of the button created using an input of type file... all I've managed so far is setting the background of the input, any ideas welcome...

  • #2
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    try using "styles on fly", I mean styels defined by a JavaScript function, DOM mainly, i think is a better choise :-)

    document.getElemntById(id).style

    method
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #3
    Regular Coder
    Join Date
    Jul 2002
    Posts
    165
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thx, still nothing

    tried setting using getEl and doc all but same affect. oh well, jsut made it look cuter by making the font size of the whole object smaller

  • #4
    Regular Coder
    Join Date
    Aug 2003
    Posts
    383
    Thanks
    0
    Thanked 0 Times in 0 Posts
    &nbsp;........ another wild guess ........

  • #5
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    10,950
    Thanks
    0
    Thanked 236 Times in 233 Posts
    Note that it would only work in IE.

  • #6
    Master Coder
    Join Date
    Feb 2003
    Location
    UmeŚ, Sweden
    Posts
    5,575
    Thanks
    0
    Thanked 83 Times in 74 Posts
    Well, in moz the following syntax is used in it's internal stylesheets:

    input[type="file"]>input[type="text"]
    input[type="file"]>input[type="button"]

    I guess you could use that in the stylesheet, too. It's even entirely valid css, though a bit strange from the html/xhtml point of view.
    liorean <[lio@wg]>
    Articles: RegEx evolt wsabstract , Named Arguments
    Useful Threads: JavaScript Docs & Refs, FAQ - HTML & CSS Docs, FAQ - XML Doc & Refs
    Moz: JavaScript DOM Interfaces MSDN: JScript DHTML KDE: KJS KHTML Opera: Standards


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •