locked
Top Margin RRS feed

  • Question

  • User982203039 posted

    I have a large space at the top of this page before my logo is showing? I want the logo to be at the very top of my page. Here is the code from the layout. What am I missing?

    Thanks!

    <div class="container" id="topContent">

     <div style="width: 648px; height: 75px; margin-top: 0px;">

    <div>

    <a href="/Home/Home" class="navbar-brand"> <img src="~/images/logo.png" width="150" height="50" /></a>

    </div>

    </div>

    </div>

    Monday, June 10, 2019 2:09 PM

Answers

  • User665608656 posted

    Hi Baze,

    According to your description and the code you provided, I am not clear about your css style.

    I have made an example about this issue, you could refer to the code as below.

    If it still can not solve your issue,could you please provide more detailed code about your css style?

    <!DOCTYPE html>
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
        <style type="text/css">
            .container {
                ;
                left: 0;
                top: 0;
            }
        </style>
    </head>
    <body>
        <form id="form1" runat="server">
            <div class="container" id="topContent">
                <div style="width: 648px; height: 75px; margin-top: 0px;">
                    <div>
                        <a href="/Home/Home" class="navbar-brand">
                            <img src="Images/NASA.png" width="150" height="50" /></a>
                    </div>
                </div>
    
            </div>
        </form>
    </body>
    </html>

    The result of my work demo:

    Best Regards,

    YongQing.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, June 11, 2019 2:34 AM

All replies

  • User753101303 posted

    Hi,

    Use https://developers.google.com/web/tools/chrome-devtools/inspect-styles/ to see what is causing this. You can even uncheck a style to see what happens. More liekly beyond what you shown you have some interaction with some other style ? (if using just what you shown, it seems ok).

    Monday, June 10, 2019 2:21 PM
  • User665608656 posted

    Hi Baze,

    According to your description and the code you provided, I am not clear about your css style.

    I have made an example about this issue, you could refer to the code as below.

    If it still can not solve your issue,could you please provide more detailed code about your css style?

    <!DOCTYPE html>
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
        <style type="text/css">
            .container {
                ;
                left: 0;
                top: 0;
            }
        </style>
    </head>
    <body>
        <form id="form1" runat="server">
            <div class="container" id="topContent">
                <div style="width: 648px; height: 75px; margin-top: 0px;">
                    <div>
                        <a href="/Home/Home" class="navbar-brand">
                            <img src="Images/NASA.png" width="150" height="50" /></a>
                    </div>
                </div>
    
            </div>
        </form>
    </body>
    </html>

    The result of my work demo:

    Best Regards,

    YongQing.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, June 11, 2019 2:34 AM
  • User982203039 posted

    Thanks!!

    Tuesday, June 11, 2019 6:10 PM