Dynamic root div background css issue

Sajith Gopalakrishnan Hema 1,036 Reputation points
2020-12-21T11:52:35.303+00:00

Unable to make the background to transparent due to dynamic root divs.

49945-root-div-issue.jpg

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,740 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Amos Wu-MSFT 4,051 Reputation points
    2020-12-22T02:03:56.85+00:00

    The property corresponding to transparency in CSS is opacity.
    The value of the opacity property can be set from 0.0 to 1.0. The smaller the value, the more transparent.
    Demo:

    1. opacity: 0.4; <div style="width: 200px; height: 200px; border: 1px solid black;">
      <div style="width: 100px; height: 100px; opacity: 0.4; background-color: blue;">​</div>
      </div>

    50271-image.png

    1. opacity: 1;

    <div style="width: 200px; height: 200px; border: 1px solid black;">
    <div style="width: 100px; height: 100px; opacity: 1; background-color: blue;">​</div>
    </div>

    50281-image.png

    Or you could use RGBA as the background-color's value.

    50215-image.png

    50213-image.png


    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  2. Julian Aguilar Zapata 0 Reputation points
    2024-05-30T15:46:15.0166667+00:00

    I had the same problem. The solution was to search for global (or main) styles and add the following lines.

    [class^="root-"] {
      background-color: transparent;
    }
    [class^="emphasisBackground-"] {
      background-color: transparent;
    }
    .CanvasComponent.LCS .ControlZone .ControlZone--position{
      background-color: transparent;
    }
    
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.