In certain browsers, the link changes color to white

As I assist my brother in setting up a website for his business, we encountered an issue. In some browsers, hyperlinks appear as white and therefore invisible. Interestingly, the hyperlink is white in Firefox, but not when browsing in incognito mode, see this screenshot. (1) (Initially, I thought the problem was resolved, but it was due to cache flushing issues.) Although the link is functional and clickable if you know where to find it, it remains unseen.

Here is the HTML code for index.html:

<html>
<head>
        <link rel="stylesheet" type="text/css" href="style.css">
        <title>Albin's Ice Cream and Delicacies</title>
</head>
<body>
        <img alt="Albin's Ice Cream and Delicacies" src="images/albinsicecream.gif" style="width: 320px; height: 175px; display: block; margin: 0 auto;"/>
        <div class="menu">
                <ul class="menu">
                        <li><a href="index.html">Home</a></li><li><a href="products.html">Products</a></li><li><a href="schedule.html">Schedule</a></li><li><a href="contact.html">Contact</a></li>
                </ul>
        </div>
        <p>Welcome to <i>Albin's Ice Cream and Delicacies</i>, your local ice cream truck with delicious Swedish quality ice cream from <i>Engelholm’s Glass</i> and tasty locally-produced cheesecake!</p>
        <p>The ice cream is made in Ängelholm by the Swedish family company Engelholms Glass. They prioritize highest quality and produce cream-based ice cream with the best ingredients. <a href="http://www.engelholmsglass.se" target="_blank">Read more about Engelholms Glass here.</a></p>
        <p>The cheesecake comes from <i>Stella's Cheesecake</i> in Pilås! <a href="http://www.stellasostkaka.se" target="_blank">Read more here.</a></p>
</body>
</html>

Below is the CSS code for the site:

body {
        max-width: 960px;
        margin: 0 auto;
        float: none;
        font-family: "Arial", Arial, sans-serif;
}
a:link, a:visited {
        text-decoration: none;
}
a:hover, a:active {
        color: #FF9595;
}
.menu a:link, a:visited {
        display: block;
        width: 120px;
        font-weight: bold;
        color: #FFFFFF;
        background-color: #00AEEF;
        text-align: center;
        padding: 4px;
        text-decoration: none;
        text-transform: uppercase;
        font-family: "Times New Roman", Times, serif;
}
.menu a:hover, a:active {
        background-color: #0066CC;
}
b {
        font-weight: bold;
}
c {
        text-align: center;
}
i {
        font-style: italic;
}
p {
        margin: 10px;
        overflow: visible;
}
div.menu {
        margin: 10px auto 25px;
        width: 536px;
}
ul.menu {
        list-style-type: none;
        margin: 0 auto;
        padding: 0;
        overflow: hidden;
}
.menu li {
        display: inline;
        float: left;
}

The website under discussion can be accessed here (in Swedish):

Please note that there seems to be a restriction on new accounts regarding the inclusion of more than two links. Here's a pastebin link containing the mentioned four links.

Live long and prosper!

Answer №1

After clicking on the provided link, the CSS selector .meny a:link, a:visited { is activated, setting the color to white.

If you wish, you can customize the CSS to change the color or create a separate rule altogether.

I recommend modifying this section:

.meny a:link, a:visited {
        display: block;
        width: 120px;
        font-weight: bold;
        color: #FFFFFF;
        background-color: #00AEEF;
        text-align: center;
        padding: 4px;
        text-decoration: none;
        text-transform: uppercase;
        font-family: "Times New Roman", Times, serif;
}

to:

a:visited{
    color:#990099;/* Adjust this to set the color of plain links */
}
.meny a:link, .meny a:visited {
          /*  ^^^^^--This indicates that only links *within* your menu will be affected by these styles */
        display: block;
        width: 120px;
        font-weight: bold;
        color: #FFFFFF;
        background-color: #00AEEF;
        text-align: center;
        padding: 4px;
        text-decoration: none;
        text-transform: uppercase;
        font-family: "Times New Roman", Times, serif;
}

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

Replacing HTML elements with PHP's str_replace function

Looking for help with code: $newphrase = str_replace('href="/Css/IE6.css"', 'href="http://www.company.com/pgrddedirect/iefix.css"', 'href="/Css/IE6.css"'); I am trying to use PHP's DOM to search an HTML file and modify ...

CSS shrink effect upon hovering

I'm currently working on designing a menu using <ul>/<li> tags along with CSS styles. Here's the progress I've made so far with my menu design: https://jsfiddle.net/gANfS/6/ However, I encountered an issue where if you hover ov ...

Guide on displaying ajax data using PHP

I'm attempting to display the user-entered data by using AJAX to transfer it and then trying to print or echo it with PHP, but I'm having trouble getting it to work. enter code here Here is my code: <html> <head> <title> ...

I am having trouble displaying the background on my website using css/html

I'm currently working on enhancing my website BJBGaming1.com, and I've encountered an issue with setting a background. Here's the code snippet I have: <!doctype html> <html class="no-js" lang="en"> <head> <meta charset= ...

Troubleshooting problems with scrolling on JavaScript in Edge, Opera, and Chrome

Currently, I am developing a fun CSGO-inspired box opening feature on my food recipe website that randomly selects recipes for users. However, I have encountered some challenges with the scrolling functionality. It seems to be incompatible with certain bro ...

Avoiding the <br> tag in list items with TinyMCE

I am currently using tinyMCE and I needed to enable the "force_br_newlines: true" option. Without this setting, if I press the "Enter" key twice and check the source code, I only see one <br> tag. However, when I set the option to TRUE, it creates a ...

Flashing on objects, Chrome-exclusive, utilizing background-blend-mode exclusively

Our website, www.desirio.com, utilizes a background-image on the body with the following CSS property: background-blend-mode: luminosity An issue we have noticed in Chrome is that when hovering over elements, strange white lines randomly flash on the scr ...

Webpack2 now transforms sass/scss files into JavaScript rather than CSS during compilation

I've created a webpack script to compile all .scss files into one css file. I decided to use webpack instead of gulp or grunt for simplicity, as it can be configured in a single file. However, I am encountering an issue where scss files are being com ...

What is the best way to troubleshoot an unresponsive button element to determine the listeners it has?

In a previous situation, I encountered an issue with the event modifier of a nested b-input not working as expected. To resolve this, I had to add .native because I was interacting with a component: b-dropdown(text="Actions") b-drop ...

Seeking guidance on implementing toggle buttons for navigation bar items on mobile screens, enabling them to toggle for a dropdown menu. The tools at my disposal are HTML, CSS

I want to make the navigation menu responsive by adding a toggle button for the dropdown menu on mobile screens. Here is the code snippet: .nav-link { display: inline-block; position: relative; color: black; } html,body{ height: 100%; width ...

I can't seem to get the dropdown list to appear. What could be the issue?

I'm currently trying to create a pure CSS dropdown menu on hover by following this tutorial. However, despite multiple attempts, I'm still stuck and in need of some clear explanations for my issue. <div class="navbar"> ...

Lose the scrollbar but still let me scroll using the mouse wheel or my finger on the fullscreen menu

I am currently working on a fullscreen menu design. However, when the menu appears, some elements are not visible unless I apply the overflow-y: scroll property to the menu. But I don't like the appearance of the additional scrollbar that comes with i ...

It is not possible to attach separate links to images in a JavaScript slider

I am struggling with linking individual images in a JavaScript slider for a client's website. The slider is fully functional and works well, but I can't seem to figure out how to link the images properly. When I remove items from <--ul class= ...

Steps for modifying a cell within a table using a button click

Hello, I am currently working on a project where I want to display a specific div portion when a user clicks on an image icon within a table. However, I am encountering an issue with the JavaScript code as it only shows the div portion in the first row and ...

The values in my JavaScript don't correspond to the values in my CSS

Is it possible to retrieve the display value (display:none; or display:block;) of a div with the ID "navmenu" using JavaScript? I have encountered an issue where I can successfully read the style values when they are set within the same HTML file, but not ...

Adding a class to unhovered elements with jQuery/JS: a step-by-step guide

I have a variety of elements that are almost working how I want them to. There are four divs in total. Depending on the URL visited, I want a specific div to be fully transparent/active. The next div in line should animate in and out of transparency simul ...

Incorporating external files into Javascript code may cause issues with its functionality

Currently, I have a fully developed PHP theme that I am in the process of designing. Within this theme, I have integrated an image slideshow plugin to enhance its functionality. The following code represents the implementation of the image slideshow: &l ...

What steps do I take to eliminate this additional content?

Currently working on a web messenger project and facing an issue with a specific bar that I want to remove from my interface: https://i.sstatic.net/sp05i.png Within the Home.blade.php file, the code snippet looks like this: @extends('layouts.texter& ...

Is the post secure if a HTTP web page sends an ajax request to a HTTPS url?

If I developed an HTML/jQuery widget to be embedded on third-party websites with users of very limited technical knowledge and potentially missing SSL certificates, would the information posted securely through AJAX Post to a secure URL remain protected? ...

Looking to recreate this style of table using HTML and CSS?

Trying to replicate the layout from this image for my blog, but struggling with the source code. Any suggestions on how to achieve a similar design without using divs within table rows? Looking for a cleaner solution. ...