Is there a way to adjust the vertical alignment of my horizontal menu for a better display?

Vertical alignment is an issue I'm facing; the content aligns at the top instead of the bottom:

The HTML snippet in question:

<div id="hor_menu">
<img src="header.jpg" border="0" style="float:left" width="200px" height="80px"/>
  <ul>
    <li><a href="http://www.alistapart.com/d/slidingdoors/v1/v1.html#">Home</a></li>
    <li class="current"><a href="http://www.alistapart.com/d/slidingdoors/v1/v1.html#">News</a></li>
    <li><a href="http://www.alistapart.com/d/slidingdoors/v1/v1.html#">Products</a></li>
    <li><a href="http://www.alistapart.com/d/slidingdoors/v1/v1.html#">About</a></li>
    <li><a href="http://www.alistapart.com/d/slidingdoors/v1/v1.html#">Contact</a></li>
  </ul>
</div>

The CSS rules being applied:

body {
  margin:0;
  padding:0;
  }
#hor_menu *{
  margin:0;padding:0
  }
#hor_menu {
  float:left;
  width:100%;
  background: #000 url('bg.jpg') repeat-x bottom;
  font-family:Arial;
  font-size:15px;
  }
#hor_menu ul {
  list-style:none;
  }  
#hor_menu li {
  float:left;
  }  
#hor_menu a {
  display:block;
  padding:5px 13px;
  text-decoration:none;
  color:#fff;
  }
#hor_menu a:hover {
  background: #000 url('bg_hover.jpg') repeat-x bottom;
  }
#hor_menu .current a{
    border-top-left-radius: 5px;
    -moz-border-radius-topleft: 5px;
    -khtml-border-top-left-radius: 5px;
    -webkit-border-top-left-radius: 5px;
    border-top-right-radius: 5px;
    -moz-border-radius-topright: 5px;
    -khtml-border-top-right-radius: 5px;
    -webkit-border-top-right-radius: 5px;
  background: #fff url('bg_current.jpg') repeat-x top;
  color:#000;
  }

Please note that the code provided above doesn't include any attempts to align content to the bottom.

Answer №1

To solve this issue, try applying the CSS rule

display:inline-block; vertical-align:bottom
.

#hor_menu ul, #hor_menu img {
    vertical-align: bottom;
    display: inline-block;
    /* for IE6/7 support */
    *display: inline;
    zoom: 1
}

For more information, visit: http://jsfiddle.net/thirtydot/XYrWZ/3/

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

I need help picking out specific elements from this messy HTML code using XPath and lxml - any ideas on how to do

I am looking to extract specific strings from this HTML document using only lxml and clever XPath. The content of the strings may vary, but the structure of the surrounding HTML will remain constant. The strings I need are: 19/11/2010 AAAAAA/01 Normal U ...

When the user clicks the back button in AngularJS

After searching extensively, I have yet to find a straightforward solution to my issue. The problem lies in a search/filter field that filters the page based on user input. While this filter works efficiently, it clears whenever a navigation item is clicke ...

Issues with ASP.net rendering stylesheets

Here is the layout of my Index.cshtml page: <html> <head runat="server"> <link href="~/Content/index.css" rel="stylesheet" type="text/css" /> <asp:ContentPlaceHolder ID="HeadContent" runat="server" /> </head> < ...

What are the reasons for the failure of an image upload when checked with PHP's is_uploaded_file function?

My html form allows users to upload images, but I'm encountering an issue where the uploaded image fails the "is_uploaded_file" check for some unknown reason. I'm puzzled as to why the upload is failing the is_uploaded_file check. Any ideas? He ...

How to locate the nearest parent link containing a specific attribute using jQuery

I am trying to locate the nearest link with the attribute findme from a child element .startpoint. Here is the structure: <ul> <li><a href="#">Point one</a></li> <li><a href="#" data-findme="yipi">Point tw ...

Conceal the rating of WordPress products when they have no ratings

I am looking to remove the star ratings under the title for products with empty reviews. I specifically want to hide the stars without allowing users to leave a new review. I found a similar solution for hiding a different element and attempted to customiz ...

invoking a JavaScript function from an HTML file

I want to create a JavaScript server on Raspbian that not only serves .html content to the browser but also allows for user input through events like button clicks. Both my .html and .js files are located in the same directory, and I have used absolute pat ...

Is it possible to use the Web Interface of the Watson Retrieve and Rank service to upload a zip file containing htmls or another zip file containing json files?

Is it possible to utilize the Web Interface of Watson Retrieve and Rank service to upload a zip file containing HTMLs or a zip file with JSON files? ...

What is the best way to compile an array of permissible values for a specific CSS property?

One interesting aspect of the CSS cursor property is its array of allowed values, ranging from url to grabbing. My goal is to compile all these values (excluding url) into an array in JavaScript. The real question is: how do I achieve this without hardco ...

Submit Button in CKEditor Not Working Without Ajax Submission

Having an issue with the ckeditor. Downloaded the latest version and integrated it into my form like this: <form action="/news.php?frame=edit&amp;id=185" enctype="multipart/form-data" method="post" accept-charset="utf-8"> <textarea class="edi ...

What is the best way to add CSS to email addresses that are hidden by the WordPress antispambot feature?

My current method involves utilizing the WordPress antispambot code from their Code Reference: https://developer.wordpress.org/reference/functions/antispambot/ While the code is functional, I am interested in customizing the appearance of the email addre ...

Troubleshooting: Jquery Toggle Issue When Used with Adjacent Div Element

I've been puzzling over this issue for hours now. The intention of this code is to display a div, but it's just not cooperating. <div id="butbr"> <div id="sup_nav"> <div id="stup" class="bxt1"></div> <div id= ...

How can you center popup windows launched from the main window using jquery?

Within my web application, I frequently utilize popup windows that open at different locations on the screen. These popups are standard windows created with window.open() rather than using Jquery. Now, I am seeking a solution to automatically center all p ...

Angular JS failing to display error messages

I'm experiencing difficulties displaying login validation errors with the following code. After clicking on the Login button, it redirects to the next page without showing error messages as expected. Any suggestions? index.html:- <!DOCTYPE ht ...

Emails are not responsive to media queries

I've experimented with multiple media queries in an attempt to make this work on both iPhone (landscape/portrait) and desktop, but I'm struggling to achieve the desired outcome on both simultaneously. While some of my classes are functioning cor ...

Determine a comparative measurement using specific numerical values

I am currently in the process of creating a webpage and I want to ensure that it is responsive by adjusting certain values based on the width of the viewport. Specifically, I have a DIV element that I want to split into 2 columns. For smaller screens (min ...

What is the best way to ensure the menu background aligns perfectly with the header in HTML/CSS?

Issue: Menu background doesn't align with header. (visible in the image provided below) VIEW IMAGE Any suggestions on how to resolve this alignment problem? CSS CODE : .header { margin:0px auto; max-width: 960px; } #header { height:30 ...

Adaptive website backdrop

I have created a unique background for my website design, which includes 3 slices labeled as div id top, middle, and bottom. You can view the design in this image. I am interested in making this background responsive. While I have come across examples of ...

Create an overlay that completely masks the height of a different element

Having a variety of elements on my screen that require overlays, I find myself facing a challenge. These elements come in different sizes and can be resized while the page is active. Although I managed to position overlays using CSS, the issue of 100% hei ...

Skrollr's transformation effect makes the text tremble

Using skrollr.js, I am implementing transition effects on an inner div nested inside another div. The inner div is positioned relatively. Here are my codes: HTML Structure <div class="outer"> <div class="inner-div" style="transition:transform ...