Tips for eliminating the border on a see-through button using CSS

Looking for a solution to remove the line behind a transparent button in CSS? Check out the image below for reference. https://i.sstatic.net/Aq2Dl.png

.fullscreen {
                height: 100%;
                width: 100%;
                background: no-repeat url("https://www.planetware.com/wpimages/2019/10/switzerland-in-pictures-most-beautiful-places-matterhorn.jpg") center / cover;
            }
            .line {
                position: absolute;
                width: 3px;
                height: 100%;
                background-color: rgba(255, 255, 255, 1);
                top: 0;
                left: 50%;
            }
            .btn {
                position: absolute;
                width: 100px;
                height: 100px;
                border: 3px solid #ffffff;
                transform: translate(-50%, -50%);
                top: 50%;
                left: 50%;
                z-index: 1;
            }
            .btn::after {
                content: '';
                display: block;
                width: 60px;
                height: 60px;
                background: #ffffff;
                position: absolute;
                top: 50%;
                left: 50%;
                transform: translate(-50%, -50%);
            }
<div class="fullscreen">
    <span class="line"></span>
    <div class="btn"></div>
  </div>

Answer №1

It seems like you're looking for a solution that involves styling the .outer_box element to have the same background image as the .background, and scaling it accordingly.

.fullscreen {
  height: 100vh;
  width: 100vw;
  background: no-repeat url("https://www.planetware.com/wpimages/2019/10/switzerland-in-pictures-most-beautiful-places-matterhorn.jpg") center / cover;
}

.line {
  position: absolute;
  width: 3px;
  height: 100%;
  background-color: rgba(255, 255, 255, 1);
  top: 0;
  left: 50%;
}

.btn {
  position: absolute;
  width: 100px;
  height: 100px;
  border: 3px solid #ffffff;
  transform: translate(-50%, -50%);
  top: 50%;
  left: 50%;
  z-index: 1;
  background: no-repeat url("https://www.planetware.com/wpimages/2019/10/switzerland-in-pictures-most-beautiful-places-matterhorn.jpg") center / cover;
  background-size: 100vw;
}

.btn::after {
  content: '';
  display: block;
  width: 60px;
  height: 60px;
  background: #ffffff;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
<div class="fullscreen">
    <span class="line"></span>
    <div class="btn"></div>
  </div>

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

Bootstrap 4 Table with Irregular Stripes to Avoid

<html> <head> <link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet"> <link href="vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css"> <link href="css/sb-admin.css" rel="style ...

The webpage does not dynamically adjust to fill the screen size when viewed on an iPhone 6 Plus

I am encountering an issue with a specific page which can be found at the following link: The webpage is not responsive, and the client's requirement is for the entire page to be visible on a mobile screen without the need for zooming in or out. Inst ...

How can you craft a dynamic radial mask to animate layered images?

My goal is to have two circular SVG images layered on top of each other, with the top image in grayscale and the bottom image in full color. I want to be able to gradually remove the top image based on a percentage from 1-100, similar to how hands sweep a ...

Tips for assigning a standard or custom value using JavaScript

What is the best way to automatically assign a value of 0 to my input field when the user leaves it blank? Should I use an if statement { } else { } ...

Leveraging $last in Angular for obtaining the final visible element with ng-show

My ng-repeat container div contains multiple images, each with a corresponding div next to it. Using $last, I can make sure only the div of the final image is visible after all images. However, I also have a filter button on the page that hides certain im ...

Obtain JSON information by submitting an HTML form using an HTTP POST request

Looking to retrieve JSON data with the click of a button Here's the HTML code: <html> <title> </title> <body> <h2> Main API - http://api.kalendern.se/api</h3> <form method="get" enctype="applica ...

The main-panel div's width increase is causing the pages to extend beyond the window's width limit

I recently downloaded a Reactbootstrap theme and managed to integrate it with NextJS successfully. However, I am facing an issue where my <div className="main-panel"> in the Layout.js is extending slightly beyond the window. It seems like t ...

There is an overflow issue where content on the left side is being hidden when the overflow is set to auto

I am attempting to display a content box consistently on both desktop and mobile by utilizing a fixed width and overflow property. :root { --box: rgb(20, 33, 150); --box1: rgb(55, 75, 255); --background: rgb(147, 158, 255); } body { -we ...

Tips for shifting a stuck div 200px upward once the bottom of the page is reached while scrolling:

I've set up a page layout with two columns, one fixed and the other scrollable. The left column is fixed (containing Google ads) and stays in place as I scroll down the page. The right column displays posts and scrolls along with the rest of the con ...

How to dynamically center content in a container div that extends beyond the edge of the screen? (Horizontal navigation design)

I have created a unique website layout with 6 sketches placed horizontally in div containers. I am not concerned about the navigation style affecting usability. To achieve this, I have organized the div sections to be relatively positioned from left to ri ...

Using an ng-repeat directive alongside an if condition in Angular

My website contains a vast array of 30 articles, previously represented by around 300 lines of HTML code, but now condensed to just 10 lines with angularjs. However, certain articles hold special significance and require specific display criteria. Check ou ...

Ways to resolve flickering caused by css keyframe animation

I'm currently working on creating a staggered opacity effect for three boxes using an infinite keyframe animation and the animation-delay property. However, I've encountered an unexpected issue where the third box seems to fade away and then rea ...

Items within a shared container are currently displaying stacked on top of each other

I am facing an issue with my bike images and manufacturer names appearing on top of each other instead of next to each other. Despite using "col-md-12", the grid columns are not aligning horizontally as expected. How can I adjust the code so that each imag ...

What happens if I were to move Html.ValidationSummary() outside of the form tag?

Currently, I am developing an asp.net mvc-5 web application that includes the following form structure: @using (Html.BeginForm()) { @Html.AntiForgeryToken() <div class="form-horizontal"> <h4>Contact</h4> <hr ...

What is the best way to incorporate the animated link hover effect I have implemented, in combination with Bootstrap's stretched link feature?

Recently, I encountered a dilemma while enhancing the hover state of a link by adding an animated underline to it. My approach involved using absolute position in the CSS, specifically setting bottom: 0; in the ::after pseudo class. However, another requ ...

Experience the magic of playing HTML5 video within the sleek confines of an iPhone image

After coming across a similar inquiry on Stack Overflow (), I decided to create my own solution since the original answer lacked code details. The task at hand is to embed an HTML5 video within an iPhone image frame, like so: The image dimensions are 300 ...

Include a class in the html root tag

Is there a way to dynamically add a class to the root HTML tag when a specific button is clicked? Most resources I've found only show how to add classes to div elements with IDs. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http ...

The button's unclickability is due to the zIndex being set to -1

How can I create a clickable button? https://i.sstatic.net/BXOjz.png Feel free to check out the sandbox example here: https://codesandbox.io/s/m5w3y76mvy ...

Showing the content of an email's HTML Body

In developing my Python Django website, I'm looking to showcase emails on the front end. These emails have already been processed in the backend and are retrieved via AJAX in JSON format. My main concern is displaying the HTML body of these emails wi ...

Combining multiple PNG images onto a base image in PHP

I need assistance in merging 24 images with single dashes highlighted into a base circle image using PHP GD, JS or CSS. All images are in PNG format. Your help would be greatly appreciated. ...