Add Css Style in a ViewPort of a specific page in the visual studio bootstrap

0

I'm new to CSS and I'm studying some elements.

When creating an ASP.NET CORE MVC project with Visual Studio 2017, all content is automatically placed inside a body-content that keeps content centralized. (At least that's what I understood)

On a specific page, I'm using a ViewPort, where I'd like the entire page length to be filled by it, without changing the body-content on the other pages ...

I tried to do this:

.nome-page .body-content {      width: 100%; }

and without understanding right I tried to do the reverse: .body-content .name-page {      width: 100%; }

But the result I was able to change is CSS for all pages, but I repeat, I would like to change only for a specific page.

Thank you.

HTML Page:

    <section class="conteudo-cadastro">
        <div class="content">

        </div>
    </section>

CSS:

body {
    padding-top: 50px;
    padding-bottom: 20px;
}

.body-content {
    padding-left: 15px;
    padding-right: 15px;
}

.conteudo-cadastro {
    margin-top: 4px;
    height: 100vh;
    background-color: #747640;
}
    
asked by anonymous 17.11.2018 / 20:26

1 answer

0

To solve your problem, it is very simple to remove the borders of body adding margin: 0 to the body and remove the padding of .body-content , in the answer I just commented the padding left and right but you should remove them, your section conteudo-cadastro will occupy 100% of the viewport, but will affect the other pages, the size of the section you will have to define.

  

Padding is internal distance relative to its edge or inner distance from the contents to the edge. Ref

     

Margin is the outer distance from its edges relative to other components. Ref

body {
    padding-top: 50px;
    padding-bottom: 20px;
    margin: 0; 
}

.body-content {
    //padding-left: 15px;
    //padding-right: 15px;
}

.conteudo-cadastro {
    margin-top: 4px;
    height: 100vh;
    background-color: #747640;
}
<div class="body-content">
        <section class="conteudo-cadastro">
                <div class="content">
      
                </div>
         </section>
   </div>
    
17.11.2018 / 22:06