Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5994583
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:50:18+00:00 2026-05-22T23:50:18+00:00

I have an img element that I am using as the background of a

  • 0

I have an img element that I am using as the background of a navbar, I then will display the navigation links over the top of the img element. My problem as you will see in the images below is that the ul that holds the links get displayed to the right of the nav bar & not over it. Why does it do this & how can I get my links to be over the top of the img?

This is how it looks now: look at the white writting
This is how it looks

This is how it should look
This is how it should look

My code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/homepage.dwt" codeOutsideHTMLIsLocked="false" -->
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

        <title>Kamalei - Home Page</title>
        <style type="text/css">
        <!--
            html, body, div, form, fieldset, legend, label, img {  margin: 0;  padding: 0;  }  table {  border-collapse: collapse;  border-spacing: 0; }  th, td {  text-align: left;  }  h1, h2, h3, h4, h5, h6, th, td, caption { font-weight:normal; }  img { border: 0; } 

            body { text-align: center; min-width: 1200px; }

            #backgroundImg  { z-index: -1; position: absolute; left: 0px; top: 0px; }

            #heading        { height: 300px; }
            #main           { margin: 0 auto; }
            #navBar         { display: inline; height: 700px; width: 200px; z-index: 1; position: relative; } /* I am pretty sure the cause is because I use "inline" but I need it to position the navbar correctly to the left */
            #content        { display: inline; height: 700px; width: 800px; padding: 20px; padding-left: 30px; }

            #navBarImg      { position: relative; z-index: 0; padding-right: -5px; margin-right: -5px; } /* Remove gap between navbar & content divs */
            #contentImg     { }

            #navbar ul li   { padding: 0; margin: 0; }
            #navLinks       { color: white; top: 0; left: 0; position: absolute; }
        -->
        </style>

    </head>

    <body>

        <div id="heading"> 
            abc
        </div>

        <div id="main">
            <div id="navBar">
                <!-- Error occurs here: the unordered list is displayed to the right of the nav bar instead
                     of where it should be which is inside the navbar -->
                <ul>
                    <li id="navLinks">abcdef</li>
                </ul>

                <img id="navBarImg" src="images/navBackground.png" alt="" width="200px" height="700px"/>

            </div>

            <div id="content">
                <img id="contentImg" src="images/contentBackground.png" alt="" width="800px" height="700px"/>
            </div>
        </div>


        <!-- Must keep the background image at the bottom of body -->
        <img id="backgroundImg" src="images/background.png" alt="" width="100%" height="1100px"/>

        <script type="text/javascript">
        <!--
            window.onresize = setBackgroundImgWidth;
        -->
        </script>

    </body>

    </html>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T23:50:19+00:00Added an answer on May 22, 2026 at 11:50 pm

    you need to make the navbar background a background image to the div rather than an image that’s part of the html. This is the cleanest way to display the image underneath the text. You can set a height and width in the css to the div to ensure the entire image appears as well.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an anchor element that looks like this <a href=url><img src=imgurl/>Text</a> I would
I have a sidebar widget that has an image background. Over this is a
I'm using jQuery to control an image gallery that will display any of several
I have a CSS background image that I am using to fill the entire
I have a div box (black) that will display a few different product images
For my mobile-desktop nav-bar I have background buttons (default). On top I'm using :after
i have a navigation menu and i am using the hover element to change
I have code that loads a bunch of images into hidden img elements and
If i have img element id = myimg. Is posible to add link to
I have an img element with style='width:40%;height:40%;' . I would like to add a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.