Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Diff CSS styles for diff INPUT TYPE='s?

Reply
Thread Tools

Diff CSS styles for diff INPUT TYPE='s?

 
 
A Traveler
Guest
Posts: n/a
 
      08-31-2004
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.


 
Reply With Quote
 
 
 
 
Hermit Dave
Guest
Posts: n/a
 
      08-31-2004
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" <hitchhikersguideto-> wrote in message
news:#...
> 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.
>
>



 
Reply With Quote
 
 
 
 
Thomas Dodds
Guest
Posts: n/a
 
      08-31-2004
use CSS classes then use each unique class with each *type* of input ...


"A Traveler" <hitchhikersguideto-> wrote in message
news:%...
>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.
>



 
Reply With Quote
 
A Traveler
Guest
Posts: n/a
 
      08-31-2004
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" <> wrote in message
news:%...
> 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" <hitchhikersguideto-> wrote in message
> news:#...
>> 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.
>>
>>

>
>



 
Reply With Quote
 
Hermit Dave
Guest
Posts: n/a
 
      08-31-2004
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" <hitchhikersguideto-> wrote in message
news:#...
> 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" <> wrote in message
> news:%...
> > 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" <hitchhikersguideto-> wrote in message
> > news:#...
> >> 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.
> >>
> >>

> >
> >

>
>



 
Reply With Quote
 
PJ
Guest
Posts: n/a
 
      08-31-2004
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" <hitchhikersguideto-> wrote in message
news:%...
> 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" <> wrote in message
> news:%...
> > 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" <hitchhikersguideto-> wrote in message
> > news:#...
> >> 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.
> >>
> >>

> >
> >

>
>



 
Reply With Quote
 
Steve Fulton
Guest
Posts: n/a
 
      08-31-2004
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[ANN] Diff::LCS 1.1.0, Diff::LCS 1.0.4 Austin Ziegler Ruby 3 08-09-2004 06:34 AM
diff Process under diff users Cyril Vi?ville Perl 1 06-29-2004 06:22 PM
Same sessionID retuned to diff browsers in diff machines Berrucho ASP .Net 2 12-05-2003 02:23 PM
Re: Server.Transfer in HttpHandler causes CSS styles to be ignored Jeff Marken ASP .Net 1 10-16-2003 05:14 AM
Re: Server.Transfer in HttpHandler causes CSS styles to be ignored Jerry III ASP .Net 0 10-15-2003 07:48 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57