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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:03:46+00:00 2026-05-26T10:03:46+00:00

By default in ASP.NET MVC, when the system generate views (scaffolding) we have the

  • 0

By default in ASP.NET MVC, when the system generate views (scaffolding) we have the label on one line and the textbox on the next line. I would like to have the label and the textbox on the same line and having the textbox on the whole width (100%). I try to achieve this without success.

I found some similar posts but not allowing me to have the textbox on the whole width!

Here is what I want:

enter image description here

So, by default I have:

<div class="editor-label"> @Html.LabelFor(model => model.Descr) </div>
<div class="editor-field"> @Html.EditorFor(model => model.Descr) </div>

<div class="editor-label"> @Html.LabelFor(model => model.Year) </div>
<div class="editor-field"> @Html.EditorFor(model => model.Year) </div>

Any idea?

  • 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-26T10:03:47+00:00Added an answer on May 26, 2026 at 10:03 am

    That’s a purely HTML/CSS question that has nothing to do with ASP.NET MVC. I would recommend you the following article for creating nice HTML forms with CSS.

    So in your case you could float: left the label and define it a fixed width. Just as illustrated in this live demo I wrote for you:

    .editor-label {
        float: left;
        width: 200px;
    }
    
    .editor-field {
        margin-left: 200px;
    }
    
    .editor-field input {
        width: 100%;    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have taken the default asp.net mvc template and customized to work for me.
by default the ASP.NET MVC engine searches the following folders for View pages: /Views/
I have an ASP.NET MVC application with the default membership database. I am accessing
I am using asp.net mvc 2.0(default binding model) and I have this problem. I
I have Elmah up and running in my ASP.NET MVC site and I would
I have installed the ASP.NET MVC 2 RC and opened the default example project,
I'm building an ASP.Net MVC website. Rather than have everything in one project, I've
I am working on a large data entry page using the default ASP.NET MVC
I'm trying to connect my stock standard, default ASP.NET MVC (web) application to the
Brad Wilson states that The default templates in ASP.NET MVC are done in code.

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.