Results 1 to 7 of 7

Thread: how to set the size of a button

  1. #1
    Join Date
    Apr 2007
    Posts
    48
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default how to set the size of a button

    hi to all

    i want to set a fixed size to a button which is not expand or not reduced based on the value. is it possible

    regards

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    I think it will need to become wide enough to fit text... if will expand til it fits, at a minimum.
    But... probably could use <... style="width:20px;">, or something.
    //random guess... not sure.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  3. #3
    Join Date
    Apr 2007
    Posts
    48
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    thanks for your reply


    it is working.thanks for your quick reply. can you tell how to chane the color of a button. i want to display my won colored buttons. is it possible

    regards

  4. #4
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    I really don't know CSS that well.
    Generally, CSS works better than just html, so that's why I used style="height... rather than height="..., which may have not worked.

    As for color... google button colors and CSS properties.
    Off the top of my head, I'd suggest as possibilities 'color' and 'border-color'. See what happens.
    And remember,
    style="property: #000000;"
    That's for black... just change the hex code for colors.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  5. #5
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Buttons are one of the hardest elements to style. The support for this varies by browser. A strict HTML 4.01 DOCTYPE helps. The color of a button (when supported) is its background-color property.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  6. #6
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    You should avoid using pixels to size things wherever possible, though... the text in the button won't be visible if the user's font size is too big.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  7. #7
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    In addition to that, use the according padding to enlarge it from it's current width. That will make sure the text doesn't get hidden, it just expands.
    - Mike

Bookmarks

Posting Permissions

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