Custom background images override title slide text formatting settings

I have made some changes to the CSS in order to customize the title slide. My goal is to incorporate a background image, adjust the positioning of the title, and modify the font colors for both the title and author/date text.

---
title: "Mechanical Rebar Couplers in<br>Column Plastic Hinge Zones"
author: "Maral Dorri"
date: "February 16, 2021"
output:
  ioslides_presentation:
    incremental: true
    widescreen: true
    smaller: true
    slide_level: 1
    fig_caption: true
    self_contained: true
    transition: "faster"
---


<style>
body {
  text-align: justify}
h2 { 
  color: #427cb3;
  text-decoration: underline}
h3 { 
  color: #427cb3;
slides > slide {
  background: linear-gradient(#ffffff, #ffffff 85%, #ffffff);
  background-color: white;
  color: #4a4a54}
slides > slide.title-slide hgroup h1 {
      font-weight: bold;
      font-size: 40pt;
      color: white;
      text-align: right;
      top: 50%}
slides > slide.title-slide {
  text-align: left;
  color: #4a4a54;
  font-weight: bold;
  font-size: 16pt;
  background-image: url(TFHRC.jpg);
  background-size: 100% 100%}
</style>

The formatting changed when I added the background image, causing issues like those shown in the picture:

https://i.sstatic.net/yS6hZ.png

UPDATE:

I managed to fix the color scheme and justification by tweaking the YAML settings. However, I still face difficulties with properly aligning the title on the slide. The top: 50%; property seems to have no effect!

---
title: "<right>Mechanical Rebar Couplers in<br>Column Plastic Hinge Zones</right>"
author: "Maral Dorri"
date: "February 16, 2021"
output:
  ioslides_presentation:
    incremental: true
    widescreen: true
   smaller: true
    slide_level: 1
    fig_caption: true
    self_contained: true
    transition: "faster"
---

<style>
slides > slide {
  background: linear-gradient(#ffffff, #ffffff 85%, #ffffff);
  background-color: white;
  color: #000000;
  text-align: justify;
  font-size: 20pt;}
slides > slide hgroup h2 { 
  color: #427cb3;
  font-weight: bold}
slides > slide.title-slide {
  background-image: url('TFHRC.jpg');
  background-size: 100% 100%}
slides > slide.title-slide hgroup h1 {
  font-weight: bold;
  font-size: 35pt;
  color: black;
  text-align: right;}
slides > slide.title-slide p {
  color: black;
  font-weight: bold;}
</style>

Answer №1

After tweaking your CSS code, the title page now displays correctly with the image and proper formatting. Additionally, I fixed a missing } at the end of h3.

Original code removed:

slides > slide.title-slide hgroup h1 {
      font-weight: bold;
      font-size: 40pt;
      color: white;
      text-align: right;
      top: 50%}

Updated code:

---
title: "Mechanical Rebar Couplers in<br>Column Plastic Hinge Zones"
author: "Maral Dorri"
date: "February 16, 2021"
output:
  ioslides_presentation:
    incremental: true
    widescreen: true
    smaller: true
    slide_level: 1
    fig_caption: true
    self_contained: true
    transition: "faster"
---

<style>
body {
  text-align: justify}
h2 { 
  color: #427cb3;
  text-decoration: underline}
h3 { 
  color: #427cb3;}
slides > slide {
  background: linear-gradient(#ffffff, #ffffff 85%, #ffffff);
  background-color: white;
  color: #4a4a54}
slides > slide.title-slide {
  text-align: left;
  color: #4a4a54;
  font-weight: bold;
  font-size: 16pt;
  background-image: url("https://lokeshdhakar.com/projects/lightbox2/images/image-4.jpg");
  background-size: 100% 100%}
</style>

-image output link-

https://i.sstatic.net/baSk1.jpg

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

Using foreach and doMC in a function to create parallel random number generation

I am looking to create a function that streamlines the use of foreach / %dopar% syntax within another function. Specifically, I want to iterate through a list NREP times and evaluate EXPR. When I run this code on my quad-core machine: library(doMC) library ...

Challenges with displaying hover text in a loop of R plotly traces

After reading this post and this answer, I encountered a new inquiry: library(plotly) # Generating data dat=data.frame(group = factor(rep(LETTERS[1:4], each=10)), my_x = rep(1:10, 4), my_y = rnorm(40)) str(dat) # Initial plot setup p<-plot_ly(d ...

Verify if two vectors in R have exactly the same elements, disregarding their order

Is there a way to determine if two vectors contain the same elements, regardless of their order? Consider the function SameElements with the following examples: SameElements(c(1, 2, 3), c(1, 2, 3)) # TRUE SameElements(c(1, 2, 3), c(3, 2, 1)) # TRUE Same ...

Ways to boost an array index in JavaScript

I recently developed a JavaScript function that involves defining an array and then appending the values of that array to an HTML table. However, I am facing an issue with increasing the array index dynamically. <script src="https://cdnjs.cloudflare. ...

Ensure that each row in the grid expands to occupy all remaining space, with the option to scroll if additional space is required

Looking to have a grid item expand to fill 100% of available space, but also scroll if it exceeds that space. Here's an example scenario where I'm having trouble with the CSS line marked: '/* DOESN'T WORK */' when attempting to s ...

Arranging Cards in Layers on Smaller Screens Using Bootstrap Framework

My row of cards in various sizes looks good on larger screens like this: https://i.sstatic.net/1qF53.png However, on smaller screens, the cards lose their appeal. https://i.sstatic.net/o1NS8.png To improve this, I want to stack the cards so that the ke ...

Would you like to place some text within a content box?

I am facing a challenge where I want to insert content into a contentbar that has an opacity of 0.6. However, I do not want the content (such as text or videos) to have the same opacity as the contentbar. I attempted to place them in separate div tags with ...

The server's file URLs are modified within the page source of a WordPress site

I've been attempting to integrate Adsense code into a WordPress blog at demonuts.com. I placed the Google code in the TEXT WIDGET provided by WordPress. However, upon running the website, I noticed that the URLs for .js, .css, or .png files are being ...

Creating a full-screen overlay that is mobile-friendly using Javascript and CSS

I'm currently developing a jQuery lightbox plugin that needs to work seamlessly on both mobile devices and desktop computers. The main issue I'm facing is with the full-screen overlay effect. Most resources suggest using position: fixed or backgr ...

Removing columns from an ffdf object in R: A step-by-step guide

Is it possible to remove a column from an ffdf object easily? library(ff);library(ffbase) irisdf=as.ffdf(iris) What is the best way to extract only the Sepal.length and Species columns? ...

Issue with empty attribute selector not functional in Edge browser

In my current version of Edge, I am facing an issue where the empty attribute selector is not functioning correctly. You can find more information about this problem here. The selector I am using is: [ct-validation]:not([ct-validation=""]) { border-col ...

Angular - Dynamically change the height of an input element based on its content's length

I'm looking to automatically adjust the height of my input text based on its content. I have a solution that works when the user is actively typing, triggering the (input) event and calling my adjustHeight function to update the input element's h ...

When an image is a child of the parent content and another element has opacity set, the CSS stack order will be altered

Recently, I came across an interesting issue while working with CSS, particularly with negative margins to stack elements on top of each other. I am aware of the natural stack order in which elements overlap, where the later element always appears on top ...

Revamping the navbar hover effect icon

I am currently working on customizing the navigation bar on my website. I have created a code snippet that adds a small '+' sign next to any link that has sub-options. When the user hovers over the link, the '+' sign changes to a ' ...

Utilizing Ajax to dynamically update the color of a button when it is clicked from a different device

Currently, I am developing a program for my own use within my local community theater. The setup will involve a computer in the control room (Sound Booth) and another computer backstage. My plan is to create a grid of around 10 interactive "buttons" on th ...

What causes the sudden shift in shape for a numericInput corner from round to 90 degrees in shinydashboard?

After creating a numericInput and a selectInput field using scripts in both shiny and shinydashboard, I noticed that the corner of the numericInput changes to 90 degrees in shinydashboard. For reference, you can view screenshots of both examples below: ht ...

Instructions on utilizing the CSSStyleSheet.insertRule() method for modifying a :root attribute

Is it possible to dynamically set the background color of the :root CSS property in an HTML file based on a hash present in the URL? The code provided does change the background color, but unfortunately, the hash value doesn't persist as users navigat ...

What is the best way to adjust the height of an IFrame to match the size of its content?

I attempted to set the height of an IFrame to 100% (similar to setting a <div> to height:auto). I specified the height attribute in the <iframe> tag as 100% and also set the height in the style to 100%, but it doesn't appear to be functio ...

Tips for creating a square HTML element

Looking to customize my react calendar with square tiles. Currently, the width is determined by the overall calendar width, but I want the height to match. https://i.sstatic.net/3vVrq.png Sample HTML: <button class="react-calendar__tile react-cal ...

Changing the loading spinner icon in WooCommerce

Could someone help me change the loading spinner icon in WooCommerce? The current icon is defined in the woocommerce.css: .woocommerce .blockUI.blockOverlay::before { height: 1em; width: 1em; display: block; position: absolute; top: 50 ...