473,668 Members | 2,487 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Manipulating file input with CSS

14 New Member
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 5323
AricC
1,892 Recognized Expert Top Contributor
Check out this let me know if it helps.
Mar 8 '07 #2
masterofzen
14 New Member
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 Recognized Expert Top Contributor
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
562
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 dollar sign? Thanks in advance!
10
3279
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 'sizeof(char)'. It seems that I could use bitset<8> to represent a byte in my code --- if you have a better suggestion, I welcome it --- but that still leaves me with the question of how to write those bitsets to an image file as big-endian bytes...
2
2046
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 600M. I've tried every memory conservation trick I know in my conversion program, and a bunch I picked up from reading some of the MSDN C# blogs, but still my program ends up using hundreds and hundreds of megs of ram. It is also taking...
4
2117
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 of page load. What I would like to do is replace the "Dear Friend" in the textarea with the name of the friend once it is entered in the input. I don't really know where to start...
7
5874
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 mean "X" occurs once and "Y" occurs twice
2
1140
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 type="submit" value="submit" /> </form> If a user inputs "joe124", what code do i add in order for the form to submit "joe123@user.mysite.com"
2
1363
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 it, and then make it available to as a file-like object for use as input to a database module (psycopg2) that wants a file-like object (with read and readlines methods). I could write the manipulated file out to disk and then read it back in, but...
4
2489
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 disable button and other elemnets form. My question is how can I manipulate the formm element with out submiting it. The codeis display below. <input name="cars id="cars" type="checkbox" value="cars"> Airplanes , I am <select...
0
8462
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8799
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8586
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7401
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5681
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4205
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2792
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2026
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1786
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.