Skip to main content
kareinv18601785
Participant
June 15, 2023
Question

background colour strip behind slider

  • June 15, 2023
  • 2 replies
  • 187 views

HI All, How can i create a colour strip behind my slider as per this image. your help would be much appreciated.

    This topic has been closed for replies.

    2 replies

    Nancy OShea
    Community Expert
    Community Expert
    June 15, 2023

    Are you using Bootstrap's Carousel?

    What is the native height & width of your image?

     

    Nancy O'Shea— Product User & Community Expert
    Community Expert
    June 15, 2023

    I'm not sure I understand your question... so I'll answer what I think is your request.

    It all depends on the structure of your HTML and without seeing your code, we can only speculate.

    Based on the screenshot provided, we can see that the slider only occupies a percentage of the full width, whereas the colored banner spans the entire width of the page.

     

    So, to work in a more scalable way, it would be preferable to use a set of three containers :

    1. The main container (parent), which represents the entire banner itself, and contains the other two containers

    2. So, a first child placed behind (z-index) and containing the colored background (being autonomous it can thus occupy the desired space independently of all other components).
      The colored strip can be made either as a background color for the block itself using CSS, or by using hard content in the form of an IMG, or even VIDEO, etc.

    3. Then, a second child in the foreground (z-index), which will contain the slider itself.

     

    For both children, absolute positions in top left 0,0 can be used without fear, as long as the parent itself is explicitly defined in relative position.

     

    If that wasn't your question, sorry for the noise.