Inventory displayed beneath other listings containing images

I am currently working on designing a basic navigation bar with five list items, each set at 20% width. The structure includes two text items, followed by an image logo in the center, and then another two text items.

However, I am facing an issue where when I insert an image in the third item, it causes the text in the neighboring list items to shift down. Despite checking for any margins or other factors affecting this behavior, I have been unable to resolve the issue no matter what adjustments I make.

If anyone has any insights or explanations regarding this problem, I would greatly appreciate your input!

JSFiddle

HTML

<div class="navigation">
    <div class="container">
        <ul>
            <li><a href="/">Home</a></li><!--
            --><li><a href="/">Categories</a></li><!--
            --><li><img src="http://www.placehold.it/140x64"></li><!--
            --><li><a href="/">Contact</a></li><!--
            --><li><a href="/">Personalise</a></li>
        </ul>
    </div>
</div>

CSS

.navigation {
    top: 0;
    width: 100%;
    height: 64px;
    position: fixed;
    background: #ffffff;
    border-bottom: 1px solid #dfdfdf;
}

.navigation .container {
    width: 1000px;
    margin: 0 auto;
    padding: 0 10px;
}

.navigation ul {
    margin: 0;
    padding: 0;
    list-style-type: none;
}

.navigation li {
    width: 20%;
    height: 64px;
    display: inline-block;
    text-align: center;
    font-size: 16px;
}

Answer №1

To enhance the appearance of your navigation menu, consider adding or updating the following CSS properties in your .navigation li styling:

display: table-cell;
vertical-align: middle;

Click here for an example implementation.

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

What method is best for deleting an item from the database in HTML structure - POST, GET, or XHR action?

I have a webpage that displays content in a table format and allows users to delete a specific row by clicking on it. The structure of my rows is as follows: foreach ($rewards as $reward) { echo '<tr id="' . $reward[&apos ...

Trouble with displaying vertical scroll bar in React app when height is set to 100%

I am developing a React application where I need the content to always occupy at least 100% of the height to style the background accordingly. I have attempted to achieve this by setting the CSS height to 100% at the top level, which works fine. However, t ...

When deploying a website with the default Hugo theme on Netlify, I encountered a strange issue where the webpage appeared blank. Sur

After coming across a question similar to mine about creating a static page using blogdown with the same Hugo theme as the main site on Stack Overflow, I still find myself struggling to understand the solution provided. As an absolute beginner, I am curren ...

An error was encountered: $controllerProvider provider is not recognized within the productsApp

Here is the link to my code: http://plnkr.co/edit/8muxhJmvFiIqRJgzuT0O?p=preview I encountered an error: Uncaught Error: Unknown provider: $controllerProvider from productsApp Additionally, I am unable to view the JSON file in the console. index.html ...

How can I convert dates into a different format?

I have various event dates that are stored in the format 20131212 or 20100125, or any date submitted by a user for an event (formatted as yyyymmdd). I have created a function that displays all events for a specific month. However, the date is currently di ...

Strategies for enhancing the performance of this arbitrary playlist HTML5 audio script

<script type="text/javascript"> function random_music(){ var myrandom=Math.round(Math.random()*4); var musicurl='http://dummy.xy/dummy.mp3'; if (myrandom==0){musicurl='http://path_to.mp3';} else if (myrandom= ...

What methods can be used to alter the appearance of a disabled and checked checkbox?

Is there a way to change the appearance of my enabled and disabled checkboxes to be green? I've tried adjusting various CSS properties but so far have only been able to change the outline color. Any tips on how to make the checkbox itself appear green ...

Modify the name of the selected option value

I am working on an html code where I need to replace the values 0, 1, and 2 with USA, Australia, and Canada respectively. I also need to know the name of these values in my MySQL database. Thanks! HTML <form method="post" id="countriesForm" name="cou ...

Selecting elements dynamically using the .on() function

I'm working on a quiz creation page where I need to dynamically add questions and answers. However, I am facing an issue with the onClick event only registering on the first button that exists when the page loads. My code includes a form with the id ...

When clicking, jQuery fails to hide the div

Here is some HTML code for you to check out: <div class="FormContainer" id="FirstFormContainer"> <form> <span> Enter the number of subjects</span></br> <input id="NumberOfSubjects" /></br> <span& ...

Can a dropdown menu be integrated into a text area?

Is it within the realm of possibility to achieve this? I believe it's worth exploring, so here goes my question. The Servlet API functions as a ticketing process or script that scans a form for specific form fields that match its predefined list of n ...

React component not displaying styles applied with jQuery

While jQuery appears to be functioning properly within a React component, I am facing issues when trying to apply styling using jQuery in the same component. The console.log(eachVisitedTopic) statement within the loop is providing the expected results. to ...

Seeking guidance on utilizing JavaScript for implementing an onclick event

I am exploring the realm of Event tracking with Google Analytics. To make this happen, I know that I must include an onclick attribute to select links (those specifically requested for tracking) in the following manner: <a href="http://www.example.com" ...

The HTMLInputElemet type does not include a Property Rows

Hey there, I'm just starting to dive into Angular and TypeScript. My current challenge is figuring out how to check if a table is empty or not so that I can show or hide a specific div accordingly. I've attempted the following: var rows = docume ...

Save the code in a MySQL database

I have created a database using Bootstrap code with a table named classes. Within this table, there is a column labeled sample with a datatype of tinytext. However, when I try to store the following code: <li class="active"><a href="Jumbotron.ht ...

Adjust the size of the <textarea> to match the height of the table cell

Below is the code I am using to generate a table containing an image along with a <textarea>: <table border="1" style="border-color: #a6a6a6" cellpadding="4" cellspacing="0" width="702">\ <col width="455"> <col width="230"> ...

What is the best way to incorporate multiple functions into a single ng-change event in Angular

Is it possible to add multiple functions in ng-change directive? Here is an example code snippet: <div class="col-md-2"> <select id="sel2" ng-model="updateUser.user.state" name="state" ng-change="change(); updateUser.user.city=' ...

Using CSS in Visual Studio Code allows you to easily select multiple lines and comment out each line within the selection individually

When working on CSS in Visual Studio Code, I encountered an issue where I need to comment out multiple lines of property:value code separately. For instance: Before: body { width: 0px; height: 0px; color: red; } After highlighting the width, height, and ...

Switch up the placement of the boxes by moving them in different directions, such as

I've been attempting to recreate the button movement demonstrated in this link , but I'm having trouble achieving it. Using CSS animation, I can make the buttons move in a straight line, here's what I have so far: <div id="box" style=&ap ...

The act of needlessly closing HTML tags within innerHTML in Angular

My Angular function is having issues with prematurely closing tags when doing search and replace on DOM content. It interprets the HTML incorrectly, resulting in improper tag closures and openings. Here's an example: }--><p _ngcontent-atr-c1="" ...