How can I eliminate hyperlinks from entire cells within a table using CSS and HTML?

I'm looking to create a web page layout with a footer containing vertically aligned links. To achieve this, I'm currently using a table structure to list out links such as "Mobile", "Help", "Terms", and so on.

The issue I'm facing is that the links in the table become active when hovering over the entire cell, including empty areas. I specifically want the links to be active only when the mouse is directly over the text "Mobile", "Help", "Terms", and not when hovering over any other part of the cell or table.

I've tried to find a solution on Stackoverflow, but most discussions address the opposite problem where people want to activate links across the entire cell.

If anyone can provide assistance, that would be greatly appreciated. The code snippet is provided below.

HTML CODE

    <div id="footer">
<div class = "box2">
    <h6><a href="/error">Français</h6>
    <h6><a href="/error">English (US)</h6>
    <h6><a href="/error">Español</h6>
    <h6><a href="/error">Português (Brasil)</h6>
    <h6><a href="/error">Deutsch</h6>
    <h6><a href="/error">Italiano</h6>
    <h6><a href="/error">Русский</h6>
</div>

    <div class = "box3">
        <table class="table2">
            <tr>
                <td><h6><a href="/mobile">Mobile</h6></td>
                <td><h6><a href="/help">Help</h6></td>
                <td><h6><a href="/term">Terms and conditions</h6></td>
                <td><h6><a href="/developers">Developers</h6></td>
                <td><h6><a href="/carriers">Carriers</h6></td>
                <td><h6><a href="/other">Other</h6></td>
            </tr>
            <tr>
                <td><h6><a href="/blog">Blog</h6></td>
                <td><h6><a href="/findus">Find us</h6></td>
                <td><h6><a href="/pics">Pics</h6></td>
            </tr>
        </table>

    </div>
        </div>

CSS CODE

#footer {
    height: 110px;
    background: #80B2E6;
    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#80B2E6), color-stop(100%,#3385D6));
    background: -moz-linear-gradient(top, #80B2E6 0%, #3385D6 100%);
    background: -webkit-linear-gradient(top, #80B2E6 0%, #3385D6 100%);
    background: -o-linear-gradient(top, #80B2E6 0%, #3385D6 100%);
    background: -ms-linear-gradient(top, #80B2E6 0%, #3385D6 100%);
    background: linear-gradient(top, #80B2E6 0%, #3385D6 100%);
}

.box2
{
    width:800px;
    border-bottom:1px solid lightgrey;
    display:inline-block;
    padding-top:20px;
}

.box3
{
    width:800px;
    padding:0;
}


.table2 {
    width:450px;
    padding:0;
    font-size:11px;
    table-layout: auto;
    float:left;
    border-collapse:collapse;

}


h6 {
    font-weight: normal;
    font-size: 11px;
    max-width: 800px;
    color: white;
    margin:0;
    padding-bottom:3px;
    padding-right:10px;
    /*display:inline-block;*/
    float:left;
}

h6 a:link {
    color:white;
}

.table2 td a {
    color:white;
    display:inline;
}

a:link {
    text-decoration:none;
    color: #54544B;
}

table {
    width:420px;
    /*height: 200px;*/
    padding:10px;
    margin-bottom:10px;
    border-collapse:collapse;
    table-layout: fixed;
}

td
{
    text-align:center;
    position:center;
    padding-top: 3px;
    padding-bottom: 3px;
    -webkit-hyphens: auto;
    -moz-hyphens: auto;
    -ms-hyphens: auto;
    -o-hyphens: auto;
    hyphens: auto;
    word-wrap: break-word;
}

tr, div {

}

Answer №1

Make sure to properly close all link tags using </a>. An example would be changing

<section><h3><a href="/services">Services</h3></section>

to

<section><h3><a href="/services">Services</a></h3></section>

Remember to do this for every link in your code.

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

Next.js encountering page not found error due to broken link URL

Currently, I am working on implementing a login system in next.js. In the login page, I have included a Link to the Register page using the Link href attribute. However, every time I click on that link, it displays a message saying "404 page not found." Al ...

What could be causing the malfunction of the .setAttribute() and .removeAttribute functions in my JavaScript program?

Below is a flashcard game I have developed: Once a user enters the correct answer in the text box, "Correct!" is expected to be displayed in bold green font. The CSS attributes are then supposed to be removed shortly after. Here is the HTML code for the i ...

Ways to conclude a running function

This script has been created by me: $(document).ready(function(){ $("div#tabs a").hover(function(){ rod = this.id $('div.tabber').hide(); $('#tabber_' + rod).fadeIn(); $("div#tabs a").removeClass("ta ...

Changing Images with Button Click in Javascript

I am facing an issue with my buttons that should swap images once clicked. The first two buttons work perfectly, but for the third and fourth buttons, the images do not disappear when clicking another button. Below is the current code in the document head ...

How can I eliminate the border appearance from a textfield fieldset component in Material-UI?

I have been struggling to remove the border using CSS code I found on Stack Overflow, but unfortunately, the issue persists. If anyone could kindly assist me in fixing this problem, I would be extremely grateful. Can someone please advise me on the specif ...

Uncertainty surrounding the extent of a button's scope within an Angular application

(click) event in one instance of a component is causing the function in another instance to be triggered unexpectedly. I am having trouble describing this issue. For reference, I have included a working example on stackblitz. When clicking on both buttons ...

Pulling out a particular row from an HTML table with the help of HTML::TreeBuilder

I am a beginner in perl programming and I am facing a major challenge. I need to parse an HTML file that contains a single table, and extract a specific row based on one of its column entries. Here is a snippet of the HTML file: many previous rows descri ...

How to Retrieve the Current div's ID in VueJS

When using the v-for directive to dynamically generate an id for my div, I need to pass this unique id to a specific function. <div v-for="(item, index) in items" :key="index" :id="'form' + index" > ...

Prevent floating labels from reverting to their initial position

Issue with Form Labels I am currently in the process of creating a login form that utilizes labels as placeholders. The reason for this choice is because the labels will need to be translated and our JavaScript cannot target the placeholder text or our de ...

Changing color of entire SVG image: a step-by-step guide

Check out this SVG image I found: https://jsfiddle.net/hey0qvgk/3/ <?xml version="1.0" encoding="utf-8"?> <!-- Generator: Adobe Illustrator 19.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> <svg version="1.1" width="90" height="9 ...

Ways to change the border color of Bootstrap cards

While working on my webpage, I utilized bootstrap cards to maintain a clean and organized layout. By default, bootstrap cards are white in color. Unlike the navbar, where you can easily set color options like navbar-dark, changing the color of the cards re ...

Angular: Compilation of SCSS/SASS results in unexpected whitespace issues

I am encountering an issue with whitespace being added to the CSS after compiling a *.scss file in my Angular 7 project. This unwanted whitespace is causing incorrect results in the UI. To replicate the problem, you can visit... ...and copy and paste the ...

Enhancing audio control features using HTML and JavaScript

After utilizing various suggestions, I have successfully created a basic audio slider that starts playing sound (at zero volume) when clicked by the user. They can then adjust the volume as needed. My only challenge is that the volume adjustment only occu ...

Discrepancies in button padding across desktop and mobile platforms

I have created a sample button and included a jsfiddle link to showcase the code. Due to the font properties of the specific font I'm using, I had to adjust the padding values differently for the top and bottom of the text to achieve a vertically cent ...

Utilize a unique font exclusively for Internet Explorer

I am encountering a significant issue trying to utilize custom fonts in Internet Explorer. Currently, I have implemented a specific font using @font-face and it works perfectly in modern browsers but fails to render properly in IE. The method I am curren ...

What methods are available to load sections of a complex SVG shape asynchronously?

I'm currently in the process of creating a website with a geographic map built using SVG, pulling data from OpenStreetMap. Due to its large size and potential for transformations such as zooming and moving, only a portion of it will be visible on the ...

What is the method for converting a string into HTML formatting?

I am working on a Django project. My goal is to display an output string on an HTML page. Here is my view: def strategy_run(request): output = "hello world!\nstring test" return render_to_response('strategy_run.html', locals()) T ...

Tips for evenly distributing these cards

Check out the full code on Codepen.io <div class="card-container"> <div class="card col-lg-4 col-sm-6 col-xs-12"> <div class="side">Jimmy Eat World</div> <div class="side back"><img ...

Unable to locate href within form when button is clicked

Whenever I try to click the borrow button, it directs me back to itself instead of executing the borrowing.php action. Can anyone suggest a solution for this issue? <form id = "myform" action="includes/borrowing.php" method = "POST" enctype ="multipart ...

Is it possible to utilize X-Y coordinates as repositories for values beyond just X-Y coordinates themselves?

I am in the process of creating a tile-based grid and I need to expand the X-Y coordinates to include additional values for determining characteristics of each tile, such as resources (for example, food, water, stone, lumber) within a game context. Conside ...