How to Resize Images in Internet Explorer and Firefox Using CSS

Having an issue with CSS formatting on Internet Explorer and Firefox. I am trying to create a navigation bar with several images displayed in a column, using a background image. I positioned the background image on the page and then created a div inside it to hold each image link, formatting them with CSS. While this works perfectly in Safari, in IE and Firefox, the images do not scale to fit the background image.

Below is the relevant CSS from my page:

.nav_background_home{
width:17%;
position:absolute;
left:56%;
top:31%;
z-index:100;}

.nav_background_home .nav_items{
position:absolute;
top:8%;
z-index:150;}

img.nav_item{
margin-bottom:3.75%;
height:4.4%;
margin-left:7%;}

I included everything in the HTML:

<div class="nav_background_home"><img src="nav_background.png" width=100% />
<div class="nav_items">
    <img src="nav_items/set_design.png" class="nav_item" height=100% />
    <img src="nav_items/company_report.png" class="nav_item" height=100% style="height:4.1%;"/>
    <img src="nav_items/prompt_pages.png" class="nav_item" height=100% />
    <img src="nav_items/characters.png" class="nav_item" height=100% />
    <img src="nav_items/costumes.png" height=100% class="nav_item" style="margin-bottom:2%;" />
    <img src="nav_items/video.png" height=100% class="nav_item" style="height:4.1%;" />

</div>

While Safari displays this perfectly, Firefox and IE are not scaling the images. I tried removing "height=100%" from the HTML, but it did not solve the issue. You can see the site here: .

Thank you!

Answer №1

Make sure to set the height to "100%" and width to "100%" to begin.

Additionally, consider validating the code using the tool http://validator.w3.org/check

This process can reveal various minor issues that some browsers may handle differently.

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

Assign a class to an element depending on its position using JavaScript/jQuery

<ul> <li>Apple</li> <li>Banana</li> <li>Orange</li> </ul> How can I use jQuery to add a class to the second li element in the list without using an existing class or id? ...

"Utilizing Bootstrap CSS along with a variety of other CSS/HTML component bundles

Recently diving into the world of Bootstrap for my ASP.NET MVC project has been a game-changer! I'm in awe of its capabilities and functionality. However, I can't help but wish there were more ready-to-use components available to streamline the d ...

Click on a div in AngularJS to be directed to a specific URL

I'm currently working on developing an Angular mobile app and I want to be able to navigate to a specific URL, like www.google.com, when a particular div is clicked. Unfortunately, I'm still new to the world of Angular and struggling to achieve t ...

Creating an unordered list (ul) with list items (li) that extend the full width

Having trouble making my list items (li) from the unordered list (ul) stretch across the page like the navigation bars on websites such as Verragio and James Allen. Can someone assist me with this? Here is a basic example of a nav hover bar. .dropdown-b ...

pass user identification by using a link using php and MySQL

In my table of items, there is an option for users to delete or restore each item, using a special PHP file called 'delete.php'. print "<td>"; if ($row['deleted'] == 'y') { print "<a href='delete.php?id=2'& ...

Guide to customizing WordPress header menu buttons with CSS, excluding a specific button

I need help with custom CSS for my WordPress site. I want to apply a hover effect to all menu buttons except for the "Contact" button, which already has its own styling. The CSS code adds a growing line beneath the hovered menu item and a static line unde ...

What is the best way to open a browser window at a quarter of its default size?

Is there a way to open a window at 25% of its default device browser window size? I attempted the code below, which worked. However, it only accepts pixel inputs and not relative % values. This makes it non-scalable across various devices. window.resizeT ...

Text field auto-saving within an iFrame using localStorage is not functioning as expected

My goal is to create a rich text editor with an autosave feature using an iframe. Although each code part works individually, I am struggling to combine them effectively. View LIVEDEMO This graphic illustrates what I aim to accomplish: The editable iFram ...

Guide on using bootstrap collapse feature with two buttons sharing the same data-target, ensuring that the collapsible element does not collapse if it is already

I have successfully implemented two buttons that collapse and show the same card. However, I am now seeking a solution to prevent the card from collapsing if it is already shown by one button. When the card is visible, both buttons should be able to show ...

Choosing jQuery over JQuery Mobile for a standard web application to effectively manage different devices

Creating a Unique Web Application In the works is a unique web application, similar to Trello, that divides a page into columns where tasks/cards can be added and moved between them. This desktop-focused platform will feature an information column on the ...

Customizing the appearance of jQuery accordion components

<script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.min.js" language="javascript"></script> <script type="text/javascript" src="http://www.compactcourse.com/js/accordionNew.js" language="javascript"></script> < ...

Guide on positioning an SVG button within a form

I am attempting to design a form with two input fields and a button. Rather than using a plain text button, I prefer to utilize an SVG graphic for the button; however, it is not aligning correctly. Consider the following HTML and CSS: body { backg ...

The project is experiencing difficulties in loading the Module CSS

Currently, I am working on a React module and have set up a React project to demonstrate the functionality of this module. Initially, everything was working smoothly until I encountered an issue with the webpack configuration related to the CSS loader. { ...

The html function does not contain the value of the textarea

While attempting to retrieve the HTML content of a div using the code below, I noticed that it does not include the text entered in the textarea or input field. var mywindow = $(printDiv).html(); The variable mywindow will contain all the HTML except fo ...

Div over which scroll editing is performed

I want to develop a website where my title div remains fixed in one position as I scroll down. However, the issue arises when I set it to be fixed because my navigation button on the left disappears and I'm unsure how to keep it in place. // JavaSc ...

Error encountered: The property indexOf cannot be read. Possible issue with .load() function in jQuery causing this error

https://i.sstatic.net/R7zUX.png As I navigate through the page and interact with different elements, I encounter an error message. The Obj function, which is responsible for setting a property value in an object from a handlebars template input and loadi ...

Utilizing React Refs to Retrieve Value from HTML Select Element

I am currently working on a form that includes the use of an HTML select element. <select className="form-control" id="ntype" required > <option value = "">None</option> <option value = "1">1</option> < ...

Changing Tailwind CSS variables for customization

Using Variables in index.css : :root { --property: 1; } A Different Approach to Changing it with CSS on Hover: img{ transform: scale(var(--property));; } .another-element:has(:hover, :focus) { --property: 1.1; } There's a way to inclu ...

Using conditional statements in CodeIgniter to display various menus

I encountered an issue with a variable in my code. When I attempt to retrieve its value, it shows up as undefined despite having stored the session of the variable "$level" and passing it to the view. I find it strange that the condition of the variable tu ...

AngularJS html tags are displaying instead of processing

One of my variables looks like this: $scope.someVar= "Some<br>text<br>here"; When I display it in my HTML file using {{ someVar }}, it shows up like this: Some<br>text<br>here But I really want it to look like this: Some t ...