Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Size of form elements

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #23440
    dat_paulchen
    Member

    EDIT: Fixed 10/22/08. See post down below.

    Hi folks,
    I am currently developing a form and today, I came across the following problem: All (or rather most) of my form elements are supposed to have a width of 50% of their parent. There is also a border and a padding that (since I’m using XHTML) will make the element a little bigger in total. No problem. However, when I try to put a <select>, the browser makes it a little smaller. To me, it looks like 50% minus padding minus border. This is not expected behavior since it’s pretty much quirks-mode behavior.

    To cut a long story short, please have a look: http://v3.anwaltantwort.de/index.php?action=easyForms.test2
    EDIT: Fixed version: http://v3.anwaltantwort.de/index.php?ac … orms.test3

    Any suggestions? Thanks a lot in advance!

    A desperate developer.

    #50696
    mikes
    Member

    Your DIV is missing a semicolon but I don’t think that would account for it. Nothing else jump out at me. Sorry.

    #50692
    mikes
    Member

    IE often doesn’t like WIDTH and PADDING being set in the same definition

    Code:

    Try removing the padding and see if it makes any difference.

    #50702
    dat_paulchen
    Member

    I investigated a little more today… And came to the following conclusion: All browsers (except IE8) are doing it wrong, so it’s certainly not a bug, it must be a feature! :lol:

    Mozilla Developer Center claims the different behavior is "to emulate the behavior of browsers that do not correctly support the CSS box model specification". Nice way to express that IE is stupid. However, there are several CSS properties (every browser is using a different one, of course) that influence the different behavior.

    For more, go to: https://developer.mozilla.org/en/CSS/-moz-box-sizing

    In fact, Firebug tells me that -moz-box-sizing is set to ‘content-box’ for a normal <input>; for <select>s the default seems to be ‘border-box’.

    Solved: http://v3.anwaltantwort.de/index.php?ac … orms.test3

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘CSS’ is closed to new topics and replies.