Growing background picture

I currently have an iPad serving as a background image.

However, I desire for it to be expandable, with the possibility of it being integrated into the header, footer, and the middle section expanding as needed to fill the entire page.

I am open to any advice on achieving this effect as I'm unsure which technique to employ at the moment.

Thank you in advance.

Answer №1

To create an interesting design, try adjusting the background image and stacking different elements. For example, you can add multiple div elements in blocks of 1000px. However, consider using a separate image for the middle section that repeats vertically for flexibility in height.

Another option is to make the 'screen' area scrollable for a dynamic interface.

Check out the Demo Fiddle here

HTML

<header></header>
<div></div>
<div></div>
<footer></footer>

CSS

div, header, footer {
    background-image:url(http://www.propertyitguy.co.uk/img/tablet-bg.png);
    background-repeat:no-repeat;
}
header, footer {
    height:100px;
}
footer {
    background-position:0 -1400px;
}
div {
    background-position:0 -200px;
    height:1000px;
}

Answer №2

When you're looking to keep your image intact, consider using the border-image property. Check out this example:

http://jsfiddle.net/DgHnR/

.tablet {
    border-style: solid;
    border-width: 120px 50px 122px;
    -moz-border-image: url(http://www.sample.com/picture.jpg) 120 50 122 repeat;
    -webkit-border-image: url(http://www.sample.com/picture.jpg) 120 50 122 repeat;
    -o-border-image: url(http://www.sample.com/picture.jpg) 120 50 122 repeat;
    border-image: url(http://www.sample.com/picture.jpg) 120 50 122 fill repeat;
    /*just for the example*/
    height: 1500px;
}

Full disclosure: I used to generate this code because I'm feeling lazy.

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

Padding problem arises when you wrap an image with an anchor tag

I'm having an issue with a div containing an anchor-wrapped image, as there seems to be extra padding at the bottom of the div. How can I remove this? HTML: <div id="lineup"> <div class="line-up-click"> ...

What is the best way to make the Nav bar overlap instead of shifting content to the right?

Is there a way to open the nav bar and have it overlap on the right without pushing content to the right? I tried experimenting with position and z-index, but it didn't work. Thank you! Link <div id="mySidebar" class="sidebar" ...

Deselecting checkboxes inside a specific div using jQuery when a separate checkbox is clicked

In this scenario, there are two distinct divs: check_one and check_two. Within check_one, there are 4 checkboxes, while check_two only has 1. The objective is to create functionality where checking the checkbox within check_two will automatically uncheck ...

Instructions for creating a JavaScript click function that iterates through all records, not just the initial record

Although I'm new to web development and still learning the basics of html, javascript, etc., I have a problem that seems quite simple. The challenge lies in understanding javascript functions, which I find particularly tough to grasp. Here's what ...

Unable to connect to a style sheet

I'm in the process of developing a web application and I'm facing an issue with linking a stylesheet to my app. Check out my code below: <html> <head> <title>Bubble</title> </head> <link rel=" ...

Looking for assistance in translating HTML code into an XpathQueryString?

While following a tutorial by raywenderlich on how to parse HTML in Xcode, I encountered an issue. I was able to parse his website successfully, but I'm struggling with the concept of Xpathquery. All I need is to extract the data from a table. Below i ...

Adjust image to fit inside a compact popup window - Implementing React.js and Bootstrap

Hello, I could really use some help with a problem I'm facing. I am currently working on my personal portfolio website using react.js and bootstrap. I've integrated the react popupbox package, but I noticed that on small screens, my picture is no ...

Ensure that the div is styled with a white background and positioned next to another div with a right margin

I have a white-colored div that needs to be positioned next to another element on a webpage. Additionally, I need a paragraph placed on top of this div for information purposes. Please refer to the following link to see what I am trying to achieve: https:/ ...

Dompdf is outputting the HTML Bootstrap code as col-sm-x instead of col-lg-x

Currently, I am utilizing Dompdf in my PHP project to generate PDF reports. However, I have encountered an issue where the HTML bootstrap code does not render as expected on the PDF document. Specifically, when viewing the grid on a smaller device, it coll ...

Display 1 row of content on larger LG screens and 2 rows on medium-sized MD screens using Bootstrap

How can I achieve 1 row with 12 cells on a large screen in Bootstrap, and for a smaller screen have 2 rows with 6 cells? Here is a visual representation of what I am trying to accomplish: https://i.stack.imgur.com/NgfaP.png This is the code I attempted: ...

Troubleshooting Issues with XMLHTTPRequest Function During Data Insertion

My code is only working when I include this line of code: document.write(str); Essentially, this code opens a new page and writes the inserted data into the database. However, if I attempt to run the code without it, like this: function addcourse2( ...

What is the best way to customize the Bootstrap CSS for an <a> element?

I recently started a blog and wanted to streamline my design process by using Bootstrap to avoid having to deal with media queries. However, I encountered an issue where the <a> element was displaying as blue. I have another CSS file that is loaded a ...

Leveraging python's BeautifulSoup library, one can easily implement HTML selection

Recently, I've started diving into Automate the Boring Stuff and exploring how to create my own programs. Currently, I'm experimenting with beautiful soup's 'select' method in order to extract the value '33' from this cod ...

Creating an X pattern on an HTML5 canvas and detecting intersections with a perimeter

I am currently developing a maze game using HTML 5. Below is the function I have implemented to draw an "X" on the canvas (the player will guide the X through the maze using touchpad). dim = 8; function rect(x,y,xdim){ ctx.beginPath(); ctx.moveT ...

Modifying ID styling using JavaScript on Internet Explorer

I need to change the CSS display property from none to block using JavaScript, but only for Internet Explorer. My current code is not working for the ID #backfill-image. <script> function checkForIE() { var userAgent = navigator.userAgent; ...

Aligning object in middle of a responsive image using Bootstrap

I'm having trouble centering a button on an image using responsive design techniques. I am currently utilizing Bootstrap 3 and have attempted to use CSS margin properties to center the button, but this method is not ideal especially on smaller screens ...

I plan to compile a collection of names in a text field and then have the ability to select and access each name individually with just a click

I am currently working on a project that involves creating an admin site using Firebase. One of the main features of the site is large text fields that display information which can be modified. For instance, the user management page includes text fields ...

Apply CSS styling to the v-html output

I am trying to enhance the style of HTML code using a v-html but have been struggling with finding a working solution so far. Can anyone help me out? :( Below is my code snippet: Template : <div class="para" v-html="value" /> Script : exp ...

Transitioning opacity and visibility in iOS CSS styling

Check out this test on a desktop browser by visiting the following link (JSFiddle): a { background: gray; display: block; margin: 100px; padding: 100px; } a span { opacity: 0; -webkit-transition: 0.5s; visibility: hidden; } a:hover span { ...

Text that appears when you hover over specific locations within one image

https://i.sstatic.net/G1uWk.png I need assistance in creating a feature where users can see short descriptions of individuals in a photo when hovering over them (not like a tooltip). I attempted to use an area map but encountered difficulties in implement ...