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

The Archive Base Latest Questions

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

I have a span and an input element that share the same CSS definition

  • 0

I have a span and an input element that share the same CSS definition for font. Why does Chrome use different fonts for them? How would I fix this issue?

Input element inspected

Span element inspected

My objective is to make them look exactly the same in IE9, Chrome and FF.


CSS definitions (FIXED), if they still matter.

* {
    font-family: Verdana,Helvetica,Arial,sans-serif; /* Moving here fixed it */
}
body {
    /*font-family: Verdana,Helvetica,Arial,sans-serif; -- This caused the issue*/
    font-size: .8em;
    margin: 0;
    padding: 0;
    color: #000;
}
.button 
{
    text-align:center;
    min-width:80px;
    display:inline-block;
    white-space:nowrap;
    background-color:#4A8CF6;
    color:#FFF;
    padding:4px;
    margin:1px;
    border:0;
    -moz-box-sizing:border-box;
    -webkit-box-sizing:border-box;
    box-sizing:border-box;
    font-size: .8em;
}

Solution

The problem was that the span elements inherited from my CSS definition for body and the input elements didn’t. I had defined the font in my CSS with body { font-family:...; } like my computed results show and I thought that using display: inline-block; would force both of them to inherit the font from body but it did not.

The solution was to switch to using * { font-family:...; } for the font definitions. The button and clickable classes simply defined sizes and colors and such.

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

    You have to literally specify input elements if you want them to have the same font like so:

    /* Or input[type=submit] depending on your needs */
    span, input { 
        font-family: Arial, sans-serif; /* Your font here */
    }
    

    Otherwise the browser uses the default values as your question shows. You’re looking under Computed Styles which shows that Chrome has decided the values for you as you haven’t specified them.

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

Sidebar

Related Questions

suppose I have a simple container which have three element: <div> <span>hello world</span> <input
I have two span elements that I would like to stay on the same
I have multiple forms that are dynamically created with different input names and id's.
I have an Element Like <div class=control> <label>&nbsp;</label> <input type=checkbox id=1><span class=controlText>Check Box</span> <div
I have an input element, a span, and a div with a background image
I have a <span> element that I am reading with JavaScript. The element is
Situation: I have a function that dumps input data into an HTML block element,
I have a <form> that looks like this: <form> <input type=text name=name id=name /><span
I have one input field and one division with span children <input type=text id=input
I have this structure on form, <input type=test value= id=username /> <span class=input-value>John Smith</span>

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.