Why can I only click on the text of my button?

Looking for a quick fix here! I've been trying to make the entire button clickable, but so far, only the text is hyperlinked. Any suggestions on how to enclose the whole button with the link? As you can see, I'm working on making it mobile-friendly which is why the buttons are duplicated.

Here's my code:

<head>
<style>
body {
    background-color: #e3e3e3;
    margin: 0 auto;
    padding: 0;
    font-family: Arial;
}
/* Rest of the CSS stylesheet omitted for brevity */
<link rel="stylesheet" type="text/css" href="about.css">
</head>
<body>
    <div class="header">
        <h1>Who I Am</h1>
            <ul class="links">
                <li><a href="www.youtube.com"><strong>CONTACT</strong></a></li>
                <li><a href="www.youtube.com"><strong>PORTFOLIO</strong></a></li>
                <li><a href="#middle"><strong>RESUME</strong></a></li>
                <li><a href="index.html"><strong>HOME</strong></a></li>
            </ul>
            <!-- Mobile links section -->
           <ul class="mobilelinks">
               <li><a href="www.youtube.com"><strong>MY LIFE</strong></a></li>
               <li><a href="www.youtube.com"><strong>PORTFOLIO</strong></a></li>
               <li><a href="#middle"><strong>RESUME</strong></a></li>
               <li><a href="index.html"><strong>HOME</strong></a></li>
           </ul>
        </div>
       <!-- More HTML content omitted for brevity -->
   </body>

Answer №1

Consider including

the style rule display:block

within the tags <a></a> for links.

.links li a {
   display: block;
}

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

Creating a dynamic form field using JavaScript

I'm struggling with a JavaScript issue that requires some assistance. I have a form sending an exact number of inputs to be filled to a PHP file, and now I want to create a preview using jQuery or JavaScript. The challenge lies in dynamically capturin ...

Tips for aligning buttons in the center of a card both vertically and horizontally

I am currently utilizing the following bootstrap template to develop a Help Desk Ticket App: After the user logs in on the index page, there are two cards available for the user to choose between heading to the app's dashboard or creating a ticket. I ...

Having trouble getting Jquery to work with an Ajax call in the cart drawer. Any suggestions on how to resolve this issue

I used this code to implement a collapsible feature in my Cart Drawer, but it seems to stop functioning after an Ajax call. Any suggestions on how to troubleshoot and fix this issue? Just for context, I included onclick="return false;" in the bu ...

How can Chinese characters be transformed into XML/HTML-style numerical entities and converted into Unicode UTF-8 encoding?

I have a situation where I need to change a text that contains both English words and Chinese characters into a format that includes XML/HTML-style numerical entities for the Chinese characters. Here's an example of the original text: Title: 目录. ...

The style attribute transforms the background-image url quotation to become &quot;

I'm currently working on creating a catalog component that will allow me to display images, titles, and descriptions multiple times. Below is the code for this component: import React from "react"; import '../pages/UI.css'; import ...

Finding the height of concealed content within a div using the overflow:hidden setup

I'm trying to create a div that expands when clicked to reveal its content. I've taken the following steps so far: Established a div with overflow:hidden property Developed a JavaScript function that switches between a "minimized" and "maximize ...

The element fails to receive the class when it is being clicked

Currently, I am in the process of developing a Joomla website and I am working on implementing an accordion feature for the category descriptions based on the placement of H3 headings in the WYSIWYG editor. Here is the basic function I have so far (althou ...

What is the best way to showcase 100 json data entries within an HTML document?

Starting from scratch with html, css, and javascript, I've embarked on a basic learning project. Within this project, I plan to create two main pages: a list page and a detail page. The list page will showcase posts on the html screen, featuring only ...

What is the best way to perform an action in the database using JavaScript without needing to refresh the page

I have written a code that retrieves data from a table, with each row containing two buttons for updating the database with a fixed value and deleting the row. I am looking to perform these actions without reloading the page. Below is the table code: &l ...

Issues with POST data not being received by MVC 4 APIController

Although this issue has been addressed numerous times, I am still unable to pinpoint the error! Here is a straightforward JS script that sends data back to the ApiController. function WebCall(url,parameterObject, callBackFunction) { this.callbackfunction ...

Focusing on styling specifically for Chrome rather than Safari using SCSS

Is there a method to specifically target only Chrome browsers within a mixin in SCSS? @mixin { &:after { border-bottom:black; @media screen and (-webkit-min-device-pixel-ratio:0) { border-bottom: red; } } } Currently, this code targets bot ...

Ways to showcase the contents of a React JavaScript document, or more specifically, a file designed for React interpretation

After trying multiple solutions, I found a conceptual guide on How to call and form a React.js function from HTML. However, the HTML generated doesn't seem to be calling from the JavaScript file as expected. It appears identical to what is mentioned i ...

Updating the data-id attribute of an item using jQuery UI Sortable

Imagine you have a set of sortable objects like this: <ul class="photos ui-sortable"> <li class="photo" data-id="1"></li> <li class="photo" data-id="2"></li> <li class="photo" data-id="3"></li> < ...

What is the best way to ensure HTML validation during a pull request?

Are there any tools available to validate all specified files in a pull request? I have previously used Travis CI for testing and am now searching for a similar plugin focused on validation rather than tests, such as W3C validation. ...

Update class on window scrolling

I am facing a challenge with elements on my website that have the default class of "active". I would like to remove this class as soon as a user scrolls down the page, and then add it back when they return to the top, both with a 10px delay. The code below ...

Different "criteria" for CSS wildcard selectors using Selenium

There are several CSS webelements on my page with ids in the format: cell_[number]-button_[number] I am attempting to target ALL of these elements by using Selenium to locate all elements that begin with cell and include button: var elements = Util.driver ...

The CSS property overflow-x:hidden; is not functioning properly on mobile devices despite trying multiple solutions recommended online

Seeking help on a persistent issue, but previous solutions haven't worked for me. Looking to implement a hamburger menu that transitions in from offscreen. The design appears correctly on desktop and simulating mobile, but actual mobile view require ...

Dynamically uploading an HTML file using AJAX

My webpage has a feature that dynamically creates HTML with drop down elements. Additionally, there is a "create File" button on the page. The goal is for this button to trigger an AJAX POST request and upload the dynamic page created with drag and drops a ...

tips for integrating html5 elements with django forms

I am interested in utilizing the following code: # extra.py in yourproject/app/ from django.db.models import FileField from django.forms import forms from django.template.defaultfilters import filesizeformat from django.utils.translation import ugettext_ ...

Bug with IOS double tap on Element UI VueJS select input element

Encountering a strange problem on iOS safari or chrome. When attempting to select an option from a dropdown input, the options show up correctly on the first tap, but when trying to actually select an option, it requires two taps to work properly. This is ...