Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Jun 2007
    Posts
    310
    Thanks
    86
    Thanked 3 Times in 3 Posts

    styling input elements?

    Hi All,

    Just a quick question about styling input elements. If you look at:

    http://www.inspireaway.co.uk/test.php

    You will see within my div if #stylized I have two input elements:

    - A text box
    - A Radio button

    Now they are both input elements, but I want to style them differently within the #stylized div. Now I read, up and believed you do this by forcing the type ie:

    Code:
    #stylized input[type="text"]{
    }
    
    #stylized input[type="radio"]{
    }
    But as you can see neither has a style picked-up. So how is it done within a div id?

    Thanks

    Chris

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,851
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    #stylized input [type="radio"]
    There is a space between the input and the square bracket in the CSS of your page. It should be
    Code:
    #stylized input[type="radio"]
    However, this style won't work in IE. So the best method is to apply an extra class,say
    Code:
    input.radio{
    /* style here*/
    }
    Code:
    <input type="radio" class="radio" />
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)


  •  

    Posting Permissions

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