Background image for Semantic-UI modal

Is it possible to add a background image to a Semantic-UI Modal?

<modal ng-model="dc.show_leaderboard" class="leaderBoard">
   <i class="close icon" ng-click="dc.close_modal()"></i>
   <div class="header">Header</div>
</modal>

Here is the CSS code:

.leaderBoard{
  background: url('/assets/images/0011mainBG_SmallRobotBG_overlay1364x768.png') no-repeat !important;
  width: 200px;
  left: 90%;
  text-align: center;
  color: white;
}

Answer №1

Although not explicitly stated in the documentation, a model has the ability to:

  1. display image content
  2. vary in sizes
  3. take up the entire size of the screen

With some CSS customization, it is possible to achieve the following:

You can experiment with using an image as a background:

 <style>
  .modal {
    background:url('Your path to image')   !important;
   width:200px !important;
   }
 </style>
   <div class="ui view modal  inverted " >
         <div class="header" style="background:none;">User Deletion ?</div>
          <div class="content" style="background:none;">

            <p><?php echo __('Are you sure you want to delete ?'); ?></p>
         </div>
     <div class="actions" style="background:none;">
         <div class="ui cancel button">Cancel</div>
         <div class="ui approve button">OK</div>
    </div>
 </div>

To use a colored background instead:

     <div class="ui view modal red inverted segment" >
          <div class="header" style="background:none;">User Deletion ?</div>
          <div class="content" style="background:none;">
             <p><?php echo __('Are you sure you want to delete ?'); ?></p>
         </div>
       <div class="actions" style="background:none;">
         <div class="ui cancel button">Cancel</div>
         <div class="ui approve button">OK</div>
      </div>
   </div>

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

HTML - maintain centered text positioning while implementing padding on the left side

Here are the HTML and CSS code snippets I am working with: #page { background-color: #000; color: #fff; height: 360px; width: 360px; min-height: 100%; } #viewport { font-size: 20pt; text-align: center; } .taskTitle { height: 13%; fon ...

Center alignment in relation to either of two containers

I am working with a container that has a height of 100vh to fill the entire screen. Inside this container, I have a h1 and a div. I want to center align the content within the div on the page, but the presence of the h1 is causing issues. My current setup ...

Mixing two elements for a continuous animation without the use of JavaScript

I'm interested in creating an animation that cycles between "0% interest free credit" and "free delivery". I am attempting to achieve this without the use of JavaScript, but so far I can only make the first element fade away without the second one fad ...

Receiving a 502 Bad Gateway error when attempting to request a CSS file via HTTPS

After recently adding SSL to some pages on my website, I encountered an issue when trying to call a secured web page <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <link href="https:/ ...

Switch the Bootstrap navigation bar orientation from left to right

Can anyone help me create a navigation bar like the one shown in this image? It needs to toggle from right to left with a close button. I've tried everything and searched everywhere with no luck. Thanks in advance! Link to Image ...

Issue with Dynamic Theming in Ionic Framework

Currently, I am using Ionic in combination with Angular to create an App. I have introduced dynamic theming by adding two .scss files into my theme folder. In my app.scss file, I define the layout of components without colors, while all color styles are st ...

Implementing JavaScript functionality with CSS and HTML on a menu

I'm experiencing issues with my website's menu functionality. Currently, the submenu dropdown works fine, but the main menu is not functional. How can I enable it on the main menu as well? document.addEventListener('click', function( ...

What is the significance of positioning a:hover after a:link and a:visited?

While studying CSS, I encountered a confusing rule that states ':hover' must come after ':link' and ':visited'. In practice, to visit a link we first need to click on it, and in order to click the link, we usually hover over ...

Having trouble with my ReactJS application where click interactions are functioning properly on the header but not on my content

Objective: Implement an iframe displaying a YouTube video with play/pause functionality for users. Issue: Unable to interact with main content, but works correctly when placed in Navigation or Footer components. Attempted Solutions: Explored various de ...

Problems encountered when applying box-shadow for text background across multiple lines

Lately, I've become accustomed to using box-shadow to add backgrounds to text headings. I've been employing a little trick of applying a box-shadow to a span element within h1 tags in order to create a unique "background with padding" highlight e ...

Put the SVG at the lower right corner of the image using Bootstrap

I'm currently attempting to insert an SVG into the lower right corner of an image within a bootstrap card. I experimented with a solution similar to this one: picture on the bottom right cornor of image, but when I apply CSS styles for the icon, my SV ...

Ways to detect events even after the object has been swapped out in JavaScript

I am currently developing a JavaScript-based Scrabble game and encountering a puzzling issue. The problem arises when tiles are generated within a tile rack div using a specific function, and an event listener is set up to respond to clicks on the tile div ...

Restrict the size of an image within a div by setting a maximum height and allowing the width

While this code snippet functions perfectly in WebKit browsers, it encounters issues when used in IE and Firefox. Unfortunately, due to other necessary functionalities, using the img tag is essential, making background-image an unviable option. Code Snipp ...

Tips for inserting a line break in a script

Hello, I need some assistance with creating a typewriter effect using JS, CSS, and HTML. Everything seems to be working fine except when I try to add a new line of text, it doesn't display properly. var str = "<p>I want to put text here then ...

Tips for implementing jQuery overlay to display radio buttons in a popup window

Following a tutorial, I created an alert window with radio buttons added for user input. You can view the online demo here. The modified source code with the radio buttons is provided below. Below you'll find where I added the radio buttons and how I ...

The transition feature is not functioning properly in Firefox

I have a basic HTML and CSS setup below. It seems to be working fine in Chrome, but I'm having trouble with the transition effect in Firefox. I am currently using Firefox version 18. I tried looking up solutions on Google and Stack Overflow, but none ...

Error encountered while scrolling with a fixed position

I am currently in the process of developing a carousel slider that resembles what we see on Android devices. The main challenge I am facing at this early stage is applying the CSS property position: fixed; only horizontally, as vertical scrolling will be n ...

Images are not appearing correctly on Chrome browsers when using Windows operating system

img tags seem to have unusual margins in Chrome, Edge, and Opera browsers, while Firefox displays them correctly. Queries What is causing these margins specifically in Chrome? The Devtool does not detect any margin properties. Is there a straightforward s ...

When the window is resized, the css('position') method may return undefined

Here is the code I am using to detect the browser resize event: window.onresize = function(){ var style = $('#button-selection').css('position'); if(style == "relative"){ $("#button-section").css("position"," "); }else if(style == ...

Ways to incorporate fixed CSS into a Dojo 7 application such as FontAwesome

Currently, I have a Dojo 7 (Dojo 2) application that was built using the dojo-cli tool. I am now looking to enhance it by incorporating FontAwesome icons. Luckily, I have a Pro subscription that provides me with a zip file containing various folders of CSS ...