Results 1 to 7 of 7

Thread: <input> and CSS

  1. #1
    Pixel Abuser Spunkey's Avatar
    Join Date
    Nov 2003
    Location
    Milton Keynes
    Posts
    1,523
    Thanks
    0
    Thanked
    0 times in 0 posts

    <input> and CSS

    hi all,

    ive got the basics of CSS down, but im just wondering is there any way to apply a style to different types of input controls?

    ie a textbox would have a white background, yet a submit button could have a blue one?

    i've tried INPUT:Text and INPUT:submit but no joy.

    I know I can define classes, but im just lazy and wondered if it was possible to access the control directly

    TIA

  2. #2
    Goat Boy
    Join Date
    Jul 2003
    Location
    Alexandra Park, London
    Posts
    2,428
    Thanks
    0
    Thanked
    0 times in 0 posts
    You can do something like this in your css file:

    .inputbutton {
    border-right: buttonshadow 1px solid;
    padding-right: 4px;
    border-top: buttonhighlight 1px solid;
    padding-left: 4px;
    padding-bottom: 0px;
    }

    .inputfield {
    font-size: 8pt;
    color: #333333;
    font-family: Verdana, Arial;
    }

    And then in the HTML just assign a style to the objects, so:

    <input type="textbox" class="inputfield"...>

    Kapish?
    "All our beliefs are being challenged now, and rightfully so, they're stupid." - Bill Hicks

  3. #3
    HEXUS.net Webmaster
    Join Date
    Jul 2003
    Location
    UK
    Posts
    3,108
    Thanks
    1
    Thanked
    0 times in 0 posts
    no, you have to define the class explicitly for the button e.g.

    body form input {
    background: #003366;}

    .submitButton {
    background: #eeeeee;}

  4. #4
    HEXUS.net Webmaster
    Join Date
    Jul 2003
    Location
    UK
    Posts
    3,108
    Thanks
    1
    Thanked
    0 times in 0 posts
    He knew that already beeny

    I know I can define classes
    sun going to your head mate

  5. #5
    HEXUS.net Webmaster
    Join Date
    Jul 2003
    Location
    UK
    Posts
    3,108
    Thanks
    1
    Thanked
    0 times in 0 posts
    oh and if it's any use your padding could be shortened to

    padding: 0 4px 0 4px;

    with the order of the values being top, right, bottom, left. You may already know that, just thought I'd mention in case

  6. #6
    Goat Boy
    Join Date
    Jul 2003
    Location
    Alexandra Park, London
    Posts
    2,428
    Thanks
    0
    Thanked
    0 times in 0 posts
    Quote Originally Posted by Az
    He knew that already beeny



    sun going to your head mate
    Bah. It's 1 AM.
    "All our beliefs are being challenged now, and rightfully so, they're stupid." - Bill Hicks

  7. #7
    Pixel Abuser Spunkey's Avatar
    Join Date
    Nov 2003
    Location
    Milton Keynes
    Posts
    1,523
    Thanks
    0
    Thanked
    0 times in 0 posts
    thanks guys!

    ahh well spose I'd better write it out the long way *sigh*

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. CSS problems
    By Kezzer in forum Software
    Replies: 11
    Last Post: 18-03-2004, 12:38 PM
  2. divs and CSS
    By Kezzer in forum Software
    Replies: 11
    Last Post: 18-11-2003, 12:51 PM
  3. CSS aid
    By Iain in forum Software
    Replies: 1
    Last Post: 14-10-2003, 11:40 PM
  4. CSS + Other Language Questions
    By Jonny M in forum Software
    Replies: 7
    Last Post: 11-10-2003, 11:17 PM
  5. CSS Help
    By Basher in forum Software
    Replies: 19
    Last Post: 10-09-2003, 08:13 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •