Reduce Left Margin / MVC

SSinhg 286 Reputation points
2022-01-10T13:58:43.007+00:00

Hi,

How do I reduce the left margin or start after certain length from left?
163662-untitled.png

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,140 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,204 questions
{count} votes

Accepted answer
  1. Karen Payne MVP 35,031 Reputation points
    2022-01-10T15:50:46.063+00:00

    Had a few minutes to give you some starter code which is meant to show possibilities, not a solution directly.

    In _Layout.cshtml

    <div class="container-fluid border border-warning">  
        <main role="main" class="pb-3">  
            @RenderBody()  
        </main>  
    </div>  
    

    index.cshtml

    @page  
    @model IndexModel  
      
    @{  
        ViewData["Title"] = "Home";  
    }  
      
    <style>  
        .container-fluid {  
            padding-right: 30px!important;  
            padding-left: 30px!important;  
        }  
    </style>  
      
    <div class="row">  
        <div class="col bg-light">Left 1</div>  
        <div class="col-auto">Right 1 . . . .</div>  
    </div>  
      
    <div class="row">  
        <div class="col bg-info">Left 2</div>  
        <div class="col-auto float-end"> . . . . . . . Right 2</div>  
    </div>  
      
    <div class="row">  
        <div class="col bg-light">Left 3</div>  
        <div class="col-auto text-end">Right 3 . . . . . . . </div>  
    </div>  
      
    <div class="row">  
        <div class="col-8 bg-info">Left 4</div>  
        <div class="col-3 text-end">Right</div>  
    </div>  
      
    <div class="row">  
        <div class="col-sm-9 bg-light p-3 border">  
            .col-sm-9: width of 75% above sm breakpoint  
        </div>  
        <div class="col-3 bg-light p-3 border">  
            .col-3: width of 25%  
        </div>  
    </div>  
      
    <div class="row">  
        <div class="col-sm-6 bg-info"><p class="float-start">left</p></div>    
        <div class="col-sm-6"><p class="float-end">right</p></div>    
    </div>  
    

    163657-boot1.png

    0 comments No comments

0 additional answers

Sort by: Most helpful