Image background within the textarea of Contact Form 7

Struggling to insert a background image inside a textarea on a contact form. The issue arises when the browser window is resized, cutting off the image and failing to fit perfectly within the textarea. I want the textarea to fully display the image and adjust its size when the browser is resized. Unsure if there's a solution for this problem.

Below is my code snippet

#contactfooter {
    background-color: rgba(76, 73, 73, 0.44);
    color: rgb(183, 181, 181);
    border: 1px solid #676363;
    padding: 5px;
    width: 100%;
}

textarea#contactfooter {
    background-color: rgba(76, 73, 73, 0.44);
    background: url(https://psycheseminars.com/wp-content/uploads/2016/08/textback.jpg);
}

Check out the page The contact form can be found in the footer section.

Answer №1

In order to ensure the entire image is displayed, you can adjust the background-size property of the textarea to contain. However, this may result in the image not covering the entire background due to its dimensions, causing the remaining space to be filled with a repeat pattern unless background-repeat is set to no-repeat. Despite this, having a repeat pattern may be more preferable in certain situations. To achieve this effect, you can modify the CSS for the textarea as follows:

textarea#contactfooter {
    background-color: rgba(76, 73, 73, 0.44);
    background: url(https://psycheseminars.com/wp-content/uploads/2016/08/textback.jpg);
    background-size: contain;
}

Alternatively, you have the option to center the image by setting background-position to center and ensuring no-repeat for background-repeat. This will keep only one image centered, providing a different visual effect based on your preference:

textarea#contactfooter {
    background-color: rgba(76, 73, 73, 0.44);
    background: url(https://psycheseminars.com/wp-content/uploads/2016/08/textback.jpg);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

Answer №2

Could you give this code a shot?

textarea#contactfooter {
   background-size: contain;
   background-position: center;
}

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

The slideUp and slideDown functions are not functioning properly

Whenever a user clicks on image-exp, I want description-exp to slide down while other description-exp slides up. I am currently using a Bootstrap template available at this link. To demonstrate the issue, I created a JSFiddle that can be accessed here. H ...

How can I achieve a letter-spacing of 0.5 pixels in CSS?

Encountering an issue, I set out to enhance readability by adjusting letter-spacing to 1px. Displeased with the result, I attempted a half pixel spacing of 0.5px but found it ineffective. Subsequently, I experimented with em attributes but failed to accomp ...

Having trouble setting margin-bottom to 0 in react and antd - why won't it reset?

While practicing with React, I added <link rel="stylesheet" href="%PUBLIC_URL%/css/reset.css" /> to the head of index.html in order to reset the styles. However, I noticed that <h1> still had a margin-bottom:0.5em that I c ...

Randomly switch out the wordpress header image at designated intervals

I have a custom header image on my website that displays 6 random images each time the site is visited. I am attempting to change this group of images while the user is browsing my site. Here is the code I am using: function show_banner(){ document.ge ...

What is the best way to arrange images in a 3 by 3 grid, beginning at position 0, using JavaScript to control navigation through button clicks?

When I click on button 1, it starts at image 1 because the counter is set to 0. Clicking on button 2 takes me to image 4 with a counter value of 3, while clicking on button 3 leads to image 7 with a counter value of 6. The process should also work in reve ...

Prevent the float:left property from causing my div to overlap with another div

Is there a way to style "a" so that it can take up space and float to the left simultaneously? <div style="background:#111"> <div id="a" style="float:left; height:30px"></div> </div> ...

Ways to guarantee that only one accordion tab is open at a time while keeping it open continuously

Hey everyone, I'm just starting to learn how to code and still getting the hang of using Stack Overflow so please bear with me if my question isn't perfectly formatted. I have created an accordion that is almost functioning correctly, but I need ...

"Setting up a filter for the first row in an Excel-like table using a pin header

Does anyone know how to create a table filter in Excel where the header and first row stay pinned while scrolling down, even after applying filters? Here is a JSFiddle demonstrating the issue: http://jsfiddle.net/6ng3bz5c/1/ I have attempted the followi ...

Styling for Print Media: Adjusting the horizontal spacing between inline elements

I have been developing a custom AngularJS point-of-sale (POS) system that requires printing receipts upon completing a sale. To achieve this, I am using ng-print to print out a sales summary displayed within a specific div element after hiding all other un ...

Display the button exclusively on responsive mobile views

I'm looking to enhance my website by adding a call support button with a responsive design feature. The goal is to display the button exclusively in mobile view and replace it with text in other views. Encountering challenges in toggling the visibili ...

Transform a hexadecimal string into a hexadecimal color representation within SCSS

I have a plethora of colors stored in JSON format. I am utilizing rootbeer with gulp to convert them into Sass maps for processing by SCSS: { "blue": "33A2FF" } into $colors: ( "blue": "33A2FF" ); I am able to use ...

The content in the footer is not displaying correctly (Vuejs)

I recently developed a component with a title and a background color meant to cover the entire page, but it seems to have a top margin that I can't seem to remove. Additionally, I created a footer component that should always stay at the bottom of the ...

The dimensions of the pop-up window in Chrome's JavaScript are not displaying correctly

My goal is to launch a new chat room window on our website. The dimensions of the chat room are set to 750px x 590px. Below is the link I am using to trigger the javascript popup. <a href="javascript:void(0)" onclick="window.open('http://gamersuni ...

Troubleshooting regex validation issues in a JSFiddle form

Link to JSFiddle I encountered an issue with JSFiddle and I am having trouble figuring out the root cause. My aim is to validate an input using a regex pattern for a person's name. $("document").ready(function() { function validateForm() { var ...

There seems to be an issue with the functionality of the JavaScript Quiz as it is

While working on my JS quiz, I encountered an issue where some answers were not displaying due to quotes and the need to escape HTML characters. Additionally, I am facing difficulty in accurately awarding points or deductions based on user responses. Curre ...

Unlock the power of AJAX in your WordPress site

I've been exploring the realm of Javascript and AJAX lately. I feel like I'm so close to getting it right, but there's something off with how I'm integrating WordPress ajax functions. I've spent a lot of time going through the docu ...

Difficulty with navigation on Chrome for Android (also impacting Bootstrap's website and all other sites utilizing Bootstrap design)

While working on creating a responsive website using Bootstrap, I encountered an unusual issue with navigation specifically in Chrome on Android. After some investigation, I found that the same problem exists on Bootstrap's own website. To see the i ...

Tailored branding buttons for various brands

In my custom WordPress theme for mobiles, I have implemented a custom field called "brand" with three specific values: LG, Nokia, and Sony. Now, how can I create separate link buttons for each of these brand values that will display all posts related to t ...

Displaying an image with a JavaScript variable is a common task in web

I have a Javascript code snippet below where the image name "samson decosta" is stored in a MySQL database. I am retrieving this image and trying to display it as a background_image in a div. document.getElementById("image_chk").style.backgroundImage="url ...

What are the steps to create a hovering dropdown menu that changes the background window to transparent when hovered over?

Is there a way to create a dropdown menu that changes the background window to transparent when hovered over? Here is an example of what I am looking for: https://i.sstatic.net/FplLm.png The dropdown menu should look like this when hovered over: https: ...