Strange CSS distortion - Surprising border-bottom setting when hovering

My application.scss file in SASS is causing unexpected CSS changes on the production server, particularly affecting my a:hover

Here is a snippet from my application.css:

pre {
  background-color: #eee;
  padding: 10px;
  font-size: 11px; }

a {
    color: #000000;
}
a:visited {
    color: #666666;
}
a:hover {
    border-bottom: none;
}

div {
  &.field, &.actions {
    margin-bottom: 10px; } }

However, Firefox reports different CSS on the production server:

pre {
    background-color: #EEEEEE;
    font-size: 11px;
    padding: 10px;
}
a {
    color: #000000;
}
a:visited {
    color: #666666;
}
a:hover {
    border-bottom: 1px solid #777777;
}
div.field, div.actions {
    margin-bottom: 10px;
}

On my development machine, Firefox shows the following CSS instead:

a:hover {
    border-bottom: medium none;
}

I am using Rails 3.2.13 and I have never encountered this issue before. I have spent hours trying to fix this problem as it negatively impacts the appearance of my homepage, making it look unprofessional.

Answer №1

Initially, it's important to understand that border-bottom serves as a shorthand property, encompassing border-bottom-width, border-bottom-color, and border-bottom-style. These values can be arranged in any order or even omitted.

The value none relates to the border-bottom-style.

Furthermore, what appears in the Firefox inspection tool may not reflect your exact CSS code. For instance, border-bottom: medium none; indicates a style change to none, while retaining the width as medium (likely inherited).

To access the genuine CSS, refer to the actual CSS file for accurate information and media query wrappers.

Lastly, if you wish to eliminate the bottom border, utilize border-bottom: 0;. This action equates to setting border-bottom-width: 0;, effectively eliminating the border altogether.

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

"Centering an Image in ASP.NET HyperLink Control: A Step-by-Step

Here is the setup for my control: <asp:HyperLink CssClass="link-image" ID="Link1" runat="server"/> Code-behind in C#: Link1.ImageUrl = "imagePath"; Resulting HTML code: <a class="link-image" id="MainContent_Link1"> <img alt="" src=" ...

What steps should be taken to enable SCSS in Jest for unit testing in TypeScript Next.js?

I am facing an issue with the scss import in my project. I have attempted to solve it by using mockup and identity-obj-proxy, but neither of them seems to work. I suspect that there might be a problem with my regex expression. The specific error arises fr ...

The precise placement of DIVs with a background image

Is there a way to properly position DIVs on top of a background image without them shifting when the screen size changes? Media Query hasn't been successful for me. Any suggestions? Here is my code: <div class="div-bg" style="background-image:url ...

The CSS keyframe for mobile devices initiates from 100% and then proceeds to animate

Having some trouble with CSS animations on mobile devices. The animation works perfectly fine on desktop, but on mobile, it seems to display the final 100% keyframe first before animating from 0%. I've tried adding the initial style directly to the cl ...

What is the best way to create a dynamic textbox or label within a specific div class?

I need assistance with my dynamic asp.net page where I am generating labels and text boxes in a form. Is there a way to ensure that these elements are generated within a specific div class? Below are the relevant code snippets: for (int i = 0; i < cou ...

Steps for adding a border to kendo grid row hover

One of my tasks involved creating a grid using Kendo, and I wanted to display borders on a grid row when the cursor hovers over it. I attempted the following code snippet: .k-grid > table > tbody > tr:hover, .k-grid-content > table > tbody ...

Switching the background image upon clicking a navigation item in CSS

Is there a way to change the background color of this nav element when it is active/clicked using CSS? <div class="row container-fluid mainTabCon" style="width: 100%" style=""> <ul class="nav nav-pills" style="margin: 0 auto; "> ...

Struggling to target the child elements of an unordered list with jQuery?

Need help with selecting the children of a list item in a jQuery mobile navigation? I am having some trouble with this task. Here is a fiddle demonstrating what I have done so far: http://jsfiddle.net/jhrz9/ <div data-role="panel" id="left-panel" data ...

Creating a multiline textarea with ellipsis using ReactJS

Looking to create a component with a multiline textfield that displays ellipsis (...) for text overflow beyond 2 lines. How can I achieve this through CSS only without modifying the actual stored text? Utilizing the React component found at: link Appreci ...

Utilizing JavaScript to adjust the width of an HTML element

Struggling to manipulate the position and size of a div tag using a JavaScript function, particularly confused about how to retrieve the current width of the div. Here is the function in question function socialExt() { document.getElementById("Left") ...

Guidelines for implementing a seamless translation effect with CSS3

CSS: .horizon { position: absolute; top: 380px; width: 1800px; height: 50px; background: url(images/road.png) repeat-x; -webkit-animation-name: prop-600; -webkit-animation-duration: 20s; -webkit-animation-iteration-count: i ...

Is it possible to include a div above a centered image?

Currently I am working with ImageFlow and I would like to overlay a div on top of the image when it is clicked, sliding it into the center. I have been looking through the JavaScript file but the function MoveIT() seems to be called multiple times and I am ...

What causes the appearance of a blue vertical line on the left edge when loading HTML <blockquote> content into a TextView on an Android device?

element, my application displays HTML content in a textview. However, I noticed that the presence of blockquote elements causes an issue with styling. Specifically, I want to format the content within blockquotes similar to paragraph tags. I also aim to ...

jQuery mobile : accessibility helper for hidden elements

Within my HTML structure: <div data-role="fieldcontain" id="containdiv" class="no-field-separator"> <label for="field1" class="ui-hidden-accessible">To</label> <input type="search" name="field1" id="field1" autocorrect="off" a ...

Strange Safari 15 bug causing unexpected transformations

Hey there, I'm a div with animation on scroll using GSAP. On Safari 15 (no issues below 15), something strange is happening - parts of the letters are leaving an afterimage on the sides. The code snippet I am using for this animation is: this.$refs.l ...

Passing JSON data from Rails controller to AJAX request

In this section of my JavaScript file, I have an AJAX call: $("#sign_submit").click(function(){ email_id = $("#user_email").val(); password = $("#user_password").val(); data = {email: email_id, password: password }; ...

What is the best way to show and hide the information in a FAQ section when each one is clicked?

const faqItems = document.getElementsByClassName("faq-question"); const faqContents = document.getElementsByClassName("faq-content"); for (item of faqItems) { console.log(item); item.addEventListene ...

"Exploring Bootstrap 3: How to Work with Grids and Organ

Check out my custom HTML code: <div class="container"> <div class="row"> <div class="col-sm-3"> <img src="http://placehold.it/274x175"> </div> <div class="col-sm-3"> <img src="http://placeh ...

What are some techniques to ensure that my "display: grid" layout adjusts properly on mobile devices and tablets by implementing media queries?

Responsive Grid Design I am looking to transform my grid desktop view into a responsive layout for mobile and tablets using media queries in CSS. While it looks great on desktop, it does not adjust well on smaller screens. .grid-container { display: gr ...

CSS: Including an item in a list causes the <div> to expand upwards on the page instead of stretching downwards

I’m currently facing an issue with my list where, upon reaching a certain number of items (in this case 5), the list starts moving up the page instead of extending downwards as expected. I suspect that this problem is related to my use of CSS grid-templa ...