What is the best way to add attribution text to background images in reveal.js?

I am considering using reveal.js for a series of lectures. I would like to include attribution text in a subtle location (bottom right) for any background images on slides. These images are specified using

<section background-data="url(...)">

within the <slides> section of the HTML source. While I do not have extensive knowledge of JS / CSS, it seems feasible to achieve this without delving too deeply into the reveal.js source code.

I have experimented with placing a transparent image as content in slides and then overlaying text on top, but this method feels cumbersome and fails to properly associate the attribution with the background image it pertains to.

Has anyone successfully solved this issue before?

Answer №1

Simply include the following code snippet in your CSS:

.attribution{
    position:absolute;
    bottom:0;
    right:0;
    font-size:0.5em
}

Then add the line of code below inside your <section>:

<span class="attribution">Attribution Text</span>

Additionally, the documentation from GitHub repository recommends using:

data-background="http://example.com/background.png"

Instead of:

background-data="url('http://example.com/background.png')"

The JavaScript automatically detects if it's a URL, unlike the CSS background property.

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

Troubleshooting a Custom Pipe Problem in Angular Material Drag and Drop

Currently, I am working on a project involving Angular Material Drag And Drop functionality. I have created a simplified example on StackBlitz which you can access through this link: here The project involves two lists - one containing pets and the other ...

Tips on eliminating expansion upon button click in header within an Angular application

While utilizing Angular Materials, I encountered a challenge with the mat-expansion component. Every time I click on the buttons within the expansion panel, it closes due to the default behavior of mat-panel. Requirement - The panel should remain expanded ...

Passing arrays from child to parent components in VueJS: A comprehensive guide

I am currently utilizing the Vue-Multiselect plugin and attempting to send data up to a parent component so that a backend API can update certain records. However, I am facing challenges in achieving this successfully. My approach (explained in detail) al ...

Chrome method for creating Flexbox columns of equal height

I am implementing a simple 2-column layout and I want to utilize Flexbox to ensure equal heights for the columns: HTML <div class="row flex"> <!-- menu --> <div class="col-xs-4"> <aside> Menu content wi ...

efforts to activate a "click" with the enter key are unsuccessful

I'm attempting to enhance user experience on my site by triggering the onclick event of a button when the enter key is pressed. I've tried various methods below, but all seem to have the same issue. Here is my HTML (using Pug): input#userIntere ...

In JavaScript, iterate through clickable elements when clicked, but exclude the particular element that was clicked

<div> <div class="clickable">1</div> <div class="clickable">2</div> <div class="clickable">3</div> <div class="clickable">4</div> </div> Whenever a use ...

Could someone review my coding syntax in JavaScript for utilizing indexOf, split, and looping through multiple inputs to paste the splits?

As someone who is self-taught and codes part-time as a hobby, I am currently working on building a JavaScript/jQuery tool. This tool will allow users to copy rows or columns from Excel and paste them into an online HTML form consisting of a grid of <tex ...

Utilizing Bootstrap and flexbox to create a card: repositioning the image to the left or right

Currently, I am attempting to construct a card layout using Bootstrap 4 with flexbox enabled. The image below depicts my current implementation, which is functioning as expected. https://i.sstatic.net/huXvo.jpg Here is the HTML structure: <section> ...

Is there a method to check if my input fields are filled before the bootstrap modal can be triggered in PHP?

Is it possible for the modal button to validate if the textboxes before it are empty? If they are, can we prevent the user from proceeding until they are filled? Check out the code below: <form class="form-horizontal form-signin-signup" action="signup ...

Positioning the close button on the top right edge of a Material-UI Dialog: A step-by-step guide

https://i.sstatic.net/ARTtq.png How can I include a close icon in the top right corner of the header section? I'm using the Material UI Dialog and everything works well, but I need a close button in the top section. Can anyone assist me with this? ...

"Identifying the exact number of keys in a JSON object using

Is there a key in the JSON data that may or may not exist? How can I determine the total number of occurrences of this key using jQuery? JSON : jasonData = [{"test":"sa3"},{"test":"4s"},{"acf":"1s"},{"test":"6s"}]; I need assistance with implementing th ...

Reinitialize the nested property of an object in JavaScript

I've encountered an issue while using the Vue3 composition API where attempting to reset a form with nested properties using Object.assign does not work as expected. const initialForm = { name: "", details: { type: "" } }; const f ...

Every time I try to install create-react-app, I keep encountering a frustrating 'network Socket timeout' error

$ npx create-react-app amazon-clone npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead. Creating a new React app in D:\js\faceboom. npm WARN config global `--global`, `--local` are deprecated. ...

Ensure the scrollbar is noticeable and personalized solely within a designated div, such as the left side menu

In the left side menu, I have set the overflow-y: scroll property and a fixed height that is smaller than the entire page's height. I am trying to make the scrollbar always visible only within this left menu. I attempted using -webkit-scrollbar and -w ...

I am having trouble playing an mp4 file from my Android phone as an HTML video

Having some trouble playing a video recorded on an Android phone in Chrome on my desktop. The audio plays fine, but the video shows up as just a blank background. Other videos play without issue, but this specific one doesn't seem to work correctly. T ...

Transmitting data from the front end to the server in React/Shopify for updating API information using a PUT request

After successfully retrieving my API data, I am now tasked with updating it. Within my component, I have the ability to log the data using the following code snippet. In my application, there is an input field where I can enter a new name for my product an ...

Counting the number of tasks associated with Django models relations

Attempting to retrieve a function from a table that should be present, but unable to access the value. The goal is to determine the number of completed tasks. models.py class Task(models.Model): title = models.CharField(max_length=55, null=T ...

changing the visible style of a div element using JavaScript

I'm having an issue with a link on my webpage that is supposed to show or hide a <div id="po" style="display:none;">some html</div> element. The first time I click the link, the div displays properly. However, after tha ...

When an array is prototyped as a member of a JavaScript object, it becomes a shared property among all instances

Is anyone else surprised by this behavior? It really caught me off guard... I was expecting prototyped arrays to be private to each instance of a class rather than shared across all instances. Can someone confirm if this is the intended behavior and provi ...

Access a webpage whose URL has been dynamically assigned using JavaScript

I have a website that consists of a single page and features four tabs. Whenever a tab is clicked, it displays the corresponding content in a div while hiding the other three divs along with their respective content. To ensure a smooth user experience, I u ...