473,395 Members | 2,079 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,395 software developers and data experts.

CSS and formating form elements

Hi,

I want to format buttons and textfields with css.
I've done it the following way in a css-file:

..button {background-color:black;
color:white;
height:20px;}

and used it with class="button" in the input tag. It only worked in
Opera, but not in the IE, Firefox and Netscape. It worked in all
browsers as I wrote the style definition directly in the html tag:
<input style="background-color:black;">...

Where is the problem? Why does it not work when I use the in an extern
css file.

Thanks
Mario

Jul 21 '05 #1
5 4318
in comp.infosystems.www.authoring.stylesheets, Mario Ospelt wrote:
Hi,

I want to format buttons and textfields with css.
I've done it the following way in a css-file:

.button {background-color:black;
color:white;
height:20px;}

and used it with class="button" in the input tag. It only worked in
Opera, but not in the IE, Firefox and Netscape. It worked in all
browsers as I wrote the style definition directly in the html tag:
<input style="background-color:black;">...

Where is the problem? Why does it not work when I use the in an extern
css file.


URL?

--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
Jul 21 '05 #2
On Mon, 20 Dec 2004 22:44:12 +0100, Mario Ospelt
<mo*****@student.ethz.ch> wrote:
I want to format buttons and textfields with css.
I've done it the following way in a css-file:

.button {background-color:black;
color:white;
height:20px;}

and used it with class="button" in the input tag. It only worked in
Opera, but not in the IE, Firefox and Netscape. It worked in all
browsers as I wrote the style definition directly in the html tag:
<input style="background-color:black;">...

Where is the problem? Why does it not work when I use the in an extern
css file.


Normally you can, so you must be doing something out of the ordinary.
Can't tell what unless you post a URL.

Steve

Jul 21 '05 #3
Sorry,

I had to put it online at first:

http://n.ethz.ch/student/mospelt/Igel7/index.html

Steve Pugh schrieb:
On Mon, 20 Dec 2004 22:44:12 +0100, Mario Ospelt
<mo*****@student.ethz.ch> wrote:

I want to format buttons and textfields with css.
I've done it the following way in a css-file:

.button {background-color:black;
color:white;
height:20px;}

and used it with class="button" in the input tag. It only worked in
Opera, but not in the IE, Firefox and Netscape. It worked in all
browsers as I wrote the style definition directly in the html tag:
<input style="background-color:black;">...

Where is the problem? Why does it not work when I use the in an extern
css file.

Normally you can, so you must be doing something out of the ordinary.
Can't tell what unless you post a URL.

Steve


Jul 21 '05 #4
On Mon, 20 Dec 2004 23:00:58 +0100, Mario Ospelt
<mo*****@student.ethz.ch> wrote:
Steve Pugh schrieb:
On Mon, 20 Dec 2004 22:44:12 +0100, Mario Ospelt
<mo*****@student.ethz.ch> wrote:
and used it with class="button" in the input tag. It only worked in
Opera, but not in the IE, Firefox and Netscape. It worked in all
browsers as I wrote the style definition directly in the html tag:
<input style="background-color:black;">...

Where is the problem? Why does it not work when I use the in an extern
css file.


Normally you can, so you must be doing something out of the ordinary.
Can't tell what unless you post a URL.

Sorry,

I had to put it online at first:

http://n.ethz.ch/student/mospelt/Igel7/index.html


Please don't top post, round here people prefer well trimmed inline
quoting and you'll get much better responses if you go with the flow.

You have an error in your CSS. A quick check with the validator would
have revealed this:
http://jigsaw.w3.org/css-validator/v...el7/index.html

It may or may not be the cause of your problem but until you fix it
there's no reason for other people to spend time tracking down the
error.

Likewise there are errors in your HTML:
http://validator.w3.org/check?uri=ht...set=iso-8859-1
Steve
Jul 21 '05 #5


Steve Pugh schrieb:
On Mon, 20 Dec 2004 23:00:58 +0100, Mario Ospelt
<mo*****@student.ethz.ch> wrote:
Steve Pugh schrieb:
On Mon, 20 Dec 2004 22:44:12 +0100, Mario Ospelt
<mo*****@student.ethz.ch> wrote:
and used it with class="button" in the input tag. It only worked in
Opera, but not in the IE, Firefox and Netscape. It worked in all
browsers as I wrote the style definition directly in the html tag:
<input style="background-color:black;">...

Where is the problem? Why does it not work when I use the in an extern
css file.

Normally you can, so you must be doing something out of the ordinary.
Can't tell what unless you post a URL.


Sorry,

I had to put it online at first:

http://n.ethz.ch/student/mospelt/Igel7/index.html

Please don't top post, round here people prefer well trimmed inline
quoting and you'll get much better responses if you go with the flow.

You have an error in your CSS. A quick check with the validator would
have revealed this:
http://jigsaw.w3.org/css-validator/v...el7/index.html

It may or may not be the cause of your problem but until you fix it
there's no reason for other people to spend time tracking down the
error.

Likewise there are errors in your HTML:
http://validator.w3.org/check?uri=ht...set=iso-8859-1
Steve


OK, Thanks a lot, I'll take care about these things in the future!!!
The css error was also responsible for my problem!

Mario

Jul 21 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Jamie Fryatt | last post by:
I have a querystring that passes through the value 001 for example, the form on the receiving page need to display that number but with 1 added to it. i have dim strnum strnum =...
1
by: Howard Jess | last post by:
Apparently, form elements of type <input type="image" src="...> are not included in the form's elements collection. I don't understand why not; according to DOM2, all form control elements...
3
by: Tom | last post by:
Is there any way to use conditional formating to change a control for a field in a continuous form to a textbox, option group or combobox depending on the value of another field on the form? On a...
6
by: Scott Natwick | last post by:
I'm trying to send an email from a Form. Here's what I have so far: MailMessage mail = new MailMessage(); mail.To = "me@mycompany.com"; mail.From = "you@yourcompany.com"; mail.Subject = "this...
3
by: Smiley | last post by:
Hi, I know how to do confitional formating in Excel by clicking the wizard. Is this possible in MS Access ? If so, please directly where to look. I found example but nothing as to how to do it....
0
by: Fonix | last post by:
I'm trying to make table border with pyExcelerator. As i can see there is only cell formating!? If i'm wrong pls tell me what is method to make more then one cell to have same format, other then...
2
by: sitko | last post by:
Hi, I'm in the process of converting a VB.net program into a C program so it can run on a unix like machine. I've been moving along at a nice pace, but this conversion has stumped me. I need...
0
by: Tyler | last post by:
I have a database with many subforms formated as "single forms". I am having trouble formating the forms so they display propers (fill the box on the main form, don't have scroll bars, don't have...
9
by: najmi | last post by:
hai guys...do you know how to formating the currency data from database into java form
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.