Newbie inquiry: How to increase clickable area between buttons in CSS?

Thanks for all the assistance so far.

Is there a way to eliminate that unwanted clickable space above my navbar?

Appreciate it!

Visit this link for reference

* {
  padding: 0;
  margin: 0;
}

body {
  background-color: antiquewhite;
}

nav {
  background-image: linear-gradient(to right, darkgreen, limegreen);
  border-top: 5px solid darkgreen;
  margin-top: 30px;
  height: 50px;
  position: relative;
  width: 100vw;
}

a {
  text-decoration: none;
  color: AntiqueWhite;
  font-family: arial;
  font-weight: bold;
}

nav .danctes {
  position: absolute;
  left: 20%;
  top: 50%;
  transform: translate(-50%, -50%);
}

ul {
  float: right;
  list-style-type: none;
  position: absolute;
  right: 10%;
  top: 50%;
  transform: translate(-50%, -50%);
}

li {
  display: inline-block;
}

.danctes {
  font-size: 1.75em;
}

ul a {
  text-transform: uppercase;
  margin: 0 5px;
  font-size: 1.25em;
  border: 1px solid red;
}
<!doctype html>
<html>

<head>
  <title>
    My first navbar
  </title>
  <link rel="stylesheet" href="mystyle.css">
</head>

<body>
  <nav>
    <div class="danctes">
      <a href="#">danctes
          </a>
    </div>
    <ul>
      <li><a href="https://www.digisport.ro/">Home</li>
          <li><a href="https://www.reddit.com/">Reddit</li>
          <li><a href="https://9gag.com/">9gag</li>
          <li><a href="https://www.facebook.com/">Facebook</li>
          <li><a href="https://www.instagram.com/">Instagram</li>
        </ul>
      </nav>
    </body>
    </html>

Answer №1

Don't forget to close the tag properly.

<ul>
      <li><a href="https://www.digisport.ro/">Home</a></li> <!-- </a> missing in your code -->
      <li><a href="https://www.reddit.com/">Reddit</a></li>
      <li><a href="https://9gag.com/">9gag</a></li>
      <li><a href="https://www.facebook.com/">Facebook</a></li>
      <li><a href="https://www.instagram.com/">Instagram</a></li>
</ul>

If you need more guidance, check out: https://www.w3schools.com/tags/tag_a.asp

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

Facing challenges when attempting to store data with find() on Internet Explorer

I'm currently immersed in a project that involves fetching data through ajax jQuery. The code I am utilizing is as follows: $.ajax({ dataType : 'html', type: 'POST', url : url, //cache: false, ...

HTML and CSS: Focus on border for <td> cells only

I'm looking to apply a border to only one cell (B2) without nesting tables. Here's the code: <table border="0"> <tr> <td>A1</td> <td>B1</td> <td>C1</td> </tr> ...

Steps for Adjusting Column Heights in Bootstrap 4

Currently, I am experimenting with Bootstrap 4 and facing some challenges in setting the correct heights for my layout. The elements in my design include a "side nav", "header", "main", and "footer". My goal is to make the "main" section occupy most of th ...

When the input field is cleared, JavaScript will not be able to recognize its contents

Having an issue with my function that fetches results, <script language="javascript"> function fetchResult(value){ url="ajax_fetch.php?st=usr&q="+value; ajax(url); } fetchResult(" "); </script&g ...

The validation requirement in Angular prevents the form from being considered valid until the input has been modified

I have included the HTML5 required property in the below HTML code: <div class="col-sm-3"> <label>{{question.placeholder}}<span *ngIf="question.required">*</span></label> </div> <d ...

Unusual behavior exhibited by MUI Grid in the presence of spacing

I am working on a code snippet that looks like this: <Box sx={{height:'100vh', background: '#f5f7fc', overflow:'auto'}}> <Grid container justifyContent={'center'} padding={2}> <Grid item ...

Unlocking the Secret to Rotating a GroundOverlay on Google Maps

I am currently working on a map project that involves adding shapes and locations onto the map and saving it. However, I am encountering an issue with groundoverlay rotation. Even though there is no built-in rotation property in the Google Maps documenta ...

Show a table containing dynamic information, featuring 10 rows for each column. The header should be present for each additional column that is added

I have incoming dynamic data that I need to display in columns, with 10 records in each row. Currently, I am able to display 10 rows as expected. However, I want the header to repeat each time an additional column is added. How can I achieve this using the ...

Issues with buttons and grid layout in HTML and CSS

I am facing issues with setting up the buttons. I'm not sure whether a grid system is needed for this task or not. I want the design to resemble the following example: I haven't written any code yet as I am unsure about where and how to begin. ...

Adjusting screen size to match different resolutions

After uploading mrandmrsmagic .com website, a few issues were noticed. The site appears fine when maximized, but only half is shown when minimized. The absence of a scroll bar could be causing this display problem. Five different background images were use ...

Can we enclose a div within a bootstrap row, but not as a grid item

Can a div be wrapped inside a row without using column classes? While it is technically possible, some may argue that it is not the best practice. Let's explore this further. Take a look at the example below: <div class="row"> <div class=" ...

What is the best way to determine the dimensions of thumbnails for photos stored on external servers?

I am currently working on an auction platform using Python/Django. Users have the ability to input URL's for their product images from external sites like Photobucket. My approach involves linking to the external product image when showcasing a speci ...

Creating a dynamic Image Gallery with the power of JavaScript and HTML5

I have been working on creating an image slideshow using a combination of Java Script and HTML 5. The issue I am running into is that the ImageSlider function is only being called once when I use the SetInterval() method to call it repeatedly. Below is th ...

Navigate to the top of the page prior to updating the Link route in NextJS

Whenever I click on a link to navigate to a new page, the page loads and immediately scrolls to the top. I want to change this behavior so that the scroll resets to the top before the new page is rendered. You can observe this issue on . If you scroll do ...

What is the best method for styling the "body" of multiple pages in a React.js application to prevent them from overlapping?

Hello everyone, After attempting different approaches in numerous ways, I have turned to the experts here who are sure to have the answer to this simple problem. The issue at hand is that when I try to apply background images and other properties to the ...

Problem encountered when trying to apply background opacity to custom colors using Tailwind CSS and shadcn/ui

While using Tailwind CSS along with the shadcn/ui library for styling buttons, I have encountered an unexpected behavior. The issue arises when trying to add background opacity to a custom color defined in globals.css using HSL values such as: --primary: 3 ...

HTML section produces unexpected outcome

Hey there, I'm relatively new to the world of HTML and CSS. I have a question about using sections to display images on my website. I've noticed that when I use a div element in my HTML code, everything looks great. However, if I try to only use ...

Utilizing Bootstrap 4 to arrange each card in its own row

On small screens, I want Bootstrap to display 1 card per row, 2 cards per row on medium screens, and 3 cards per row on large screens. I'm using <div class="col-sm-12 col-md-6 col-lg-4"> and it's working for medium and large screens, but o ...

Why isn't my custom HTML attribute displaying correctly?

In my current React app project, I have been incorporating custom attributes to HTML tags and React components for End-to-End (E2E) tests using Testcafe. However, I am facing an issue where the additional data-test="burger-menu-btn" attribute is ...

How come the information isn't being transferred between components?

Is my method correct if I want to pass the this.prompt() function from TitleBar to Portfolio? This is what my index.html file looks like: var TitleBar = React.createClass({ render: function() { return( <div className="jumbotron"> ...