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 8974169
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T18:37:17+00:00 2026-06-15T18:37:17+00:00

Consider a code: <div style=width: 10em; float: left; padding: 0; margin: 0> <input type=text

  • 0

Consider a code:

<div style="width: 10em; float: left; padding: 0; margin: 0">
  <input type="text" style="width: 10em"/>
</div>

In fact, the text field does not occupy the entire parent DIV, as one would expect. Why? Thanks in advance for your answers.

  • 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-06-15T18:37:19+00:00Added an answer on June 15, 2026 at 6:37 pm

    the answer is font-sizes.

    em is a measurement of ‘size relative to the current font-size’.

    since the default font-size of an input element is smaller than a div (due to browser defaults) the 10em equates to a different width.

    you can easily fix this by using ‘%’ unit:

    <input type="text" style="width:100%"/>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Please see code below: <div style=background:#F00;width:800px;> <div style=float:left> Hello Hello Hello Hello Hello Hello
Consider this code... <div id=outer style=position:absolute;width:100px;height:100px;border:1px solid black> <div id=inner> <img src=http://rabbitempire.org/wp-content/uploads/Pet-Rabbit-Facts.jpg> </div> </div>
Consider this HTML: <!DOCTYPE html> <html> <head> <title></title> <style type=text/css> div { position: relative;
Consider the following snippet of code: <div align=Left> <font style='font-size:17pt; font-family:Times New Roman;color:#000000;'> <textformat
Consider the following HTML/css code sample: <div id="container"> <div id="up">Text<br />Text<br />Text<br /></div> <div
This code does what I want: abc is rendered next to def <style type=text/css>
Consider this sample code: <div class=containter id=ControlGroupDiv> <input onbeforeupdate=alert('bingo 0'); return false; onclick=alert('click 0');return
Consider the following HTML structure: <div class=content> <div class=field field-type-date field-field-event-date> <div class=field-items> <div
Please consider this code here, also given is this fiddle: http://jsfiddle.net/DPNc6/ HTML: <div style=width:500px
Consider this Asp.net page code: <head runat=server> <title></title> <script type=text/javascript> function showhide(master, detail) {

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.