a guide to implementing max-width

Currently working on a school project that involves creating a website, just for fun! The website I made has a max-width setting and functions well. However, when the screen is small, my buttons overlap with the image. Does anyone have a solution to this issue?

Check out my code here!

@media screen and (max-width: 600px){ 
.float-left {float: none;}

Coen

Answer №1

To move the content below the navigation bar, start by creating a new div to group the content outside of the existing div. Give this new div a class name of "container," which is a common practice in web development:

<div class="container">
    <div>
        <img class="banner" src="http://i184.photobucket.com/albums/x286/tkReaper/ReaperBanner.jpg"/>
    </div>

    <div class="clearfix text-border">
        <p><img class="img-text" src="stadenesch.jpg"/>Hello! Welcome to Stad & Esch's web exercises! Stad & Esch specializes in customized education. Especially in computer science, lessons are tailored to students' personal preferences. There is something for everyone. These texts will fill the website to showcase the possibilities of CSS with HTML files </p>
    </div>
</div>

Next, include the new class "container" in your "@media screen and (max-width: 600px)" section of the CSS code. Add the "margin-top" attribute with a value of 220px from the top to achieve the desired effect:

@media screen and (max-width: 600px){ 
    .float-left {float: none;}
    .container {margin-top: 220px}
}

Keep in mind that this method provides a static solution. If you add more items to the navigation bar, you may need to adjust the "margin-top" value accordingly.

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

Adjust the scroll position in HTML by using a fixed navbar with Bootstrap 4

I am currently working on a single-page website with multiple sections. Users can navigate to these sections either by scrolling or by clicking on the navbar links. The issue I am facing is that the Bootstrap 4 navbar is fixed to the top, causing the conte ...

Encountering an issue with angular ag-grid: "Module build failed (from ./node_modules/sass-loader/dist/cjs.js): SassError: Invalid CSS after "adecimal"

I've encountered an error while using node-sass, sass, or both. Even after removing node modules and clearing the cache, the error persists. I've attempted different versions of node-sass and sass, but the issue continues to arise. This problem a ...

add the AJAX response to the specified div element

I'm currently using an ajax call to retrieve movie data from the IMDb API for 'The Shawshank Redemption'. My goal is to display this data within the designated div element. <div id="movie-data"></div> Here's my current Jav ...

Mobile-formatted inline Bootstrap

Using bootstrap and seeking to have elm1, elm2, and elm3 displayed inline on mobile devices? Take a look at the code snippet below: <div class="container-fluid"> <div class="form-group"> <label class="control-label col-sm ...

Steps for adding a table at the bottom of your content

After hours of searching, I am still struggling to find a solution for my problem. My goal is to have the menu2.html appear at the bottom of the page, after the end of the content. I've tried various options like setting positions and using CSS styles ...

Is there a way to upload numerous images from my local disk onto a canvas using Fabric.js?

I'm currently working on an innovative Image Collage application using the power of HTML5 canvas and Fabric.js. One of the key features I want to implement is the ability for users to simply drag and drop files into the designated 'File Drag and ...

Creating a 3x3 grid with CSS grid is great, especially when you want to place items in specific columns within the grid

I'm attempting to design a layout that has a unique structure: https://i.sstatic.net/dCLoPm.png The blue rectangles are represented by divs. It's like a 3x3 grid, but with spaces in the 3rd and 4th columns of the grid. How can I incorporate th ...

The text area within the input group is misaligned with the input group button

Here is an example of how I'm using the input group feature with Bootstrap: <div class="input-group" style="padding-left: 20px;"> <input type="text" name="s" class="form-control input-sm"> <span class="input-group-btn"> ...

When incorporating conditional statements into your code, make sure to utilize the tags <script> along with

I have some script tags as shown below: <script src="cordova-2.5.0.js"></script> <script src="js/jquery-1.7.2.min.js"></script> <script src="js/jquery.mobile-1.1.1.min.js"></script> <script src="js/jquery.xdomainajax ...

What are the steps to modify data within the root component?

I am currently working on a Vue project with vue-cli and routes. In my App.vue file, the template structure is as follows: <template> <div id="app"> {{Main}} <router-view></router-view> </div> </template&g ...

When attempting to submit the form, the page does not refresh as expected. The preventDefault() function also

I am facing an issue where, upon submitting a form, the page reloads. However, my requirement is to submit the form without reloading the page and send the data to a specific action URL. This may seem like a duplicate question but here are the details: F ...

Are there any other methods of using HREF in an <asp:Button> besides OnClientClick for invoking an inline div?

I decided to create a concealed <div> on the same page and tried calling it with href="#", which worked perfectly. However, when I attempted to use the same code in ASP.net, I encountered some issues with Javascript or other factors that prevented it ...

My grid layout remains unchanged despite tweaking grid-template-columns

I am currently learning HTML and CSS and experimenting with building a website. My goal is to have 4 boxes aligned next to each other, similar to a navigation bar, but with box items. Here is the code for these boxes: HTML: <section class="boxes&q ...

Styling Borders in CSS/HTML

Having an issue with the CSS on my website, specifically when hovering over links in the navigation bar. I'm trying to add a border around the link when hovered over, but it's causing the other links to shift position. Here's what I have so ...

What is the best way to trigger a jQuery function after adding a <div> element through Ajax loading?

When I use Ajax to append a <div>, the dynamic inclusion of jQuery functions and CSS for that particular <div> does not seem to work. The insertion is successful, but the associated jQuery functions and CSS do not load properly. How can this be ...

Is HTML5 supported by IBM Worklight's MBS?

I'm having issues with my mobile browser simulator not recognizing certain HTML5 elements such as input date type, placeholder, localstorage, sessionStorage, and Video tags. Should I make any changes to fix this problem? ...

Tips for managing page navigation and incoming links on a site that uses only ajax technology

Currently, I am in the process of developing a fully ajax-based website which presents a challenge - the inability to provide direct page links. To address this, I have implemented a functionality where the page name gets appended to the URL each time an a ...

Style an image in CSS based on the value of its alt attribute when

Is there a way to style an <img> tag using CSS based on its alt attribute value? For example, I have images with ALT values of "DISAPPEAR". I would like to hide the image when it is hovered over using the following CSS: img[alt="DISAPPEAR"]:hover ...

Shake up your background with a random twist

Seeking assistance with customizing the Aerial template from HTML5UP. I am interested in selecting a scrolling background randomly from a pool of images. Can someone guide me on how to achieve this? Presently, the background is defined within a code block ...

Panel div fails to show visNetwork visualization

After experimenting with shinyLP for creating html elements and crafting network diagrams using visNetwork, an interesting observation was made. When visNetwork is placed in a well panel or without any panel at all, it displays properly. However, the issue ...