floating downward inside the container

Check out my website at . Everything looks great in Firefox, but when I view it in IE, the "top" button that should be floated inside the h2 titled "Unit 301: Pre-production skills" is floating to the right and getting pushed outside of the heading.

Any ideas on why this might be happening?

Here is a snippet of the HTML code:

<h2>
Unit 301: Pre-production skills
<a class="top" href="http://biteof.com/units_and_evidence/#top"/>
</h2>

And here's a glimpse at the CSS code:

h2 {
  background:#235ec9 0 0;
  color:#ffffff;
  display:block;
  font-size:16px;
  height:40px;
  line-height:40px;
  margin:10px 0 10px -12px;
  padding-bottom:0;
  padding-left:10px;
  padding-right:10px;
  padding-top:0;
  text-indent:30px;
  width:880px;
  clear:both;
}
a.top:hover {
  background-position:0 -40px;
}
a.top {
  background-image:url(images/top.gif);
  background-position:0 0;
  display:block;
  float:right;
  height:40px;
  width:55px;
}

Answer №1

Place the floated a on the left side of the HTML code, as shown below:

<h2>
<a class="top" href="http://biteof.com/units_and_evidence/#top"/>
Unit 301: Pre-production skills
</h2>

Answer №2

My understanding is that the issue could be related to the display:inline-block; property on the .top element, as IE may not fully support it. Have you tried changing it to display:block; or simply removing it to see if it resolves the problem?

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

execute javascript code found in the html document

Currently, I have a bash script that utilizes curl to download a page. Then, it uses grep and sed to extract javascript within the html block to a file. Following this, I use node to evaluate and leverage the downloaded javascript. Here is an example: cur ...

Invisible Thinglink image revealed upon resizing browser

I am currently repurposing a pre-existing theme that has a drop-down menu showcasing an image. I am attempting to integrate a Thinglink into the content section of this drop-down, but unfortunately, the image does not appear until I adjust the size of the ...

Modify content or display picture within accordion panel based on its identifier

In my view, I have a model representing a list of items. Each item has a unique ID, which is included in the H2 header tag. The details of each item are displayed in a div below the header. Initially, there is an image within the header that is set to disp ...

Interactive radio button selection with dynamic image swapping feature

I'm currently working on creating a radio list with three options: Salad Spaghetti Ice cream This is how I coded it: <div id="radiobuttons"> <label><input name="vf" type="radio" value="0" checked/>Salad</label> < ...

Interacting with local data using Express server

I am currently in the process of developing a web application for my web art class using Node.js with npm and Express. The concept behind the site is to have the entire body colored in one solid color, but allow users to text a hexcode/CSS color to a Twili ...

What could be causing my dropdown menu to not appear when clicked?

I am trying to implement the functionality shown in the image. When the Settings button is clicked, a window should open allowing the user to navigate to their desired option. However, I am facing an issue where nothing happens when the button is clicked. ...

The challenge of resizing images using Chrome Print CSS

I have a unique method for centering an oversized image within its container. Everything works flawlessly, except when attempting to print in Chrome (printing in FF and IE behaves as expected). In Chrome's print preview, the image does not resize at a ...

What is the best way to equalize the size of mismatched images in CSS?

My Objective https://i.sstatic.net/KgK0F.png I aim to align images of different sizes and shapes within the same frame using only CSS. The image size should adjust proportionally as the browser window is resized. Current Progress JSFiddle Curr ...

What is the process for choosing a particular input element based on its size and type?

Among my pair of sets containing input type=text elements, each group is uniquely styled through CSS. In the first set, the length adjusts based on CSS using the width property. Conversely, in the second set, the size attribute determines the length of the ...

JavaScript - Attempting to insert a value into a text field by clicking a button

I am struggling to get my function to properly add the value of the button to the text field when clicked by the user. HTML <form name="testing" action="test.php" method="get">Chords: <textarea name="field"& ...

Use the arrow key to move through the different layers

I'm working on enhancing a custom auto-complete feature using JQuery. My goal is to allow the user to navigate down into the auto-complete dropdown and then back up to the input box that triggered it initially. The code snippet below demonstrates how ...

What are the steps to create two adaptable blocks and one immovable block?

Check out this HTML code snippet: <div style="border: 1px solid #000; width: 700px; line-height: 38px; display: block"> <div style="margin-left:10px;width: 222px; float: left; margin-right: 10px;"> Enter your question </div& ...

BS grid malfunctioning in a non-uniform manner

When a division in the advantage grid is clicked, the card body of another division collapses. However, this does not occur in the disadvantage grid. Clicking on one section in the disadvantage grid does not collapse another section as it does in the advan ...

Styling Labels with CSS Wildcard

I have been using the free NinjaForms plugin on my WordPress site. The default styling for labels is bold, but I prefer them to be lighter. Currently, I achieve this through CSS by targeting individual field IDs. However, this method becomes tedious when a ...

What causes jQuery's append function to trigger a redraw of my Div?

I have a unique function that incrementally increases the date by one day every second. Once the date matches specific dates, I aim to update my #newsDiv with extra text content. The #newsDiv will display all historical "news" and will be set to scroll to ...

Ways to display or conceal a textbox depending on the choice made from a dropdown list

I'm a beginner in using jquery. I'm trying to create a dropdown menu with different options. When "Others" is selected from the dropdown, I want a text box to be displayed. Can someone provide guidance on how to achieve this? Here is the code sni ...

Using canvas to smoothly transition an object from one point to another along a curved path

As a beginner in working with canvas, I am facing a challenge of moving an object from one fixed coordinate to another using an arc. While referring to the code example of a solar system on https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutori ...

Give a radio button some class

<input id="radio1" type="radio" name="rgroup" value="1" > <label for="radio1"><span><span></span></span>1</label> <input id="radio2" type="radio" name="rgroup" value="2" > <label for="radio2"><span ...

Adding list items to an unordered list without making them draggable using jQuery

How can I allow users to build a list of sports and drag them into a "cart" using jQuery? The issue I'm facing is that the appended list items are not draggable, and I'm unsure of how to solve this problem. /* JS code for sports.html */ $(fu ...

AngularJS allows you to toggle the visibility of a div at set intervals, creating

I am struggling with the task of showing and hiding a div that serves as an alert for my application. Currently, I am using $interval to create a continuous show and hide action on the div. However, what I aim for is to have the DIV visible for X amount o ...