styling buttons without CLASS

Discussion in 'HTML' started by W. Paulisse, Sep 29, 2003.

  1. W. Paulisse

    W. Paulisse Guest

    hello!

    Is there a way to style ONLY a specific item without using a CLASS? For
    example the following styles all input types (submit,reset,text,password
    etc)

    input{color: #000000; font-family: tahoma;font-size: 8pt;}

    i would like for example JUST to style the types submit and/or reset but i
    don't want to define a CLASS in my CSS to use in every <input> tag.
    something like:

    input:submit{color: #000000; font-family: tahoma;font-size: 8pt;}

    Thanks,
    Wouter
    W. Paulisse, Sep 29, 2003
    #1
    1. Advertising

  2. W. Paulisse

    Steve Pugh Guest

    "W. Paulisse" <> wrote:

    >Is there a way to style ONLY a specific item without using a CLASS? For
    >example the following styles all input types (submit,reset,text,password
    >etc)
    >
    > input{color: #000000; font-family: tahoma;font-size: 8pt;}
    >
    >i would like for example JUST to style the types submit and/or reset but i
    >don't want to define a CLASS in my CSS to use in every <input> tag.
    >something like:
    >
    > input:submit{color: #000000; font-family: tahoma;font-size: 8pt;}


    input[type=submit] { styles }

    Guess what? No support in IE.

    Steve

    --
    "My theories appal you, my heresies outrage you,
    I never answer letters and you don't like my tie." - The Doctor

    Steve Pugh <> <http://steve.pugh.net/>
    Steve Pugh, Sep 29, 2003
    #2
    1. Advertising

  3. "W. Paulisse" <> wrote:

    > Is there a way to style ONLY a specific item without using a CLASS?


    Yes. The safest method is to use the ID attribute. But why wouldn't you
    use CLASS?

    > For example the following styles all input types
    > (submit,reset,text,password etc)
    >
    > input{color: #000000; font-family: tahoma;font-size: 8pt;}


    Well, it does, with the usual caveats. Quite a problem, isn't it?
    A font size of 8pt is unreadable to hundreds of millions of people.

    > i would like for example JUST to style the types submit and/or reset


    For reset buttons, the only sensible CSS declaration is, almost always,
    display: none. But it is simpler and safer to remove them.

    > but i don't want to define a CLASS in my CSS to use in every <input>
    > tag.


    You don't need to do that. Just define CLASS for the very element to which
    you wish to assign some properties. For example, <input type="submit"
    class="submit" ...> in HTML and
    input.submit { font-size: 120%; }
    in CSS. Of course, the class name need not be "submit".

    > something like:
    >
    > input:submit{color: #000000; font-family: tahoma;font-size:
    > 8pt;}


    Well, you could check the specifications (and Steve did that for you), but
    for styling just one element, using CLASS is the practical way. (You could
    alternatively use ID, but if you later wish to add another button on the
    page to be styled the same way, it's a little easier if you have used
    CLASS.)

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
    Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html
    Jukka K. Korpela, Sep 29, 2003
    #3
  4. W. Paulisse

    W. Paulisse Guest

    > input[type=submit] { styles }
    >
    > Guess what? No support in IE.
    >
    > Steve
    >



    well, classes it is then....

    that is acctualy the first time if encounterd that IE does not support a
    feature like that.....
    W. Paulisse, Sep 30, 2003
    #4
  5. W. Paulisse

    Adrienne Guest

    Gazing into my crystal ball I observed "W. Paulisse" <>
    writing in news:3f79734c$0$58700$4all.nl:

    >> input[type=submit] { styles }
    >>
    >> Guess what? No support in IE.
    >>
    >> Steve
    >>

    >
    >
    > well, classes it is then....
    >
    > that is acctualy the first time if encounterd that IE does not support a
    > feature like that.....
    >
    >
    >


    Another one - position:fixed (although there are hacks to work around it)

    --
    Adrienne Boswell
    Please respond to the group so others can share
    http://www.arbpen.com
    Adrienne, Oct 1, 2003
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Roshawn

    Styling a control

    Roshawn, Aug 20, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    350
    clintonG
    Aug 21, 2004
  2. =?Utf-8?B?Y2RiaWdncw==?=
    Replies:
    0
    Views:
    368
    =?Utf-8?B?Y2RiaWdncw==?=
    Mar 12, 2006
  3. ={ Advocated }=

    Styling a table

    ={ Advocated }=, Sep 15, 2003, in forum: HTML
    Replies:
    17
    Views:
    664
    ={ Advocated }=
    Sep 16, 2003
  4. e n | c k m a

    Styling radio buttons

    e n | c k m a, Dec 2, 2003, in forum: HTML
    Replies:
    4
    Views:
    594
    e n | c k m a
    Dec 3, 2003
  5. clintonG

    Styling CreateUserWizardStep Buttons?

    clintonG, May 22, 2006, in forum: ASP .Net Security
    Replies:
    1
    Views:
    344
    clintonG
    May 27, 2006
Loading...

Share This Page