Enable scrolling for both image and text in landscape mode

In landscape screen orientation, I would like the image and text to be scrollable. I plan to achieve this using a media query with a min-width of 768px and a max-width of 1024px.

body{

    background: url("/img/prewed.jpeg") no-repeat center ;

    background-attachment: fixed;

    background-size: cover;

    width: 100%;

    height: auto;

    color: #fff;

    z-index: -1;

    overflow-y:auto;

}


@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {

    body{

        display: flex;

      background-repeat: no-repeat;

      min-width: 100vw;

      min-height: 100vh;

      background-position: center;

      background-size: 100% 100%;

      
    }
<div class="container">


        <div class="tittle">

            <h1>Wedding Invitation</h1>

            <div class="yth">
                <p>Without diminishing our respect, we sincerely invite you to celebrate our wedding.</p>

                <div class="button">

                    <a href="#">Open Invitation </a>

                </div>

            </div>

        </div>

    </div>



    

Answer №1

To create a scrollable background image, add the following CSS property:

background-attachment: scroll;

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

V-model prevents checkbox from being checked upon clicking

codesandbox: https://codesandbox.io/s/github/Tapialj/AimJavaUnit6?file=/src/frontend/src/components/AddMovieForm.vue I am currently working on implementing a feature where I need to collect an array of selected actors using checkboxes. I have set up a v-m ...

"Add a +1/Like/Share feature to enhance the user experience of your mobile web

In the process of developing a web-based mobile application with jQuery Mobile. Looking to incorporate buttons for "+1" and "Share" (for Google+) as well as "Like" and "Share" (for Facebook), but each button utilizes a popup window which goes against crea ...

Creating a cascading select menu based on the selected value of another select menu

I am in the process of creating a menu that displays two lists for regions: one <select> for selecting the region and another <select> for choosing from available municipalities within that region. I have set up a <form> and I utilize Jav ...

Receive the latest order details following jQuery Sort

Utilizing jQuery UI's Sortable feature, I am reordering a list of items and aiming to adjust the class of each item based on its new position. Below is the HTML structure: <ul id="sortable"> <li class="1">apple</li> <li c ...

Error: Unable to locate module 'next/font/google/target.css'

After setting up Next.js version 14.0.1 on Node.Js v20.9.0 and Ubuntu 20.04, I encountered an error right from the start. Failed to compile /var/www/html/C#/nextApp/app/layout.js Module not found: Can't resolve 'next/font/google/target.css?{&quo ...

Voice recognition feature in the latest version of Chrome on Android devices

When using a PC with Chrome 25 (non beta), I see a microphone icon that prompts for input when clicked. After speaking, my alert call is successfully executed. However, on a Galaxy Note smartphone with Chrome 25 and an Android 4.04 operating system, the sa ...

Utilizing Bootstrap 4 to Wrap Text Around Images

Concerning Bootstrap 4: Examine this HTML/CSS code that is not currently responsive (missing Bootstrap "col-"). The Lorem Ipsum text wraps around the image on the right side and below it due to float-left. <img class="pr-3 pb-3 float-left" src="~/Im ...

Conflicting events arising between the onMouseUp and onClick functions

I have a scrollbar on my page that I want to scroll by 40px when a button is clicked. Additionally, I want the scrolling to be continuous while holding down the same button. To achieve this functionality, I implemented an onClick event for a single 40px s ...

Using Javascript to dynamically add and remove elements on click

Whenever I click on a link, I am able to generate input, label, and text. However, I want to be able to delete these elements with the next click event on the same link: I've tried updating my code like this: var addAnswer = (function() { var la ...

Having trouble getting pure css to load properly in a Ruby on Rails application

Using pure.css to load "_form.html.erb" in my rails app. The css is styling the regular HTML below it, but not the rails portion. Important: The additional HTML was added to verify that the css is working correctly. Below is an example from the _forms.ht ...

Enhancing modal interactions with modal pop-ups

I've been experimenting with different modal effects for a modal popup, following the examples on this site: https://tympanus.net/codrops/2013/06/25/nifty-modal-window-effects/ Here is my code snippet: <div class="md-modal md-effect-1" id="modal- ...

Issue with preventDefault not functioning correctly within a Bootstrap popover when trying to submit a

I am facing an issue with a bootstrap popover element containing a form. Even though I use preventDefault() when the form is submitted, it does not actually prevent the submit action. Interestingly, when I replace the popover with a modal, the functional ...

Alignment of Bootstrap 5 card text and buttons

I've been diving into the BootStrap 5 Crash Course from this YouTube link: https://www.youtube.com/watch?v=4sosXZsdy-s. The final website from the tutorial can be found here: One specific part focuses on using Cards, but I'm facing an issue wher ...

Is it impossible for both <a> and <name=""> to collaborate in HTML and PHP?

Is it possible to make both <a href works > and name="send" work at the same time within isset($_POST['send']) in this code? Currently, it's not functioning as intended. Is there a way to achieve this for both cases? The requirement i ...

Position a box to the right of a Bootstrap 3 fluid container

I've been grappling with Bootstrap and just launched a web app using Bootstrap 3. I'm trying to position a box on the right side of the screen, but despite several hours of researching and testing, I can't seem to find the solution... This i ...

I would like to create a fixed-position menu similar to Slashdot's comment filtration menu. How can I achieve this?

Have you ever noticed that Slashdot has a cool little feature that lets you adjust your comment threshold to filter out down-modded comments? When you scroll to the top of the page, it stays in one place, but as you continue scrolling down, it eventually s ...

Mobile site experiencing owl.carousel responsiveness issues after refreshing the page

I am currently working on a website located at . On the homepage, right after the slider, there is a carousel of three info boxes. However, in mobile view (developer mode), after a hard refresh or viewing the link on an actual mobile device, it displays a ...

The onClick event listener is not being recognized when using ReactDOMServer.renderToString

I am attempting to replicate the functionality of this fiddle: http://jsfiddle.net/jhudson8/135oo6f8/ (I also tried this example http://codepen.io/adamaoc/pen/wBGGQv and encountered the same issue with the onClick handler) My goal is to make the fiddle c ...

Dealing with missing image sources in Angular 6 by catching errors and attempting to reset the source

When a user adds a blob to my list, sometimes the newly added image is still uploading when the list is refreshed. In this case, I catch the error and see the function starting at the right time: <img src="https://MyUrl/thumbnails/{{ blob.name }}" widt ...

Insert a new <tr> element into a dynamic table using PHP and jQuery without the need to refresh the page

I am attempting to dynamically insert a row into an existing table when a button is clicked. The rows in the table are created dynamically based on data retrieved from a PHP script. My approach involves making an ajax call to the insert_tr.php script, whi ...