Animated Gradient Header with CSS

I've been attempting to add an animated gradient to my header class, but so far I haven't been successful.

I want the gradient to apply only to the header, not the body. Here's the link I'm using for reference:

Can anyone offer some insight on what might be causing this issue? Any help would be greatly appreciated.

Here's the HTML and CSS:

.business-header {
    background: linear-gradient(50deg, #282466, #ffc500);
    height: 400px;
   
    
    -webkit-animation: test 2s ease infinite;
            animation: test 2s ease infinite;
}

@-webkit-keyframes test {
    0%{background-position:51% 0%}
    50%{background-position:20% 100%}
    100%{background-position:51% 0%}
}
@-moz-keyframes test {
    0%{background-position:51% 0%}
    50%{background-position:50% 100%}
    100%{background-position:51% 0%}
}
@keyframes test { 
    0%{background-position:51% 0%}
    50%{background-position:50% 100%}
    100%{background-position:51% 0%}
}
<header class="business-header">
  <div class="container">
    <div class="row">
      <div class="col-lg-12">
        <h1 class="tagline"></h1>
      </div>
    </div>
  </div>
</header>

Answer №1

Functional Playground

.branding-banner {
   background: linear-gradient(120deg, #f9c5b1, #312456);
   background-size: 300% 300%;
   -webkit-animation: GradientAnimation 25s ease infinite;
   -moz-animation: GradientAnimation 25s ease infinite;
   animation: GradientAnimation 25s ease infinite;
   min-height: 80%;
   min-width: 80%;
   height:300px;
}

The issue was not specifying the background size setting in your code.

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

Streamlined approach to triggering ng-change on a single textbox

Consider this array within an angular controller: somelist = [ { name: 'John', dirty: false }, { name: 'Max', dirty: false }, { name: 'Betty', dirty: false } ]; To iterat ...

Using Jquery to Select Start and End Dates

I currently have two date input fields labeled as Start Date and End Date for a specific Project. If the user chooses a start date that is earlier than today's date but does not choose an EndDate, I want to indicate that the project is ongoing. How c ...

Automatically numbering text boxes upon pressing the enter key

Is there a way to automatically number textboxes when I type "1" and hit enter in one of them? For example, if I have 3 textboxes and I type "1" in the first one, can the other textboxes be numbered as 2 and 3 accordingly? <input type="text&qu ...

What could be causing the issue with the JS function that is preventing the button from

I am generating a button dynamically using my JavaScript function and then adding it to the DOM. Below is the code snippet: var button = '<button id="btnStrView" type="button" onclick=' + parent.ExecuteCommand(item.cmdIndex) + ' c ...

Tips for deleting "Category: [category name]" in Wordpress

I have attempted various solutions found in previous threads, but none of them seem to work for me. Here is a screenshot I am looking to remove the text from the header in the category and only display [category name]. Can anyone assist me with this, ple ...

Creating a responsive carousel that is not yet designed

As a beginner, I'm facing what seems like a simple problem that I just can't solve. Here is the HTML code I've written: <div class="discs container"> <ul> <li><div class="arrowleft"><a href="#" >< ...

Images displayed using jQuery do not fade into view

I have a collection of JSON image URLs that I am using to populate a div with a variety of images. Initially, the images are set at opacity 0 and should gradually fade in through a for loop. Here is the jQuery code snippet: $.ajax('http://example.co ...

Viewing a document generated using the Google Drive API using the Google Drive Viewer

Using the Google Drive API, I am able to generate a document and receive some URLs: alternateLink : https://docs.google.com/document/d/xxxsome_idxxxxx/edit?usp=drivesdk embedLink https://docs.goo ...

What steps do I need to take to create a basic API that links to a MySQL database?

I'm currently trying to develop an API for PHP that will enable one web server to communicate with another web server. Additionally, I want this API to be able to update MySQL code. Previously, I was utilizing $_GET parameters for this purpose but rea ...

Error: JSDOM - The document variable has not been declared

After creating a basic webpage that displays a single message, I decided to experiment with JSDOM and encountered an error. Despite researching online examples and Stack Overflow questions, I have struggled to resolve even the most straightforward scenario ...

Struggling to make an AJAX form function properly

I'm running into an issue while setting up a basic AJAX form. My goal is to have a message display on the same page upon successful login using a PHP form through AJAX, but currently, I get redirected to the PHP file after form submission. Can anyone ...

Using CKEditor in an AngularJS web application: Tips and tricks

I'm having trouble integrating the ckeditor into an HTML page that's built with angularjs. Despite trying out numerous examples, such as the ng-ckeditor and ckeditor directives, I haven't found a solution that works for me. What I need is ...

trigger a label click when a button is clicked

I am in need of assistance with simulating a label click when a button is clicked. I attempted to make the label the same size as the button so that when the button is clicked, it would check my checkbox. I then tried using JavaScript to simulate the label ...

Creating visually appealing layouts with CSS floats and divs while ensuring responsiveness

As I work on bringing my vision to life, I'm experimenting with a mix of floats and divs, along with using a responsive image for the background and text. There's quite a bit involved in this process. 1. To start off, check out this example with ...

Choosing Elements from Twin Dropdown Lists in PHP

I am currently working on building a dynamic drop-down menu where the options in the second dropdown depend on the selection made in the first one. The initial dropdown consists of a list of tables, and based on which table is chosen, the columns of that s ...

Wordpress Issues with Displaying Arabic Text Correctly

The issue arises when displaying Arabic text in menus, both the top menu and main menu. The text appears distorted and unreadable, with characters like 2Ø®Ø§Ù†Ù‚Ø§Û showing up. However, in other areas of the page such as the body content, the ...

What is the best way to reset an event back to its original state once it has been clicked on again

As a newcomer to web development, I'm currently working on creating my own portfolio website. One of the features I am trying to implement is triangle bullet points that can change direction when clicked - kind of like an arrow. My idea is for them to ...

What method does nosotroshq.com use to achieve the navigation effect when hovering over a menu item?

Seeking advice from skilled individuals familiar with JQUERY: Can anyone explain the technique used by nosotroshq.com in their top navigation bar? Specifically, how do they create the slow animation when hovering over "ABOUT US"? Any insights would be ap ...

Automatically populate the checkbox with the specified URL

Is it possible to pre-fill a checkbox in an HTML form using the URL? For example, if we have a URL like www.example.com/?itemname=sth Would there be a similar method to pre-select a checkbox via the URL? <ul class="list-group"> <li c ...

Is it common for content to duplicate when using the 'position: fixed' property in CSS media print?

Consider the following div element: ... <div id='section-to-print'>CONT /*Content*/ </div> ... Accompanied by this CSS code snippet: @media print { * { -webkit-transition: none !important; ...