Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6979107
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:50:37+00:00 2026-05-27T17:50:37+00:00

Referring to both the button element and the input element with a type of

  • 0

Referring to both the button element and the input element with a type of button, I ran across a behavior I think is a bug (in recent releases of both Firefox and Chrome). But given how form elements are often exceptions to what I think are w3 rules, I thought I would ask for verification before assuming I am right.

The behavior is this: In standards-mode when I add a border to such an element, the border appears inside the width of the element. If I manually set the box-sizing to content-box (using vendor prefixes), the behavior does what I expect, but when the box-sizing is left as its default it is not content-box. Here’s a jsfiddle example. If you don’t want to go to jsfiddle, here’s the source code:

<!doctype html>
<html>
<head>
<title>Broken box model?</title>
<style>
body {
    padding: 30px;
    background: brown;
}
div {
    position: relative;
}
input {
    background-color: #CCC;
    font-family: Helvetica, Verdana, sans-serif; /* Yes, I know Helvetica and Verdana are dissimilar. I don't care. Arial sucks. */
    font-size: 18px;
    font-weight: bold;
    color: white;
    text-transform: uppercase;
    border: 0;
    width: 150px;
    height: 90px;
    margin: 4px;
}
input:hover {
    margin: 0;
    border: 4px solid white;
}
input:active {
    margin: 0;
    border: 4px solid white;
    -moz-box-sizing: content-box;
    -webkit-box-sizing: content-box;
    box-sizing: content-box;
}
</style>
</head>
<body>
    <div>
    <input type="button" value="I am a button" />
    </div>
</body>
</html>

Is this correct behavior, or have I stumbled on a bug?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T17:50:37+00:00Added an answer on May 27, 2026 at 5:50 pm

    Apparently this bug has already been reported to Chrome and Firefox. The loophole is that in both cases these elements have an initial value of box-sizing: padding-box set in their browser stylesheets. So it’s not technically a default value (initial != default). However, the only way to revert these elements back to box-sizing: content-box is using proprietary browser extensions for content-box, so there is not any truly CSS compliant way to do this. box-sizing doesn’t exist for CSS 2.1, and proprietary browser extensions are not valid CSS 3.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Little confused, is 'driverclassname' and 'hibernate.dialect' both referring to the mysql driver? What should
I think most would be surprised about the topic again, However I am referring
i have got two different NSManagedObjectContexts both referring to the same NSPersistentStoreCoordinator, say context1
Is there any type-safe, compile-time checked possibilty of referring to values that implement multiple
Both List A and List B are of type Products List A = new
What I'm referring to is a documented bug: http://www.google.com/support/forum/p/apps-apis/thread?tid=58c4f7fbe60be52c&hl=en . Basically, when I use
I hope both the object invocations are referring to the ActiveXObject. But why are
Referring to TLB and maintenance issues ... My question to people (often) using the
Referring to Brian Goetz's article Are all stateful Web applications broken? for IBM developerWorks,
Referring to this question , how can i get the current page size in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.