locked
how to bring the image in left side of the header RRS feed

  • Question

  • User-1355965324 posted

    Hi

    My code is as given below, I am trying to bring the image in the left side of the header, Please can you help

    <body>
        <header class="container-fluid">
            <h1>Testsite</h1>
            <a href="#top">
                <img src="../img/mylogo.jpg" class="img-responsive" />
            </a>
    
    
    
        </header>
        <nav class="navbar navbar-expand-sm navbar-dark bg-dark">
            <div class="container">
                <button class="navbar-toggler" data-toggle="collapse" data-target="#navbarNav"><span class="navbar-toggler-icon"></span></button>
                <div class="collapse navbar-collapse" id="navbarNav">
                    <ul class="navbar-nav mr-auto">
                        <li class="nav-item active">
                            <a href="index.html" class="nav-link">Home</a>
                        </li>
                        <li class="nav-item">
                            <a href="about.html" class="nav-link">About Us</a>
                        </li>
                        <li class="nav-item">
                            <a href="services.html" class="nav-link">Services</a>
                        </li>
                        <li class="nav-item">
                            <a href="blog.html" class="nav-link">Blog</a>
                        </li>
                        <li class="nav-item">
                            <a href="contact.html" class="nav-link">Contact</a>
                        </li>
                    </ul>
                </div>
            </div>
        </nav>

    Please help

    Wednesday, May 2, 2018 6:36 AM

Answers

  • User36583972 posted


    Hi polachan,

    My code is as given below, I am trying to bring the image in the left side of the header, Please can you help

    The following code may helpful for you.

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
        <style>
            .solid {
                border-style: solid;
                border-width: 2px;
                display: flex;
                justify-content: space-between;
                align-items: center;
            }
    
            header img {
                width: 100px;
                height: 62px;
                flex-shrink: 0;
            }
    
            header h1 {
                margin: 0;
                text-align: center;
                text-transform: uppercase;
                letter-spacing: 15px;
                word-spacing: 35px;
            }
        </style>
    </head>
    <body>
    
        <header class="solid">
            <a href="#top">
                <img src="Media/111111.jpg" class="img-responsive  " />
            </a>
            <h1>Testsite</h1>
        </header>
    
        <nav class="navbar navbar-expand-sm navbar-dark bg-dark">
            <div class="container">
                <button class="navbar-toggler" data-toggle="collapse" data-target="#navbarNav"><span class="navbar-toggler-icon"></span></button>
                <div class="collapse navbar-collapse" id="navbarNav">
                    <ul class="navbar-nav mr-auto">
                        <li class="nav-item active">
                            <a href="index.html" class="nav-link">Home</a>
                        </li>
                        <li class="nav-item">
                            <a href="about.html" class="nav-link">About Us</a>
                        </li>
                        <li class="nav-item">
                            <a href="services.html" class="nav-link">Services</a>
                        </li>
                        <li class="nav-item">
                            <a href="blog.html" class="nav-link">Blog</a>
                        </li>
                        <li class="nav-item">
                            <a href="contact.html" class="nav-link">Contact</a>
                        </li>
                    </ul>
                </div>
            </div>
        </nav>
    </body>
    </html>
    

    Best Regards,

    Yong Lu

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, May 3, 2018 5:22 AM

All replies

  • User-369506445 posted

    hi

    please try below code :

    <style>
            .leftSide {
               float: left;
            }
        </style>
    
    <img src="../img/mylogo.jpg" class="img-responsive leftSide"  />

    Wednesday, May 2, 2018 8:09 AM
  • User36583972 posted


    Hi polachan,

    My code is as given below, I am trying to bring the image in the left side of the header, Please can you help

    The following code may helpful for you.

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
        <style>
            .solid {
                border-style: solid;
                border-width: 2px;
                display: flex;
                justify-content: space-between;
                align-items: center;
            }
    
            header img {
                width: 100px;
                height: 62px;
                flex-shrink: 0;
            }
    
            header h1 {
                margin: 0;
                text-align: center;
                text-transform: uppercase;
                letter-spacing: 15px;
                word-spacing: 35px;
            }
        </style>
    </head>
    <body>
    
        <header class="solid">
            <a href="#top">
                <img src="Media/111111.jpg" class="img-responsive  " />
            </a>
            <h1>Testsite</h1>
        </header>
    
        <nav class="navbar navbar-expand-sm navbar-dark bg-dark">
            <div class="container">
                <button class="navbar-toggler" data-toggle="collapse" data-target="#navbarNav"><span class="navbar-toggler-icon"></span></button>
                <div class="collapse navbar-collapse" id="navbarNav">
                    <ul class="navbar-nav mr-auto">
                        <li class="nav-item active">
                            <a href="index.html" class="nav-link">Home</a>
                        </li>
                        <li class="nav-item">
                            <a href="about.html" class="nav-link">About Us</a>
                        </li>
                        <li class="nav-item">
                            <a href="services.html" class="nav-link">Services</a>
                        </li>
                        <li class="nav-item">
                            <a href="blog.html" class="nav-link">Blog</a>
                        </li>
                        <li class="nav-item">
                            <a href="contact.html" class="nav-link">Contact</a>
                        </li>
                    </ul>
                </div>
            </div>
        </nav>
    </body>
    </html>
    

    Best Regards,

    Yong Lu

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, May 3, 2018 5:22 AM