SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Addict
    Join Date
    Oct 2005
    Posts
    255
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Not specifying form button styles

    Hi everyone.

    I am working on a CSS design which i did not want to specify a form button style for, i just wanted to use the standard form button design.

    You can see here www.easterncreekkarts.com.au that I have a simple grey button with black border on the left hand column. I had to do this because, if i didnt specify anything then the button would default to flat grey box with black writing.

    So my question is, why do i have to specify a button style? i thought if i removed the style for the button then the button would default to the standard button design - but this did not.

    I notice this a lot with my CSS. if i dont specify a P tag, then whereever i put a <p> it will be like nothings there.

    Same with tables.

    Is there some way to say "if i dont specify a tag, just use the default"

  2. #2
    SitePoint Evangelist hexburner's Avatar
    Join Date
    Jan 2007
    Location
    Belgium
    Posts
    591
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Remove the onmouseover, onmouseout and the classname from the button.
    Then check your CSS again.

    You're telling the browser that ALL elements shouldn't have a border.
    This causes the button to add the style border:none.
    Remove the border:0pt none; and you should be fine.
    Code CSS:
    * {
        border:0pt none;
        margin:0pt;
        padding:0pt;
    }
    FOR SALE: 1 set of morals, never used, will sell cheap

  3. #3
    In memoriam gold trophysilver trophybronze trophy Dan Schulz's Avatar
    Join Date
    May 2006
    Location
    Aurora, Illinois
    Posts
    15,476
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I agree. You should never set the borders to 0 with the universal selector - it just causes more problems than it's worth. Margins and padding on the other hand, while capable of causing problems with forms, can be worked around, if you know what you're doing.

  4. #4
    SitePoint Addict
    Join Date
    Oct 2005
    Posts
    255
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks guys. Big help! i will remember that for next time.

    I guess thats the same for P tags etc. if i specify a universal * { } style then it apples to all elements

  5. #5
    In memoriam gold trophysilver trophybronze trophy Dan Schulz's Avatar
    Join Date
    May 2006
    Location
    Aurora, Illinois
    Posts
    15,476
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That's right. The universal selector will apply to everything on the page.


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
  •