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

The CSS attribute selector is unable to target dynamically appended class names

Utilizing React's CSS animations add-on has been a seamless process, with everything running smoothly when using the provided classnames. .quote-enter { opacity: 0.01; transition: opacity .25s ease-in; } .quote-enter.quote-enter-active { opaci ...

What is the definition of "top of the page" within a PHP document?

One source claimed that ob_start() should be placed at the top of the page, while another insisted that session_start() should take precedence. I also came across a guide stating that header() belongs at the beginning of the page. Additionally, I read th ...

Struggling with validating forms with JavaScript

I'm having trouble with the following JavaScript code: <script type="text/javascript"> function checkDetails(search) { var search = documment.getElementById('query'); if(search.value ==''||search.val ...

After applying the cellClass in ng-grid, the row border mysteriously disappears

After applying cellClass to color an entire column, the row border disappears. Here is a link to the Plunker demonstration: http://plnkr.co/edit/4IeQQBTIe8sgHVEBUTAp?p=preview. Does anyone have a solution for this issue? ...

Using jQuery to show and hide elements on a webpage

One issue I'm facing is changing the content on a page depending on the clicked link. The problem arises when the displayed content for one link persists even after clicking another link, despite setting it to not display when another link is clicked. ...

PHP - Working with Regular Expressions in Improperly Formatted

Struggling with Regex has always been a challenge for me, especially when I need to extract content from a malformed piece of code like the option tag. The website where this code is obtained from has poor programming and inconsistent label structures: I& ...

Preserving data in input fields even after a page is refreshed

I've been struggling to keep the user-entered values in the additional input fields intact even after the web page is refreshed. If anyone has any suggestions or solutions, I would greatly appreciate your assistance. Currently, I have managed to retai ...

Trouble with formatting a HTML form

I have been working on dynamically creating HTML forms using a function called makeInput(). However, I am facing an issue where the text input boxes are appearing next to each other when I click the "Add Course" button, instead of one per line. Below is ...

What could be causing the appearance of two vertical scrollbars after transitioning from ReactJS to NextJS?

During the development of a project in plain ReactJS, I added these two lines to my index.css: overflow-y: scroll; overflow-x: hidden; The purpose was to ensure a vertical scrollbar always appeared without causing a horizontal scrollbar even when there wa ...

CSS cascading not happening

Within the usersettings.css.erb file, line numbers are provided for easier reference. 11 #userSettingMain .form-horizontal .controls { 12 13 margin-left: 30px; 14 } 15 16 #user_birthday_3i{ 17 18 margin-left: 0px; 19 } U ...

Oops! Smarty encountered a fatal error that wasn't caught

An error occurred while processing the template file "C:\xampp\htdocs\eventos\libs\templates\teste.tpl" on line 9. The error message states: Fatal error: Uncaught exception 'SmartyCompilerException' with message &apo ...

To fill the remaining white space, add an underline after the last line of text

I'm struggling to implement a SCSS/CSS styling concept where I need to add a solid line before or after the last line of a heading. The challenge is that the width of the last line varies based on the screen size. I am open to any suggestions. Here&a ...

What is the best way to ensure a container adjusts perfectly to its contents without constraining the contents to their minimum width?

Imagine you have a div with a flexible width (like min-width 200px and max-width 1000px). Let's refer to this div as Div1. The goal is to enclose this div in a parent div that adjusts its size to fit Div1 without impacting Div1's width whatsoever ...

Is concealing a button an effective strategy?

Recently, I decided to design a login form for my website. To quickly style the form, I opted to use Bootstrap through CDN. While working on the form, I encountered an issue with the button size as the device width changed. Initially, I applied the classes ...

Attempting to utilize a custom element, the message "You attempted to use polymer without loading it first" confirms that it has indeed been imported

I've been experimenting with a custom element for a paper-dialog popup that I want to incorporate. Surprisingly, when I create a test page within the same file where the custom element is defined, using all the identical imports as my main index, it w ...

The icons from Font Awesome are not displaying properly in Angular version 15

I have been searching for new information to help solve the error I am experiencing but haven't found any useful results. Here is my issue: I am working on a project in Angular 15.1.0 and want to incorporate some Font Awesome icons. To do this, I foll ...

SliderToggle and Div implementation in Internet Explorer (IE) using jQuery

I'm encountering an issue with jQuery's slideToggle function and a div specifically in IE. Here is the code snippet causing the problem: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.d ...

What seems to be the issue with my snake game not loading properly?

I am having trouble getting something to display in my browser while working on this snake game. No matter how many times I check, I can't seem to find the mistake I made. Every time I refresh the browser, the screen remains blank. gameTime.html < ...

Animation in CSS/transform drifting out of view

I have a challenge with animating text to each corner of the screen, where the text is rotated in every corner. However, I am facing an issue where the text goes off-screen in the top right and bottom left corners. It seems like the rotation might be causi ...

Prevent blurring on a sub-element when hovering over a blurred container using Bootstrap 5.2

Can anyone help me prevent a blur effect on the "text-block" child element when the mouse hovers over the card element? I want the card element to have a complete blur effect while also displaying the text block on top of it. I've tried several optio ...