What could be causing my span element to not show up on my header?

How can I add (mock) buttons to my page using just CSS? I've been trying to display a span element but it's not showing up. I've experimented with setting its display to block and positioning it absolutely, but so far nothing has worked. Which method is generally preferred for achieving this effect?

header {
   position: relative;
   display: flex;
   justify-content: space-around;
   border-bottom: 6px solid black;
   padding: 15px 0 10px 0;
 }

   img {
     width: 43px;
     height: 43px;
   }

   .red-button {
     background: yellow;
     width: 50px;
     height: 50px;
   }

 header:before {
   content: "";
   position: absolute;
   z-index: 1;
   top: 74px; 
   width: 100%;
   border-bottom: 6px solid maroon;
 }

 header:after {
   content: "";
   position: absolute;
   top: 0;
   width: 100%;
   border-bottom: 6px solid $light-red;
 }
  <body>
    <header>
      <img src="./assets/pokeball.svg" alt="pokedex">
      <span className="red-button"></span>
    </header>
  </body>

Answer №1

Consider replacing the className with class.

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

How can I generate an SQL query using the <options> tag and display the result through echoing

I am in the process of creating a page that will show users the cost of repairing their damaged mobile phone. With a database containing all the pricing information for various phone models and issues, I need to figure out how to display the final price af ...

Is Bootstrap Hover Class Inadvertently Included Without Cause?

I am in the process of creating a very basic navigation bar. Bootstrap has been incorporated into my project, along with my custom stylesheet. I believe there is only one bootstrap class on my page. Despite adding a customized hover effect, when hovering o ...

Troubleshooting: Issue with Angular 2 bidirectional data binding on two input fields

Hi there, I am encountering an issue with the following code snippet: <input type="radio" value="{{commencementDate.value}}" id="bankCommencementDateSelect" formControlName="bankCommencementDate"> <input #commencementDate id="bankCommencementDat ...

Ways to customize the background color of selected items in ion-list on Ionic

I am working on an Ionic project and I have a list of items. I am trying to change the background color of the pressed item. Can someone help me with this? index.html <ion-list> <ion-item ng-repeat="item in familleItems"> <div ng- ...

What is the standard "placeholder" for a Select-box in Angular?

Currently in the process of developing a front-end web application with Angular 6, I have encountered a challenge. Specifically, I am working on creating a component that includes various select-boxes, resembling this setup: https://i.sstatic.net/6DmL9.pn ...

What are some strategies to optimize image loading speed in an HTML5 mobile application?

I have a HTML5 mobile application where I am loading 10 images at a time from imgur when the user clicks a button. After retrieving the images, I am applying CSS formatting to adjust the height and width for proper display on an iPhone. I suspect that the ...

Save hyperlinks in a storage system

I need to store an article in a MongoDB database, and some words within the article should be clickable links leading to other pages. However, when I display the article using an EJS template, the anchor tags I added while writing the article appear as pl ...

tips on concealing video URL

Is there a way to obscure the URL of a video being displayed on a webpage using the HTML5 Video Player? The video URL is pasted as a <source> element, and I'm unsure how to obfuscate it without causing issues with the player. I'm looking f ...

JavaScript prohibiting input prior to execution

Having trouble with executing this javascript before the user input, can anyone assist me in resolving this issue. I just want to create a simple html page with a textbox and a button. When the button is clicked, it should open a new window with a modifie ...

Create an eye-catching hexagon shape in CSS/SCSS with rounded corners, a transparent backdrop, and a

I've been working on recreating a design using HTML, CSS/SCSS in Angular. The design can be viewed here: NFT Landing Page Design Here is a snippet of the code I have implemented so far (Typescript, SCSS, HTML): [Code here] [CSS styles here] [H ...

The method is called after the focus is removed from the element

Currently, I am working on a project involving textboxes arranged in a grid to represent each day of the week. Alongside these textboxes is a drop-down list displaying the dates for that week, as well as a text area designated for specific comments related ...

Connect Angular to a dynamic table of information

Currently delving into Angular and facing an issue where I need to utilize an mvc handler that returns a generic JsonObject. This means the object could be of various types and have different numbers of columns. Rather than statically defining columns in t ...

When using AngularJS with DateRangePicker, I am encountering an issue where my ng-model does not capture the input text value when I select a date

Trying to establish the selected date range in an ng-model called dateRange in the following HTML. The input text field displays the selected value correctly, but dateRange remains null. What steps can I take to address this issue? <!DOCTYPE html> ...

Positioning an individual element to the right side of the navigation bar in Bootstrap 5

I've been attempting to shift a single nav-item to the right side of the navbar, but I'm having trouble. My navbar is fairly basic, without a search tool or dropdown menu, as seen below: <nav class="navbar navbar-expand-lg bg-body-tertiar ...

Looking to troubleshoot the selenium error in a loop, specifically the InvalidSelectorException that states: "invalid selector: Unable to find element with the specified xpath"?

I have been attempting to create a for loop in selenium that checks if certain buttons on a website are clickable, clicks on them, and refreshes the page until they are. However, I am encountering an error with my Xpaths as shown below (InvalidSelectorExce ...

What is the method for retrieving the input value from the summernote text editor?

insert image description here //html code //<div id="txtDescription" class="summernote datarequired" //title="Description Reuired"> // jquery code to fetch data I am trying to access value using $('#txtDescription ...

Update the logo for mobile, desktop, and tablet display using Bootstrap 4alpha

I am currently working on customizing a header with Bootstrap 4 alpha. <div class="container"> <div class="row"> <div class="col-md-6 text-md-left text-center"> <div class="navbar-brand"><img src="/wp-con ...

Issue with modal rendering in Bootstrap4 when the body is zoomed in

I am encountering an issue with a Bootstrap html page where the body is zoomed in at 90%. The Bootstrap modal is displaying extra spaces on the right and bottom. To showcase this problem, I have created a simple html page with the modal and body set to 90% ...

Slow rotation in CSS styling

.badge { -webkit-transform-style: preserve-3d; -webkit-perspective: 1000; position: relative; } .back, .front { position: absolute; -webkit-backface-visibility: hidden; -webkit-transition: -webkit-transform 1s ease-in; width: ...

Eliminate any attributes related to images (such as alt text, classes, or styles) from the image tag

I operate a website where individuals are able to directly copy and paste content into my platform, which is then stored in my database. Initially, I only accounted for users utilizing my image insertion tool, which saves images as basic HTML image tags: ...