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

Diff CSS styles for diff INPUT TYPE='s?

I know in a css file, i can declare a style which will apply to a given HTML
tag, specifically, i am looking at an INPUT tag. Is there any way in which i
can create a style section which will apply to a specific *type* of input??
That is, a section which applies only to [input type=text] or only to [input
type=check] or whichever?

Thanks in advance.
Nov 18 '05 #1
6 1964
if you are using asp.net (assuming a. you have a cross posted and b posted
in asp.net yet... ie yes)
you use something called webcontrols. you can assign different styles to
different webcontrols.. yes even if they are of the same type like a textbox
control (which is rendered as input type = text

--

Regards,

Hermit Dave
(http://hdave.blogspot.com)
"A Traveler" <hi*********************@yahoo.com> wrote in message
news:#4**************@TK2MSFTNGP15.phx.gbl...
I know in a css file, i can declare a style which will apply to a given HTML tag, specifically, i am looking at an INPUT tag. Is there any way in which i can create a style section which will apply to a specific *type* of input?? That is, a section which applies only to [input type=text] or only to [input type=check] or whichever?

Thanks in advance.

Nov 18 '05 #2
use CSS classes then use each unique class with each *type* of input ...
"A Traveler" <hi*********************@yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
I know in a css file, i can declare a style which will apply to a given
HTML tag, specifically, i am looking at an INPUT tag. Is there any way in
which i can create a style section which will apply to a specific *type* of
input?? That is, a section which applies only to [input type=text] or only
to [input type=check] or whichever?

Thanks in advance.

Nov 18 '05 #3
This doesnt actually work. Here is what i have, in my CSS, there is an INPUT
{} section, then i also have a .noborder{} section. in the input, i declare
a certain type, so all my textboxes look the same. I then use the .noborder
class on my checkboxes, because the check boxes look a little dorky with the
extra border painted around them. Only thing is, the checkboxes STILL wind
up with the border as defined in input, even though they are overriden with
a specific class.

The textboxes and chkbxs are all [asp:textbox or [asp:checkbox. The reason
is, the CssClass property on the checkbox does not actually apply to the
ACTUAL checkbox. It applies rather to the combined control which ASP.NET
renders for a checkbox of a Checkbox and either a Literal control or a Label
(im not sure if its the Lit or Lbl).
"Hermit Dave" <he************@CAPS.AND.DOTS.hotmail.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
if you are using asp.net (assuming a. you have a cross posted and b posted
in asp.net yet... ie yes)
you use something called webcontrols. you can assign different styles to
different webcontrols.. yes even if they are of the same type like a
textbox
control (which is rendered as input type = text

--

Regards,

Hermit Dave
(http://hdave.blogspot.com)
"A Traveler" <hi*********************@yahoo.com> wrote in message
news:#4**************@TK2MSFTNGP15.phx.gbl...
I know in a css file, i can declare a style which will apply to a given

HTML
tag, specifically, i am looking at an INPUT tag. Is there any way in
which

i
can create a style section which will apply to a specific *type* of

input??
That is, a section which applies only to [input type=text] or only to

[input
type=check] or whichever?

Thanks in advance.


Nov 18 '05 #4
see it in action different controls having different stylesheets applied to
different controls
infact even the same type of controls

www.steptall.com

check the links near the shopping bag area. you can dig deeper if you wish.

--

Regards,

Hermit Dave
(http://hdave.blogspot.com)
"A Traveler" <hi*********************@yahoo.com> wrote in message
news:#3**************@TK2MSFTNGP09.phx.gbl...
This doesnt actually work. Here is what i have, in my CSS, there is an INPUT {} section, then i also have a .noborder{} section. in the input, i declare a certain type, so all my textboxes look the same. I then use the ..noborder class on my checkboxes, because the check boxes look a little dorky with the extra border painted around them. Only thing is, the checkboxes STILL wind
up with the border as defined in input, even though they are overriden with a specific class.

The textboxes and chkbxs are all [asp:textbox or [asp:checkbox. The reason
is, the CssClass property on the checkbox does not actually apply to the
ACTUAL checkbox. It applies rather to the combined control which ASP.NET
renders for a checkbox of a Checkbox and either a Literal control or a Label (im not sure if its the Lit or Lbl).
"Hermit Dave" <he************@CAPS.AND.DOTS.hotmail.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
if you are using asp.net (assuming a. you have a cross posted and b posted in asp.net yet... ie yes)
you use something called webcontrols. you can assign different styles to
different webcontrols.. yes even if they are of the same type like a
textbox
control (which is rendered as input type = text

--

Regards,

Hermit Dave
(http://hdave.blogspot.com)
"A Traveler" <hi*********************@yahoo.com> wrote in message
news:#4**************@TK2MSFTNGP15.phx.gbl...
I know in a css file, i can declare a style which will apply to a given

HTML
tag, specifically, i am looking at an INPUT tag. Is there any way in
which

i
can create a style section which will apply to a specific *type* of

input??
That is, a section which applies only to [input type=text] or only to

[input
type=check] or whichever?

Thanks in advance.



Nov 18 '05 #5
PJ
this is a css problem...it would be helpful if you actually included the
appropriate section of the stylesheet as well as the markup.

if you have a style defined for input like:

input {
border: 1px solid green;
background: #efefef;
}

this style will apply to all <input> elements. if you need to ovverride it
for a specific set of elements, use a class as you've done.

<input type="checkbox" class="check" />

..check {
border: none;
}

Note, the checkbox will have a background of #efefef because both styles
apply to the checkbox. However, the checkbox will not have a border,
because the class style specifically defines a border of "none."

"A Traveler" <hi*********************@yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
This doesnt actually work. Here is what i have, in my CSS, there is an INPUT {} section, then i also have a .noborder{} section. in the input, i declare a certain type, so all my textboxes look the same. I then use the ..noborder class on my checkboxes, because the check boxes look a little dorky with the extra border painted around them. Only thing is, the checkboxes STILL wind
up with the border as defined in input, even though they are overriden with a specific class.

The textboxes and chkbxs are all [asp:textbox or [asp:checkbox. The reason
is, the CssClass property on the checkbox does not actually apply to the
ACTUAL checkbox. It applies rather to the combined control which ASP.NET
renders for a checkbox of a Checkbox and either a Literal control or a Label (im not sure if its the Lit or Lbl).
"Hermit Dave" <he************@CAPS.AND.DOTS.hotmail.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
if you are using asp.net (assuming a. you have a cross posted and b posted in asp.net yet... ie yes)
you use something called webcontrols. you can assign different styles to
different webcontrols.. yes even if they are of the same type like a
textbox
control (which is rendered as input type = text

--

Regards,

Hermit Dave
(http://hdave.blogspot.com)
"A Traveler" <hi*********************@yahoo.com> wrote in message
news:#4**************@TK2MSFTNGP15.phx.gbl...
I know in a css file, i can declare a style which will apply to a given

HTML
tag, specifically, i am looking at an INPUT tag. Is there any way in
which

i
can create a style section which will apply to a specific *type* of

input??
That is, a section which applies only to [input type=text] or only to

[input
type=check] or whichever?

Thanks in advance.



Nov 18 '05 #6
A Traveler wrote:
I know in a css file, i can declare a style which will apply to a given
HTML tag, specifically, i am looking at an INPUT tag. Is there any way
in which i can create a style section which will apply to a specific
*type* of input??
That is, a section which applies only to [input type=text] or only to
[input type=check] or whichever?


input[type=text] { /* your styles here */ }

5.8 Attribute selectors
<URL:http://www.w3.org/TR/REC-CSS2/selector.html#attribute-selectors>

Unfortunately, this won't work in IE, even though the CSS2 spec is over
six years old! You can use it so that clients that implement the spec
will use your styles, but IE won't; or you can needlessly clutter your
HTML with code like:

<input type="text" class="text" ...>

and use a selector like

input.text { ... }

--
Steve

Liberty means responsibility. That is why most men dread it.
-George Bernard Shaw
Nov 18 '05 #7

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

Similar topics

3
by: Nick Allen | last post by:
After using ndiff from difflib, the function restore would return the sequence that generated the delta. Unfortunately, restore does not do the same for unified_diff. I do not see any similar...
8
by: Ryan Stewart | last post by:
Is there a way to reset the style property of an HTML element to some default or to all empty values? I have a group of elements whose style settings may be changed arbitrarily at certain points in...
5
by: Tony Brand | last post by:
Hi, Is there a way to force .NET to add styles to controls to display properties as set in the VS.NET designer? I'm using Visual Studio.NET 2002, and therefore 1.0 .NET framework. For example,...
4
by: Andreas Kasparek | last post by:
Hola! I'm preparing my master thesis about a XML Merge Tool implementation and was wondering if there is any open standard for XML diff regarding topics like: - is a diff result computed on...
1
by: sonicsoul | last post by:
Hi, i wanted to define default global styles that would be used by 90% of controls. I would like to differentiate input text controls from input button controls. is there a way to specify this in...
3
cassbiz
by: cassbiz | last post by:
Here is what I want to do, if possible. I have a reservation form, where one value (credit card number) needs to be run through an encryption script then get posted to the DB where all of the...
1
by: Lennart | last post by:
diff -u /home/system/db2inst1/nya/bin/db2filter.py ./db2filter.py --- /home/system/db2inst1/nya/bin/db2filter.py 2007-01-12 15:23:34.000000000 +0100 +++ ./db2filter.py 2007-04-14...
3
by: Amzul | last post by:
hello all, i have a form with 6 elemnt: <label><input type="radio" name="name_b" value="120x60" checked="checked"/>120x60</label><!-- #1 --> <input type="radio" name="name_b" value="468x60"...
6
by: Aaron Gray | last post by:
Hi, I am working on an HTML WYSISYG Wiki and need to display a diff page like WikiPedia does if two people edit a file at the same time to give the second user the diff. Basically with additions...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.