The Div elements are not displaying properly in the correct size on the responsive webpage

Looking to create a responsive design for a follow page.

Although I've managed to make it work, adding a line at the top of each row is causing layout issues and the Box container is not displaying consistently in size.

I attempted to set up a fiddle example, but for some reason, the design breaks when using this method.

Fiddle Update: http://jsfiddle.net/uNjLu/5/

I want my page to look like the image below. How can this be achieved while maintaining responsive design?

  <div class="large-12 content">
        <div class="cover-wrapper">
            <div class="cover-inner">
                <div>
                    <img src="http://placehold.it/243x324&text=[img 1]">
                </div>
            </div>
        </div>
        <div class="cover-wrapper">
            <div class="cover-inner">
                <div>
                    <img src="http://placehold.it/243x324&text=[img 2]">
                </div>
            </div>
        </div>
        <div class="cover-wrapper">
            <div class="cover-inner">
                <div>
                    <img src="http://placehold.it/243x324&text=[img 3]">
                </div>
            </div>
        </div>
        <div class="cover-wrapper">
            <div class="cover-inner">
                <div>
                    <img src="http://placehold.it/243x324&text=[img 4]">
                </div>
            </div>
        </div>

Answer №1

There are several custom widths defined for divs that are currently taking precedence over foundation classes.

If you prefer to utilize foundation classes instead, here is a suggested approach: use small-centered and medium-centered classes to center them on the respective screens.

img{
    margin:20px auto;   
}
.header{
        background-color:#7A1F13;
}
.slideshow{
    background-color:#7A1F13;
    height:200px;
}

.footer{
        background-color:#7A1F13;
}
<link href="http://cdn.jsdelivr.net/foundation/5.4.3/css/foundation.css" rel="stylesheet"/>
<!--header area-->
<div class="row header "> 
<h1 class="large-12  text-center">Header</h1>   
...
                        <div class="small-12 medium-6 large-3 columns">
                <img src="http://placehold.it/243x324&text=[img 1]">
            </div>
    </div> 
</div>
<!--content end-->
<!--footer area-->
 <div class="row footer"><h1 class="large-12 columns text-center ">Footer Section</h1></div>
<!--footer end-->
</div>

Ensure you have a row class and organize them according to your requirements using

small-12 medium-6 large-3 columns
.

If your breakpoints are at 768px, 640px, and 340px, then you will need to adjust the media queries. This can be done through either of the following methods:

1) utilize sass files from foundation and modify breakpoints
2) manually adjust all media queries in the css code

Access the Fiddle link.

View in fullscreen mode

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

Guide on displaying the <html> tag within text using AngularJS

I need to display some data in HTML, which looks like this: <p>abcd efg hijk....(<a href=\"http:\/\/www.facebook.com\/stock\/NBR\">NYSE:NBR<\/a>),, however, there are some HTML tags within ...

What is the significance of using single quotation marks to enclose the 'raw' key in Tailwind?

While reviewing the Tailwind documentation on custom media queries, I came across an interesting option to create a fully custom breakpoint using the 'raw' key. After adding this to my configuration file, I noticed that when I saved the file, Pr ...

Issues with the plugin for resizing text to fit the parent div's scale

I've spent the last hour attempting to get this script to function properly, but no luck yet. Check out the correct jsfiddle example here: http://jsfiddle.net/zachleat/WzN6d/ My website where the malfunctioning code resides can be found here: I&apo ...

Eliminate the white background from the modal image

I'm facing an issue with an image displayed in a modal. The image has a white background that I want to remove so only the image itself is visible. https://i.stack.imgur.com/CG9Ne.png Here's the code snippet: <div id="myModal" class ...

The max-height property is not applied to a border-box div with padding

One technique we use is the percentage trick on paddings to maintain aspect ratio in a div as the user scales their window. Here's an example: .div { background: red; width: 80%; margin: 0 auto 10px; -webkit-box-sizing: border-box; ...

creating a new page upon clicking a div element

I need assistance in creating an effect similar to the one found on this website - where clicking on a div opens a new page. ...

What is the best way to customize the default button style for buttons in Angular Datables?

After integrating buttons into my Angular Datatables, I noticed that they have default styling, which makes them stand out from the rest of my web page (refer to the Column Visibility button in the screenshot below): I attempted to use CSS to make the but ...

Unable to view Mp4 video on Internet Explorer 11

My background video is in mp4 format and functions properly in Chrome, Firefox, and other browsers, but it does not work in Internet Explorer 11. To visit the website, click on "access as a non-secure site". ...

Trick to keep horizontal element alignment intact when scroll bar appears

Currently, all my pages are designed with the standard fixed-width-margin-left-right-auto layout. .container{ width:900px; margin:0 auto; } An issue arises when some of these pages exceed the height of the window, requiring a vertical scroll ba ...

Can Puppeteer extract the complete HTML content of a webpage, including any shadow roots?

When using Puppeteer to navigate a webpage, I typically can retrieve the full HTML content as text with this code: let htmlContent = await page.evaluate( () => document.querySelector('body').innerHTML ); However, I am currently faced with ...

Tips for halting the movement of marquee text once it reaches the center briefly before resuming animation

Is there a way to make text slide in, pause when centered, and then repeat the process? I'm looking for some help with this animation. Here is the code snippet: <marquee direction="left" id="artistslide"> <span id="currentartist">< ...

Why is only jQuery 3.2.1 or jQuery Mobile 1.4.5 being loaded?

When I load my html file, only jquery or jquery mobile is loading from the head. Changing the order in which they appear in the head causes a switch in which one is loaded. Is this possibly due to a compatibility issue? <head> <title& ...

CSS swapping versus CSS altering

Looking to make changes to the CSS of a page, there are two methods that come to mind: Option 1: Utilize the Jquery .css function to modify every tag in the HTML. For instance: $("body").css("background : red") Alternatively, you can disable the current ...

Revamping HTML with AngularJS Directive: Enhancing the Layout with New Angular Attributes

I am currently facing an issue with the compiler not recognizing a new attribute I have added in a directive. In my Angular TypeScript code, I have the following setup: public class MyDirectiveScope: ng.IScope { foo: boolean; } public class MyDirecti ...

How can I generate a checkbox in a database with a field that allows for enabling and disabling?

I am looking to design a table that includes questions, checkboxes, and text boxes. All the questions are stored in a database and called through an array. In addition, I want to create disabled textboxes that become enabled when their corresponding checkb ...

Creating a flexible grid layout with DIVs that share equal width dimensions

Struggling with my HTML and CSS code, I need a way to structure nested DIV blocks into a responsive grid where each block has the same width. Despite my efforts, nothing seems to work as expected. Currently, the nested DIVs are stacked vertically one on to ...

The button functionality gets hindered within the Bootstrap well

I'm trying to figure out what's wrong with my code. Here is the code: https://jsfiddle.net/8rhscamn/ <div class="well"> <div class="row text-center"> <div class="col-sm-1">& ...

I need assistance with retrieving an image from a database using PHP

How can I display an image from the database on a new page using PHP? Whenever I click on the image, it always shows the same image on the new page. How can I make it so that the image displayed on the new page is the one I clicked on in the previous pag ...

Changing the Appearance of the RStudio Editor

I am exploring options to customize an RStudio Editor Theme to personalize the colors. My current setup includes RStudio version 0.99.473 on Windows 10. After reviewing Any way to change colors in Rstudio to something other than default options?, which wa ...

Is it possible to hide a fixed header on scroll in a mobile device?

I am facing an issue with my Wordpress site where I want the header to hide when the user scrolls. Despite trying various codes, I have been unable to make it work. The reason for wanting to hide the header is that on mobile devices, it causes scroll prob ...