Clicking on links causes them to move around - definitely the most unique CSS feature I've encountered

My header navigation seems fine at first glance, but why does it move when clicked? Any ideas on what could be causing this issue? All the code is valid and provided below. HTML

Here are some screenshots:

Before Clicking

After Clicking

HTML

<div id="wrapper-header">
        <div id="logo" style="cursor:pointer" onclick="window.location='../'"></div>
  <div id="wrapper-menu">
            <ul class="menu">
                <li><a href="../" class="current"><span class="cufon cufon-canvas" style="width: 54px; height: 22px;"><canvas width="66" height="22" style="top: 0px; left: -1px;"></canvas><span class="cufon-alt">home</span></span></a></li>
                <li><a href="chair/"><span class="cufon cufon-canvas" style="width: 45px; height: 22px;"><canvas width="61" height="22" style="top: 0px; left: -1px;"></canvas><span class="cufon-alt">chair</span></span></a></li>
                ...
                </li>
            </ul>
       ...
      <div class="shadow-down"></div> 
</div>

CSS

.wrapper-header{
width: 960px;
margin: auto;
position: relative;
height: 150px;}
...
.#btn-search-submit:hover{
background-position: 0 0;}

Answer №1

The problem lies in this section of the CSS:

*:focus {
    outline: none;
    position: absolute;
    text-transform: capitalize;
    left: 15px;
}

Having canvas elements within the links triggers the application of the above CSS when focused, resulting in layout changes. It seems unnecessary to have this CSS applied in this context. Removing "position:absolute" while retaining the rest may resolve the issue.

Answer №2

It is recommended to set position: relative; for both ul.menu li{} and ul.menu li a{}.

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

Infinite scrolling feature on Kendo UI mobile listview showcasing a single item at a time

Currently, I am utilizing the kendo ui mobile listview and encountering an issue when setting endlessScroll or loadMore to true. The problem arises as the listview only displays the first item in such instances. Upon inspecting with Chrome inspector, I ob ...

Is your mobile responsive dropdown causing issues with content placement?

After implementing a bootstrap header that collapses into a dropdown menu, I noticed that the content below it was being pushed down when the image moved properly but the text on the image did not. Even though the image moves correctly when the dropdown is ...

Restrict the use of font styles to specific languages

Is there a unique method to enable fonts to support specific languages and have other languages automatically use the selected font-family: fonts? ...

Table with expanded width, cut off cell content

As I work on building an HTML table, I've encountered a challenge. The table code looks like this: This is the structure of my table: <table class="table" style="font-size:22px; width:100%"> I want to ensure that everything fits within the pa ...

In a lineup of items arranged horizontally, the second to the last item is perfectly centered, whereas the final item stretches out to occupy all of the leftover

I am currently working on creating a horizontal list of items: https://i.sstatic.net/fu89D.png My goal is to have the second last item centered once the end of the list is reached, with the last item expanding to fill all remaining space. https://i.ssta ...

Display or conceal buttons based on the overflow height of another div

I want to dynamically show or hide buttons based on the overflow of a navigation list. If the list height overflows, display the buttons; if not, hide them. Using JQuery // This code snippet did not work for me! if($('#nav-list').prop(&apo ...

Tips for aligning child DIVS with UL elements in the center

I am currently working on the footer design, but I am facing an issue with aligning the 4 divs containing links in the center. While Dreamweaver shows them centralized, they appear decentralized when uploaded or tested on JSFIDDLE. My ideal layout would l ...

The Ng-include tag does not provide highlighting for its text

Within an ng-include template, I have a div that is not highlighting when hovered over. Although the cursor changes to a pointer when hovering over the text, attempting to click and drag to highlight it results in nothing happening. This issue is signific ...

Trouble with HTML and CSS design layout

I'm struggling to create a responsive design for my webpage. The layout should consist of black blocks that display images. Ensuring the layout adapts to different screen sizes is proving challenging. It needs to maintain its shape on smaller screens ...

Accessing the sdcard storage on Android: Active link ready for use

How can I turn storage links, like /sdcard/Pictures/, into clickable links with highlight and underline in a textview? I have tried using Linkify but it only supports web and email links. Is there another way to achieve this? ...

A step-by-step guide on utilizing NuxtLink to successfully pass data between pages

Having an issue with Nuxt Link: -Initially, I use a v-for to generate some HTML <li v-for="store in stores"> <p>{{store.companyName}}</p> <p> {{store.url}} </p> <NuxtLink :to="nextPage">C ...

Interactivity Battle: Clickable Div, Button, or href?

I'm currently exploring the optimal methods for generating buttons using HTML and CSS. In the past, I used clickable divs, but it seems that may not have been the most effective approach. Should I consider using buttons or anchor tags instead? What ...

Opacity of CSS3 Modals Background Non-Transparent

I'm currently working on developing a Pure CSS3 Modal. However, I encountered two issues along the way: The background doesn't change to transparent black color when the modal is clicked. This is a common feature in modals where it ...

What is the best way to ensure that this image is responsive and not overly tiny when viewed on Internet Explorer

Check out my website: Here's a snapshot of the problem: I've been struggling to make my image responsive and prevent it from shrinking on IE 8. The webpage functions well on most modern browsers except for IE 8. I want it to display properly ac ...

A linear progress indicator composed of a continuous solid line and dotted markers to represent individual steps

I am currently working on creating a vertical progress bar with 8 dots displayed on a solid line, where each dot represents a step in the process. Please refer to the attached screenshot (located at the bottom of this question to maintain clarity). My att ...

Arrange the child divs on top of the parent div

<div id="1"> <div id="2"> </div> </div> It is proving challenging to position div2 above div1 in the vertical dimension. Applying a negative top position does not have the desired effect, as it appears that the top border of the ...

When attempting to overlay CSS text onto an image, the text appears to be hiding behind the

Essentially, what I was attempting to do was overlay some text on top of an image on a website I'm creating. After researching online, I learned that I could achieve this by using position absolute and relative, which worked to some extent. However, n ...

At times, Firefox may fail to fully showcase an image in fullscreen mode

Currently, my goal is to showcase an image in fullscreen mode using JavaScript. (Refer to the Fullscreen API - https://developer.mozilla.org/en-US/docs/Web/API/Fullscreen_API) JavaScript snippet: var requestFullscreen = function(el) { if(el.requestFullsc ...

Toggle the visibility of several div elements simultaneously and adjust the dimensions of the remaining div element

My goal is to create an interactive layout with four 200px by 200px div tags. When a user clicks on one of the divs, I want it to expand to 800px by 800px and hide the other three div tags. The expanded div should be able to revert back to its original siz ...

Connect two cells in a table by incorporating a vertical line in between the rows. Merge header cells

I have incorporated some simple HTML tables on my website and I am encountering two issues that I need assistance with. 1) After adding these tables to my subpage, I noticed that the tables look almost identical but have their horizontal line between tab ...