Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7592133
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T20:49:49+00:00 2026-05-30T20:49:49+00:00

I am trying to create a flexible div with a background as shown below,

  • 0

I am trying to create a flexible div with a background as shown below, any suggestions on how i can do it in css?

enter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T20:49:50+00:00Added an answer on May 30, 2026 at 8:49 pm

    For best cross-browser compatibility I would suggest to cut the box into three pieces:

    enter image description here

    Top and bottom pieces are not changing. The middle one should have 3px height and full width and be repeated to the y-axis.

    <div id="shadowbox">
      <div class="content">Your Content here</div>
      <div id="boxending"><!-- --></div>
    </div>
    
    #shadowbox {
     background: url(box_top_bg.gif) 0 0 no-repeat;
    }
    
    #shadowbox.content {
      background: url(box_content_bg.gif) 0 0 repeat-y;
      margin-top: //as high, as the top picture is
    }
    
    #boxending {
      background: url(box_bottom_bg.gif) 0 0 no-repeat;
    }
    

    If your are not using a reset stylsheet you might have a problem with the empty div showing up the line-height. Have a look at this!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a div which will have fixed width and flexible height
I'm trying create a bot which automatically likes Facebook posts. Using Mechanize I can
I'm trying to create an flexible update query. I have now something like this:
I'm trying to create a class that works as a flexible enum. I came
I'm trying to create a particular CSS button described here: http://www.2shared.com/file/5131551/412bd8a8/Sans_titre-1_copie.html Basically, it's a
I'm trying to create a PHP backend that is flexible enough so it doesn't
I'm trying create this function such that if any key besides any of the
Recently I was trying to create flexible observer pattern implementation which hides boost::signal .
I'm trying to create a LALR(1) parser in Yacc/Bison that can accept commands with
I'm trying create a text area in a div with the id of "body".

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.