Adapting my desktop website layout to be responsive for an optimal viewing experience on iPads and mobile

I recently created a webpage for laptop view and attempted to use media queries to adjust the CSS styling to fit on iPad and mobile devices. However, when setting the width of the (.content) element to 100%, the content doesn't actually fill the entire width, leaving a relatively large margin. I also used position relative to adjust the position of form and paragraph elements in the initial laptop view - could this affect my media query? Any help or suggestions would be greatly appreciated as I need to submit this assignment by tomorrow! 😅 Thank you.

View image here

body{
    font-family: Verdana, Geneva, Tahoma, sans-serif;
    background-color: rgb(250, 250, 250);
}

.content {
    max-width: 1400px;
    margin: auto;
    background: rgb(247, 246, 244);
    padding: 10px;
}

... <!-- Truncated CSS code for brevity -->

@media screen and (max-width:915px) {
    .content{
        width: 100%;
    }

    .inner-body {
        width: 100%;
    }
}


@media screen and (max-width:415px) {
    .content{
        width: 100%;
    }

    .inner-body {
        width: 100%;
    }
}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="log-it-reports.css">
    <script src="log-it-reports.js"></script>
    <title>Document</title>
</head>
<body>
    <div class= "content">
        <div class="logo">
        <img src="image/logo1.png" alt="Academy Logo" >
        </div>
        <div class="navi">
            <p id="nav"> 
                <a href="homepage.html" title=" Home Page"> Home</a> |
                <a href="academics.html" title=" Academics Page">Academics</a> |
                ... <!-- Truncated HTML code for brevity -->

            </navi>
        </div>
    
       
       <div class="inner-body">
           <div class = "header" >
            <h1>Steps For IT-Issues Logging:</h1>
           </div>
       
       <div class="para">
           <p>Please read the following instructions before submitting a report:</p> 
           <ol>
               <li>Fill out all of the fields.</li>
               <li>Use a valid email.</li>
               <li>Select a problem type.</li>
               <li>Be as detailed as possible so that the IT staff could address the issue properly (100 characters minumum).</li>
               <li>Normally most issues get addressed within 2 hours, please be patient.</li>
           </ol>
       </div>
       ... <!-- Truncated HTML form content for brevity -->
    </div>
</body>
</html>

Answer â„–1

A simple solution is to adjust your CSS code as such:

@media (max-width:415px) {
    .content{
        width: 100%;
        margin: 0;
        padding: 0;
    }
    body {  
        margin: 0;
    }
    .inner-body {
        width: 100%;
    }
}

By implementing this code, you can eliminate the gap between your content and the edge of the screen!

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

Tips for utilizing innerHeight for a div during both window loading and resizing tasks?

I'm currently working on calculating the top/bottom padding of a div (.content) based on its height, and updating it upon loading and resizing the window. The goal is to have it centered nicely next to another div (.character) positioned beside it. I ...

Is there a way to conceal a Select element so that it is not visible on the screen, yet can still activate the dropdown menu when another element is clicked

One idea for my website is to replace a select element with a button that triggers the dropdown. The plan is to place the select element inside a button DIV, position the select element on top of the button, and set its opacity to 0 so it appears hidden. W ...

Shift the "Login link" to the right side of the Bootstrap navbar

Currently working on a Django website and incorporating Bootstrap/CSS/HTML to enhance the design. I've set up a navbar menu and want the login tab on the right side. However, despite my attempts, I'm not achieving the desired outcome: The HTML ...

Personalizing the pop-up window using window.open

When clicking a hyperlink on a page, I need to open multiple pop-up windows. To achieve this, I must use the Window.open function instead of showModalDialog. However, I have noticed that the appearance is not satisfactory when using Window.open. (Essentia ...

Struggling to align an element in HTML when used in columns?

<div class="row"> <div class="col-lg-3 " style="border: groove;"> <p class="circle col-xs-1 center-block">01</p> <h3>trending courses</h3> ...

Why do I see my footer displayed twice on the page?

<div class="navbar-collapse collapse"> <ul class="nav navbar-nav"> <li>@Html.ActionLink("Home", "Index", "Home")</li> <li> @Ajax.ActionLink("Imagenes List", "Images", "Home", new { page = 0 }, new AjaxOptions() ...

Dash: Streamlining the process of updating numerous elements within a callback

I am facing a challenge with my Dash app where I have multiple html.Div components that all look and are laid out similarly. When I click on a checkbox, I want all of these elements to be hidden. The common solution suggested is to create multiple outputs ...

Refreshing GIF images in React using forceReload

In order to restart the gif animation every 12 seconds or whenever the activeIndex changes, I need to reload a GIF image with CHECKMARK_ANIMATION_ICON as the source. Below is the code: const reloadImgSource = (imgSource) => { setTimeout(() =& ...

Comparing transition effects: scale, transform, and all

My goal is to apply transition effects to specific transform functions in CSS, such as scale(), while excluding others like translate(). Initially, I attempted the following code snippet: input:focus + label, input:not(:placeholder-shown) + label { tran ...

Organize elements with precision using html and css properties

I am struggling to get the buttons on the card to align properly. I have set a minimum height to ensure they are consistent in size regardless of content, but the alignment of the buttons is off. Take a look at the photo attached for reference - I want the ...

Use ajax to dynamically update the contents of a textbox

As a newbie programmer, I recently created my own JavaScript update function for my program. However, the code is not updating as expected. Can someone please help me troubleshoot and get it working properly? What I want to achieve is that when I change t ...

The CSS classes for the dropzonejs are not being properly updated for editing purposes

I'm currently facing an issue where I am attempting to include an editable area inside a dropzone, but for some reason, the editable area is not visible within the dropzone and the CSS classes are not being applied. <a href="#" editable-text="us ...

Menu options submerged beneath the surface of a concealed container with overflow property

Attempting to enhance the ui-grid by adding more options to each row using the "3 dots" approach. However, encountered an issue where the dropdown menu extends beyond the screen due to the use of position: absolute. Unable to switch to position: relative b ...

When utilizing the "as" attribute, styled components do not inherit any styles

I am currently utilizing both styled-system and styled components, working on a simple scenario like the one below: const buttonFont = { fontFamily: "Chilanka" }; // define basic text styling const Text = styled.div` ${typography} ${color} `; // c ...

Is it true that setting the background size to cover does not actually stretch the image?

Hi, I seem to be having trouble stretching an image using the background-size property. Despite setting it to cover, one or two sides of the image are always getting cropped. What I really want is a way to distort the image so that it stretches to fit any ...

"Can you share some tips on successfully transferring an image I've uploaded from an HTML page to

Looking for help with passing my uploaded image to Flask. Although the HTML page successfully uploads the image, I am facing challenges in transferring that image as a request to Flask. This is particularly important for image prediction purposes, but unfo ...

Styling with react-jss based on intricate conditionals

After experimenting with react-jss for a few weeks, I am faced with the challenge of styling components efficiently. With numerous conditionals in these components, I am striving to avoid creating an excess of new components that essentially share the same ...

The :after pseudo-element in action with multi-line text

Can the styling of the :after pseudo-element be applied to every line of multi-line text? Here is the code I am currently using: .container { width: 50px; } .text { position: relative; } .text:after { content: ''; position: ...

Retrieving Information From a Targeted div Identifier with PHP

Possible Duplicate: read XML tag id from php How can I retrieve data from a specific div ID using PHP? I want to extract data from a div with the ID of <div id="content">, so that all the content within that div can be stored in a variable. Alt ...

How to Implement a Dropdown Menu in HTML and CSS for Navigation Bars

Currently, I am in the process of creating a website at www.bossfakeid.co.uk. I am looking to add a dropdown menu to the "Products" section of the navbar. I found a dropdown menu solution that I would like to implement from this link: http://codepen.io/wil ...