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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T20:40:32+00:00 2026-05-22T20:40:32+00:00

I have a basic menu that is built up of some div’s and anchors.

  • 0

I have a basic menu that is built up of some div’s and anchors. In some instances however, instead of an anchor I need to use a form <input type="submit"> (it’s a template for mobiles so I can’t use javascript here, I have to use a submit button that will submit the form data).

My problem I have been struggling with for hours now is to get the input to have the exact same width as the anchors. They are both set to width:50%; however the input is slightly shorter than the anchors. Only minimally, but it is still apparent. I have no idea why this is happening. Is anyone able to help with this?
My simplified code is below, and the issue is reproducible in desktop chrome and firefox, as well as the various mobiles I’ve tested on.

<html>
<head>
    <style>
        a.btn_bigfake{
            display:block;
            width:50%;
            margin: 0px auto 5px auto;

            background:#f5f5f5;
            border:4px solid #282726;
            text-align: center;
        }

        input.btn_bigfake{
            width:50%;
            display:block;
            margin: 0px auto 5px auto;

            background:#f5f5f5;
            border:4px solid #282726;
            text-align: center;
            padding:0;
        }
        div{width:100%;}
    </style>
</head>
<body style="width:100%; margin:0; padding:0;">
    <div><a href="#" class="btn_bigfake">1. anchor</a></div>
    <div><a href="#" class="btn_bigfake">2. anchor</a></div>
    <div><input type="submit" class="btn_bigfake" value="3. input"/></div>
</body>
</html>
  • 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-22T20:40:32+00:00Added an answer on May 22, 2026 at 8:40 pm

    Firstly, you should be sharing the same CSS class between all elements that are intended to look the same. It means less CSS, and less maintenance.

    To solve your issue, you need to put the classname on the DIV surrounding the INPUT, and then apply some custom styling to the input to make it fill the DIV. You can emulate the border using a background + padding on the DIV.

    See here: http://jsfiddle.net/jMTT3/2/

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

Sidebar

Related Questions

I have a rally.sdk.ui.basic.Dropdown menu in a Rally App that I would like to
I have a context menu that needs to use a dark background. It uses
i have developed some applications for blind which makes them to use basic mobile
I have a basic form with controls that are databound to an object implementing
I have a basic CRUD form that uses PageMethods to update the user details,
I have a basic model in which i have specified some of the fields
I have a basic ActiveRecord model in which i have two fields that i
I have a basic C# console application that reads a text file (CSV format)
I have an ASP.NET website, on the masterpage I have a basic navigation menu:
I have some pages that have content that is relevant to both logged 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.