Click here to Skip to main content
15,885,216 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi
I Put a picture at top of page in mvc project. 
1.	But it don’t start from left side.
2.	And also it causes to the first line of contact page will be not shown.
What shoul I do?

thanks

<pre lang="HTML"><pre>_Layout.cshtml
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>@ViewBag.Title - </title>
    @Styles.Render("~/Content/css")
    @Scripts.Render("~/bundles/modernizr")

   
    <script src="~/Scripts/jquery-3.4.1.js"></script>
    <script src="~/Scripts/jquery.unobtrusive-ajax.js"></script>
    <script src="-/Scripts/jquery.unobtrusive-ajax.min.js"></script>
    

</head>
<body>
    <div class="navbar navbar-inverse navbar-fixed-top" >
        <div class="container">

            <!--div class="float-left">
                <p class="site-title"><a runat="server" href="http://www.your_url.com/"><img src="../Images/img1.png" alt="" /></a></p>
            </div -->

            <div class="navbar-header">

              
                <href ="@Url.Action("Index", "Home")">
                    <img src="../Images/img1.png" alt="Site Logo" style="height:auto; width:100vw" />

                    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>
                    @Html.ActionLink("MyProject", "Index", "Home", new { area = "" }, new { @class = "navbar-brand" })
            </div>
                <div class="navbar-collapse collapse" >
                    <ul class="nav navbar-nav" >
                        <li>@Html.ActionLink("Home", "Index", "Home")</li>
                        <li>@Html.ActionLink("About us", "About", "Home")</li>
                        <li>@Html.ActionLink("Contact", "Contact", "Home")</li>
                        <li>@Html.ActionLink("Student", "Index", "Student")</li>
                        <li>@Html.ActionLink("Personal", "Index", "Personal")</li>
                       
                    </ul>

                </div>
            </div>
        </div>


        <div class="container body-content">
            @RenderBody()
            <hr />
            <footer>
                <p>© @DateTime.Now.Year - <span style="color:aqua"><a href="http://www.mycompani.com" target="_blank">my company information</a></span></p>
            </footer>
        </div>



        @Scripts.Render("~/bundles/jquery")
        @Scripts.Render("~/bundles/bootstrap")
        @RenderSection("scripts", required: false)
    </body>
    </html>


HTML
<pre>Index.cshtml
@{ ViewBag.Title = "home";  }
<div class="jumbotron">
    <h1></h1>
</div>

<div class="row">
    <div class="col-md-4">
        <h2>asp.net</h2>
        <p>
            Contoso University is a sample application that demonstrates how to use Entity Framework 6 in
            an ASP.NET MVC 5 web application.
        </p>
    </div>
    <div class="col-md-4">
        <h2>item 2</h2>
        <p>
            You can build the application by following the steps in the tutorial series on the ASP.NET
            site.
        </p>
        <p>
            <a class="btn btn-default" href="http://www.asp.net/mvc/tutorials/getting-started-with-efusingmvc/">
                click item2 »
            </a>
        </p>
    </div>

    <div class="col-md-4">
        <h2>item 1</h2>
        <p>item 1 information</p>
        <p>
            <a class="btn btn-default" href="http://code.msdn.microsoft.com/ASPNET-MVCApplicationb01a9fe8">
                click »
            </a>
        </p>
        <p>new row</p>
        <p><a class="btn btn-success" href="https://go.microsoft.com/fwlink/?LinkId=301867">click »</a></p>
    </div>

    <div class="col-md-4">
        <h2>item 3</h2>
        <p>aaaaaaaaaaaa</p>
        <p><a class="btn btn-success" href="https://go.microsoft.com/fwlink/?LinkId=301867">click »</a></p>
    </div>

    <div class="col-md-4">
        <div class="navbar-collapse collapse">
            
            <!--  -->
            <ul class="btn btn-default">
                <li>@Html.ActionLink("myEtc", "Etc", "Home")</li>
            </ul>
            


        </div>
    </div>


    

</div>



What I have tried:

help please
........................................
Posted
Updated 28-Mar-20 10:10am
Comments
Afzaal Ahmad Zeeshan 28-Mar-20 10:50am    
Use the inspect element tools of the browser to know why the image is outside the bounds. We cannot access the application, nor the image.

1 solution

the reason is in line
<div class="navbar navbar-inverse navbar-fixed-top" >

and part
navbar-fixed-top

and must change the file
bootstrap.css

but how?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900