The initial element within the div style is malfunctioning

Could someone assist me in understanding why the first-of-type CSS is not working correctly?

.item:first-of-type .delete{
    display: none ;
}

.delete { text-decoration: none; color: red; padding-top: 40px;}

.add_form_field { white-space: nowrap; }
<div id="dimensions" class="row item">
   <div class="col-sm-3">
      <label>Longueur(cm):</label>
      <input type="number"  min="0" name="longueurs[]" id="length"  value="<?php //echo $length;?>" required>
   </div>
   <div class="col-sm-3">
      <label>Largeur(cm):</label>
      <input type="number"  min="0" name="largeurs[]" id="width" value="<?php //echo $width;?>" required>
   </div>
   <div class="col-sm-3">
      <label>Hauteur(cm):</label>
      <input type="number"  min="0" name="hauteurs[]" id="height" value="<?php //echo $height;?>" required>
   </div>
   <div class="col-sm-2">
      <label>Poids(Kg):</label>
      <input type="text"  min="0" name="poids[]" id="weight" value="<?php //echo $weight;?>"required>
   </div>
   <a href="#" class="delete">Delete</a>
   </div>
   <div class="col-md-3" style="">
   <br>
   <button class="add_form_field">Ajouter un colis</button>
</div>

Can anyone suggest an alternative way to hide the first delete element? Your help is much appreciated.

Answer №1

If I had to choose, I might go with one of these options:

.remove:first-of-type{
display: none;
}

Alternatively:

.remove:first-of-type{
visibility:hidden;
}

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

"Enhance your Angular configuration with the powerful ngBootbox plugin

Is there a way to permanently change the locale of ngBootbox? I tried adding an extra angular configuration: var app = angular.module('some_module', ['highcharts-ng', 'ui.router', 'oc.lazyLoad', 'ui.selec ...

The material icons CDN does not seem to be functioning properly in Next.js

After adding a CDN to the head section of my Next.js project, I encountered an issue where it was not working as expected. import Head from "next/head"; <Head> <link href="https://fonts.googleapis.com/icon?family=Material+Ico ...

Is it possible for AngularJS components to alter their enclosing element?

I see Angular components as element directives. Take a component named hero, for example, I can include it in the parent template like so: <hero myparam="something"></hero> What I envision is using the hero element as a container managed by t ...

Global Inertia Headers

How can I ensure that a custom header (Accept-Content-Language) is sent with every request, including Inertia manual visits? Below is the code snippet where I define and set the header: import axios from 'axios'; const lang = localStorage.getIt ...

Javascript's asynchronous initiator

Starting a variable synchronously has been a common practice. const x = call_a_sync_function(); However, issues arise when the initiator switches to async. const x = await call_an_async_function(); // SyntaxError: Unexpected reserved word I experimente ...

While v-carousel adjusts to different screen sizes, the images it displays do not adapt to

Whenever I implement v-carousel, everything seems to be working well, but there is an issue on mobile. Despite the carousel itself being responsive, the images inside do not resize properly, resulting in only the center portion of each image being displaye ...

When an image is hovered over, the HTML background undergoes a transformation

Essentially: div:hover { body{ background-image:(bg.png); } } This code is conceptual but flawed, yet it effectively illustrates my problem. ...

What are the steps for installing the latest version of popper, v2?

When you run the following command: npm install popper.js --save You will receive a warning message that says: npm WARN deprecated <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="81f1eef1f1e4f3afebf2c1b0afb0b7afb0">[email& ...

Include an option for whitespace characters when validating a file using regex

My text box has specific criteria for what is considered good or bad input. Examples of good input could include: GoodString GoodString88 99GoodString I want to avoid certain types of bad input, such as: Good*String Good&String However, I do want ...

HTML5 for Bulk Video Upload

Is it possible to use the html5 api to record and upload video content directly from the browser? I am facing an issue in a project where the video recordings can be very long or large, causing extended upload times for users. Ideally, I would like the vi ...

Using angular.js variables in the script tag: A step-by-step guide

Currently, I am working on a project that involves displaying elements on a view using Angular.js and attempting to connect these DOM elements using jQuery connections. While the elements are being displayed correctly, I am encountering an issue when tryin ...

Running a Python script through a Javascript event

I'm looking to enhance my webpage by implementing a feature where users can generate a personalized QR code with the click of a button. My current setup involves a Python script that creates the QR code image and saves it as a .png file. I want to int ...

The python parser extracts symbols from HTML instead of words

Currently attempting to extract data from a website's HTML using lxml and XPath. The process appears to be functioning correctly, however it is yielding results that are not expected : from lxml import html import requests page = requests.get(' ...

"Encountering a problem with a function showing an undefined error

Trying to incorporate a slider feature into my application led me to reference this w3schools sample. However, upon loading the page, the images briefly appear before disappearing. Additionally, clicking on the arrow or dots triggers an error stating: U ...

Hosting images with an online service on jsfiddle: A guide

Exploring the world of HTML canvas and honing my skills in HTML and CSS through jsfiddle, I am eager to incorporate my own images. While sites like Google Drive provide free image hosting, I wonder if I can utilize them with drawImage(); Is there a way to ...

What is the best way to retrieve the outcome of a node-sqlite3 query beyond the scope of db.get()?

I'm attempting to validate whether the sha256 hash stored in my sqlite database corresponds with the sha256 hash of the password that the user transmitted to my NodeJS server. The Auth() method is meant to deliver either a true or false result. Is the ...

Border Effect Resembling Windows Tiles

When you hover your mouse over a tile in Windows, a cool effect happens: Hovering outside the tile, but within the container area: https://i.sstatic.net/yZk9f.png Hovering inside a tile: https://i.sstatic.net/LoSmk.png Hovering outside a tile at its m ...

Using Next.js in conjunction with Tailwind CSS and the shadcn/ui library to tackle the issue of preventing overscroll from creating

As I delve into a Next.js project, my goal is to use Tailwind CSS to craft an interface featuring a sidebar on the left, a header at the top, and a main content area. However, an issue has surfaced where users can over-scroll, leading to a blank space appe ...

Keep the nested ul with absolute positioning open until the pointer is moved outside the element

I am working on a navigation menu where the last list item (li) contains a nested ul for a dropdown menu. My goal is to display this nested menu when hovering over the parent li and hide it when moving away from the menu. However, I am running into an issu ...

Creating dynamic websites with Razor C# programming

After attempting to integrate code from the Microsoft website into a project created with the "web application" template ASP.NET Core, it seems that the code is not functioning properly. The code in question is for a simple calculator designed to add two ...