SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: CSS and forms

Hybrid View

  1. #1
    SitePoint Enthusiast
    Join Date
    Aug 2007
    Location
    Australia
    Posts
    33
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Angry CSS and forms

    I've recently been playing around with styling html forms and I've already run into a lot of problems.

    IE seems to be the main culprit but Firefox seems to be playing up as well.

    IE: No form border
    input {
    border-style: none;
    }
    IE ignores this unless the colour of the border is changed as well...
    So I have to set a colour for a border I want to hide!?!?!?!?!?!?!?!

    Form font
    I also noticed the font was different in my form to the global font I specified for the body tag. This was the case for both IE and Firefox.
    Is this a mistake or does the <body> font-family not apply to <input> but does to everything else?

  2. #2
    SitePoint Zealot
    Join Date
    Oct 2004
    Location
    Sydney, Australia
    Posts
    175
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    try
    border: 0px;
    or
    border: 1px none transparent;

    afaik, input, textarea, etc do not inherit fonts from the body tag. They use the system defaults until specifically specified in css.

    Code:
    input, textarea {
    font-family: Arial;
    }
    also you could use the wild card * in css to set the font of ALL elements, but i would recommend that you specifically specify the fonts for those problem elements.

    Code:
    * {
    font-family: Arial;
    }

  3. #3
    SitePoint Enthusiast
    Join Date
    Aug 2007
    Location
    Australia
    Posts
    33
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hhhmmm ok thanks,

    But do forms not inherit fonts as set by W3C or is that something the browsers added?

    It doesn't even apply to font-size. Only font-family...

  4. #4
    CSS & JS/DOM Adept bronze trophy
    Join Date
    Mar 2005
    Location
    USA
    Posts
    5,482
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I prefer "border:0 none;".

    Making form controls not inherit the font-family by default is just one of the many strange things that the browser makers do.
    We miss you, Dan Schulz.
    Learn CSS. | X/HTML Validator | CSS validator
    Dynamic Site Solutions
    Code for Firefox, Chrome, Safari, & Opera, then add fixes for IE, not vice versa.


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
  •