Error in navigating with CSS3 and HTML5

I am currently dealing with an issue where the navigation on my website is all messed up. Each link, except for the home link, has an extra empty box to the left of it. Can you take a look at my code and see if there's a quick fix for this problem? (I can provide a picture if needed)

Here is the HTML5:

<!doctype html>
<html lang="en">

    <head>
        <meta charset="utf-8" />
        <title>ChonBonStudios</title>
        <link rel="stylesheet" href="Main.css">

        <!-- Including the Lobster font from Google's Font Directory -->
        <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Lobster" />

        <!-- Enabling HTML5 support for Internet Explorer -->
        <!--[if lt IE 9]>
            <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
        <![endif]-->
    </head>

    <body>
        <div id="Website">
            <header>
                <div id="Logo">
                    <a href="ChonBonStudios-Home.html"><img id="Company"   src="ChonBonStudios Logo.png"></a>
                </div>
            </header>

<!-- The navigation menu starts here -->
            <ul class="fancyNav">
                <li id="home"><a href="ChonBonStudios-Home.html" class="homeIcon" >Home</a></li>
                <li id="about"><a href="ChonBonStudios-About.html"><li>About</a></li>
                <li id="android"><a href="ChonBonStudios-Android.html"><li>Android Products</a></li>
                <li id="apple"><a href="ChonBonStudios-Apple.html"><li>Apple Products</a></li>
                <li id="computer"><a href="ChonBonStudios-Computer.html"><li>Computer Services</a></li>
                <li id="youtube"><a href="ChonBonStudios-Youtube.html"><li>Youtube</a></li>
                <li id="contact"><a href="ChonBonStudios-Contact.html"><li>Contact Us</a></li>
            </ul>

            <section>
            </section>

            <aside>
            </aside>

        </div>

        <div id="MainFooter">
            <footer>
                Copyright Austin Choncek 2013
            </footer>
        </div>

    </body>
</html> 

<!-- CSS code starts here -->

    body{
        background-color: #625D5D;
        margin: 0px;
        padding: 0px;
        font-family: Comic Sans MS;
        font-style: normal;
        font-size: 14px;
        color: #1cf1cb;
    }

    /* Styling for the main website container */
    #Website{
        background-color: #fd4c1d;
        width: 1000px;
        border: #1a1a1a solid 2px;
        border-bottom: none;
        border-top: none;
        margin-left: auto;
        margin-right: auto;
        margin-top: 0px;
        padding: 10px 0 0 0;
    }

    /* Styling for the logo */
    #Logo{
        display: block;
        margin-top: 0px;
        margin-left: auto;
        margin-right: auto;
        padding: 0px;
        border: none;
        width: 690px;
        height: 60px;
    }

    .fancyNav{
        /* Affects the UL element */
        overflow: hidden;
        display: inline-block;
    }

    /* Styling for each list item in the navigation menu */
    .fancyNav li{
        background-color: #f0f0f0;
        background-image: -webkit-gradient(linear,left top, left bottom,from(#fefefe), color-stop(0.5,#f0f0f0), color-stop(0.51, #e6e6e6));
        /* More style properties */

    }

    /* More CSS styles... */

Answer №1

There seems to be an issue with extra random <li> tags within the <a> tags. Here is a corrected version:

<ul class="fancyNav">
        <li id="home"><a href="ChonBonStudios-Home.html" class="homeIcon" >Home</a></li>
        <li id="about"><a href="ChonBonStudios-About.html">About</a></li>
        <li id="android"><a href="ChonBonStudios-Android.html">Android Products</a></li>
        <li id="apple"><a href="ChonBonStudios-Apple.html">Apple Products</a></li>
        <li id="computer"><a href="ChonBonStudios-Computer.html">Computer Services</a></li>
        <li id="youtube"><a href="ChonBonStudios-Youtube.html">Youtube</a></li>
        <li id="contact"><a href="ChonBonStudios-Contact.html">Contact Us</a></li>
        </ul>

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

The transparency feature is malfunctioning in IE9 when using a background

This is a demonstration of a lightbox feature. You can find the code here. When you click on the link "Show Panel," a form will pop out. It works correctly in Firefox but not in IE9. The HTML code is simple: <body> <a id="show-panel" href="#"&g ...

Setting a card to the center within a col-md in Bootstrap 4: Step-by-step guide

I'm looking to position this card in the middle, not centered. How can I achieve that? I've already attempted using my-auto, but it didn't work at all. Please take a look at my code and suggest any necessary changes. Thank you! https://i.s ...

What are some ways to personalize a scrollbar?

I am looking to customize the scrollbar within a div. I attempted to modify it using the code below, but I encountered difficulties when trying to change the scroll buttons and did not achieve my desired outcome. Additionally, this customization did not wo ...

Launching a HTML hyperlink inside a div with the power of jQuery

I am currently exploring the functionality of dragging and dropping an HTML link into a div element. My objective is to have the link open within that specific div element. The layout consists of two divisions named "left-panel" and "canvas". The concept ...

The alignment and sizing issues with stacking icons using fontawesome are still unresolved

I have been exploring the use of stacked icons with fontawesome, following a helpful blog post by Dave Gandy. Although stacking is working well, I am facing an issue aligning a stacked icon with a non-stacked icon (which is fa-5x). It's challenging t ...

Inconsistent Failures Plague JQuery-Servlet Post Requests

Recently, I have started working with JQuery and encountered a strange issue. When I try to post my HTML form data to a servlet and print it out, most of the time (about 7 out of 10 times) it works perfectly fine with new values. However, the other 3 times ...

Adjust the border color of the <input> element when it is clicked on

I'm currently working on a login screen for my next.js application and I've encountered an issue where the border color changes to a mixture of white and blue when I select an input field. https://i.stack.imgur.com/R2yKa.png I attempted to reso ...

On smaller screens, the top placement of right sidebar links is necessary

Our website layout is organized into 3 main sections: the top part contains the main menu, followed by the main content and a sidebar specific to each page. The main content and sidebar are structured using bootstrap col-* classes. On small screens, I en ...

Hide HTML div on click

Why does the button disappear when I click on it, but the status refreshes? Javascript $( ".refreshstatus" ).click(function(){ $( ".navplayers" ).load('stats.php'); }); CSS .refreshstatus{ font-family:'Noto Sans'; font-w ...

The number of keys in associative arrays

Here is an array that I have: $config = [ 'gallery_name' => 'My Gallery', 'unsplash_categories' => ['Nature' => '<img src = "https://source.unsplash.com/300x200/?nature" alt = " ...

Guide on incorporating the font-awesome library in your project

Forgive me if this sounds like a silly question, but I am completely new to javascript and its libraries. I stumbled upon a similar issue as described in this thread, where the accepted solution included the following line: <link rel="stylesheet" href ...

What are the steps to create a dynamic navigation bar in React without encountering hydration issues?

My goal is to dynamically show or hide links based on user authorization. Here's my initial approach: const Navbar = () => { const { canDo, ...} = useUser(); //A Zustand store return ( <> <div> <ul> ...

The issue with the max-height transition not functioning properly arises when there are dynamic changes to the max-height

document.querySelectorAll('.sidebarCategory').forEach(el =>{ el.addEventListener('click', e =>{ let sub = el.nextElementSibling if(sub.style.maxHeight){ el.classList.remove('opened&apos ...

Tips for Excluding Content Retrieved Through file_get_contents?

Currently, I am storing the source code of a webpage in a variable called $html using the following line: $html = file_get_contents('http://www.google.com'); When I use <textarea><?php echo htmlentities($html); ?></textarea> ...

What is the best practice for adding a DOM element at a precise location within an ng-repeat loop?

I am currently working on developing a podcast player application using AngularJS. At this point, I have successfully created a list of available podcasts that can be played, utilizing ng-repeat. The code for the list is shown below: <ul ng-controller ...

Pros and cons of using multiple small files versus a single large file for HTTP requests

Curious about the best approach: Is it better to have multiple small files requested by multiple HTTP requests, or one big file requested all at once? Please outline the advantages and disadvantages of both methods as my online research has provided conf ...

A step-by-step guide on revealing a complete div upon selection

Can anyone assist me in showing a div with a form inside it whenever a specific option is selected from a tag? Here is the code I currently have: <script type="text/javascript"> $(function() { $('#contactOptionSelect&apo ...

Can you tell me which CSS property is used to display the ellipsis (...) when there is overflow in the x

When the content exceeds the parent's width, the property overflow-x displays a scrollbar. However, I would prefer to show three dots "..." instead of the scrollbar. Is there a way to do this? ...

How can I customize icons within the <mat-nav-list> using Angular?

Is it possible to change the icons as follows? If the list is expanded, display icon "arrow1" Otherwise, show icon named "arrow2". How can I determine if the list is expanded and implement this in HTML? <mat-nav-list> <mat-list-item> ...

Import JSON Data into Angular-nvD3 Chart (AngularJS)

I am seeking help to load encoded JSON Data retrieved from a database via queries into an Angular-nvD3 graph. I am unsure about the best approach to achieve this task. The encoded JSON data is fetched using API queries from a database table called PRODUCT ...