473,396 Members | 2,039 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Manipulating file input with CSS

Hi, everybody,

Got a question that's completely perplexing me.

I'm developing a site that uses a universal (or "star") selector on a global level, for many different pages. The star selector was not my doing and I have to live with it. It's very simple:

Expand|Select|Wrap|Line Numbers
  1. * {
  2.     padding: 0; margin: 0; border: 0;
  3. }
Now, obviously, because of this, I have to specifically set a border for form elements, or else they appear invisible. I haven't run into too many problems with this -- well, not too many problems I couldn't solve -- until now. I'm trying to insert a file input; you know, the kind that's a text input with a built-in browse button to find a file:

[HTML]<input type="file" id="browse" size="42"/>[/HTML]

I can get a border on this very easily using this code:

Expand|Select|Wrap|Line Numbers
  1. #browse { border: 1px solid #999; font-size: 11px; padding: 2px; margin-bottom: 1px; }
But! While it looks good in IE, in Firefox, unlike every other form element, the border appears with the full HTML shading scheme. In other words, applying any border information with CSS makes a border appear, but I don't get to choose which border. Now, all my research reveals that the file input features some of the fewest CSS styling options of any HTML element. But still, I managed to find some sites where a file input is appearing with just a plain, shading-free 1-pixel border in Firefox. When I noticed that those sites weren't using a universal selector to set a border, I took mine out temporarily, and the problem was fixed. Unfortunately, taking it out is not an option in the long run.

There has to be a solution to this -- right? Anything set globally must somehow be reversible on an individual element.

Any help would be greatly appreciated!
Mar 7 '07 #1
3 5311
AricC
1,892 Expert 1GB
Check out this let me know if it helps.
Mar 8 '07 #2
Ah, yes, I came across the link in that thread yesterday. But I was trying to avoid it! Was hoping there was something a little less hacky I could try, but I guess if there's no other option, that's the way to go.
Mar 8 '07 #3
AricC
1,892 Expert 1GB
Ah, yes, I came across the link in that thread yesterday. But I was trying to avoid it! Was hoping there was something a little less hacky I could try, but I guess if there's no other option, that's the way to go.
I've tried several different things this seems to be the best way I've seen so far.
Mar 9 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

12
by: agent349 | last post by:
Hi, I'm fairly new to c++. I need user input in the form of dollar amounts, ie: "$10.00". I'd like to remove the dollar sign "$" then store the rest in a variable. How do I go about removing the...
10
by: Kristian Nybo | last post by:
Hi, I'm writing a simple image file exporter as part of a school project. To implement my image format of choice I need to work with big-endian bytes, where 'byte' of course means '8 bits', not...
2
by: Segfahlt | last post by:
I have a fairly simple C# program that just needs to open up a fixed width file, convert each record to tab delimited and append a field to the end of it. The input files are between 300M and...
4
by: Greg Scharlemann | last post by:
Hey all, I'm working on setting up a "Send this link to a Friend" page. The page has a couple of inputs and a textarea. I have some default text in the textarea that is populated at the time...
7
by: MTD | last post by:
Hello, I'm wondering if there's a quick way of resolving this problem. In a program, I have a list of tuples of form (str,int), where int is a count of how often str occurs e.g. L = would...
2
by: one.1more | last post by:
Hello, Consider the following form <form method="get" action="http://domain.com/sample.php"> Enter first part of your email<input type="text" name="firstpart_email" value ="" size="20" /> <input...
2
by: Sean Davis | last post by:
This should be a relatively simple problem, but I haven't quite got the idea of how to go about it. I have a VERY large file that I would like to load a line at a time, do some manipulations on...
4
by: raknin | last post by:
Hi, I built a form in php that contains some check boxes and drop-down boxes and a Add button. What I want to do is manipulating the check box state (checked and uncheked state) in order to...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.