Encountering a mysterious gap appearing between multiple combined images

I am looking to add text inside a transparent image that has the appearance of an area painted with a paintbrush. I have cut the edges into 8 sections: top left, top middle, top right, left, right, bottom left, bottom middle, and bottom right.

However, there seems to be something missing in my setup. Can anyone provide suggestions or feedback?

Please refer to the attached screenshot for reference. Pay attention to the white line surrounding the text.https://i.sstatic.net/NctBC.png

Below is the HTML code snippet:

<html>
    <head>
        <meta charset="utf-8">
        <title>Banner Test</title>
        <style>
            
            .banner-content {
              position: absolute;
              top: 50%;
              transform: translate(-50%,-50%);
              width: 70%;
              left:50%;
            }
            .banner-content .top {
              background-image: url("img/Paintstrip-subhead_topmiddle.png");
              background-position: top center;
              background-repeat: repeat-x;
              min-height: 21px;
              position: relative;
              top: 0;
              float: left;
              width: 100%;
              display: block;
            }
            .banner-content .top:before {
              background-image: url("img/Paintstrip-subhead_topleft.png");
              background-position: top left;
              left: -50px;
              background-repeat: no-repeat;
              content: '';
              position: absolute;
              top: 0;
              width: 50px;
              height: 100%;
            }
            .banner-content .top:after {
              background-image: url("img/Paintstrip-subhead_topright.png");
              background-position: top right;
              right: -50px;
              background-repeat: no-repeat;
              content: '';
              position: absolute;
              top: 0;
              width: 50px;
              height: 100%;
            }
            .banner-content .middle {
              position: relative;
              background-color: rgba(137, 38, 120, 0.85);
              float: left;
              width: 100%;
              display: block;
              text-align: center;
              color: #fff;
            }
            .banner-content .middle h1 {
                font-size: 35px;
            }
            .banner-content .middle::before {
              background-image: url("img/Paintstrip-subhead_leftmid1.png");
              left: -50px;
              background-repeat: no-repeat;
              content: '';
              position: absolute;
              top: 0;
              width: 50px;
              height: 100%;
              background-repeat: repeat-y;
              background-position: left center;
            }
            .banner-content .middle::after {
              background-image: url("img/Paintstrip-subhead_rightmid1.png");
              right: -50px;
              background-repeat: no-repeat;
              content: '';
              position: absolute;
              top: 0;
              width: 50px;
              height: 100%;
              background-repeat: repeat-y;
              background-position: right center;
            }
            .banner-content .bottom {
              background-image: url("img/Paintstrip-subhead_bottom1.png");
              background-position: bottom center;
              background-repeat: repeat-x;
              min-height: 31px;
              position: relative;
              z-index: -1;
              top: 0;
              float: left;
              width: 100%;
              display: block;
            }
            .banner-content .bottom:before {
              background-image: url("img/Paintstrip-subhead_bottomleft.png");
              background-position: bottom left;
              left: -50px;
              background-repeat: no-repeat;
              content: '';
              position: absolute;
              top: 0;
              width: 50px;
              height: 100%;
            }
            .banner-content .bottom:after {
              background-image: url("img/Paintstrip-subhead_bottomright.png");
              background-position: bottom right;
              right: -50px;
              background-repeat: no-repeat;
              content: '';
              position: absolute;
              top: 0;
              width: 50px;
              height: 100%;
            }
        </style>
    </head>
    <body>
        <section class="banner-content">
            <div class="top"></div>
            <div class="middle">
                <h1>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</h1>
            </div>
            <div class="bottom"></div>
        </section>
    </body>
</html>

Answer №1

After some investigation, I have identified the problem.

transform: translate(-50%,-50%);

The issue lies with the transform property causing those unwanted lines to appear. By removing it and readjusting the top margin, we should be able to resolve this issue.

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

Tips for keeping divs in place when hovering over a changing-sized element above them

Looking for some help with my website design. Whenever I hover over the "Problem" and then move away, the div underneath it shifts up and down. The same issue occurs when interacting with the "Solution" section. Any suggestions on how to prevent this movem ...

transfer data from one HTML page to another through the database

I have an HTML page in Flask that pulls applicant information from a SQLAlchemy database. I would like to be able to click on an applicant's name on the first page and have another page open with specific details for that applicant. While I was succe ...

Scalable Vector Graphics Form Field

I'm looking to enable user input in one of my SVG text fields when they click on it. Any ideas on how to achieve this? const wrapper = document.getElementById('wrapper'); const text = document.getEl ...

A guide to resizing images to fit the page in React using Bootstrap

Currently, I am utilizing a function to iterate over each item in the props array and generate an image tag. My goal is to have every set of 3 images enclosed within a row div using Bootstrap to ensure proper page layout. However, I am struggling to implem ...

The Box element surpasses the height of the Grid component

Homepage Component <Box component="fieldset" sx={{borderRadius:2, height:"100%"}}> Application Structure Component <Grid container> <Grid item xs={4} > <Root/> </Grid> ...

Enable the children elements' before and after content to surpass the limitations set by the parent's overflow property

I have a division with the overflow property set to scroll to view all fields without using too much page space. Each field includes a title span and an associated input. Users can hover over the spans to see helpful tooltips. I use the spans' after a ...

Obtaining visuals in a specific manner

I have a customized slider (flexslider) with 10 images per slide. The images are currently manually inserted, but I want to optimize the slider to dynamically extract images using PHP. However, my current setup only displays one image per slide. How can I ...

Is it permissible to have <ul> tags within an H1 element?

I am curious about whether adding a list inside an H1 heading could cause any issues: <h1> <ul> <li><a href="...">some link</a></li> <li><a href="...">another link</a></li> <li>curre ...

Employing a pair of images for submission in a form

Similar Question: How to change an input button image using CSS? Can I create a form with two image submit buttons? I am working on a language selection page that displays two flags (.png's) and I would like it so that when a user clicks on a fl ...

Tips on retrieving the value of a dynamically created control in ASP.NET c# prior to page loading

Is there a way to retrieve the value of a dynamically created control before the page loads in ASP.NET using C#? protected void Page_PreInit(object sender, EventArgs e) { int i = 0; //createDynamicControl(i); var elems = Request.Form.AllKeys.W ...

Is there a way to generate inline block elements that occupy the full 100% width? Furthermore, can the second element contain an additional element that is revealed upon

Currently, I am working on a project that involves displaying images with text overlays. The text overlays are designed as inline blocks with varying background colors. One issue I encountered is that there is unwanted whitespace between the background co ...

What could be the reason that my CSS rule is not impacting this particular element?

Looking for help with my HTML code - I want to make the header row of a table bold. Here's what I have: <!DOCTYPE html> <html> <head> <style> table>tr>th { font-weight: bold; } </style> </he ...

Webpack Is Having Trouble Parsing My JavaScript Code

I recently started using webpack and I'm struggling to get it to work properly. I haven't been able to find anyone else experiencing the same issue as me. Every time I attempt to run "npm run build" to execute webpack, I encounter this error: ER ...

button bouncing effect when scrolling vertically

Is there a way to create an element that bounces based on the user's scroll direction? For instance, if the user scrolls down, the button should bounce from bottom to top, and if scrolling up, the button should bounce from top to bottom. I have been ...

Angular 2: Getting Creative with Pseudo Elements (directive elements?)

I'm currently facing a challenge in horizontally centering an element that is nested within the router-outlet. Despite my efforts, the centering is not working as expected. I believe that for an element to be centered, its parent must have a specified ...

Preventing navbar resizing on websites

I'm trying to have a section on the navbar dedicated for text or alerts that appear based on certain events. However, even when the alert is hidden, it still affects the height of the navbar. How can I resolve this issue? It may be difficult to see i ...

Struggling with Extracting HTML Attribute

I am a beginner in python and facing challenges with scraping HTML code. My objective is to extract the text "Coupon", "Maturity Date", and "Initial Offering Price" along with the text within the float-right class from the provided HTML snippet. This exce ...

Tips for improving the styling of a django form with mixed elements

Here are two different forms I am working with: class InitialForm(Form): trn = IntegerField(widget=NumberInput, required = False) klient = ChoiceField(choices=KLIENTS, required = False) class SecondForm(Form): faktura = CharField(max_length = ...

Track the number of visitors with a custom script

How can we show the visitor count on a homepage using Vue.js or another script technology? if (sessionStorage.clickcount) { sessionStorage.clickcount=Number(sessionStorage.clickcount)+1; } else { sessionStorage.clickcount=1; } This code sni ...

Exploring methods to validate a Reactive Form in Angular 10+ by incorporating two groups within the formBuilder.group

I am looking to implement form validation with two separate groups within the main formBuilder.group. I am unsure of how to access the 'errors' value in my HTML [ngClass]. component.ts: createForm(): void { this.myForm = this.formBuilder ...