What measures can be taken to avoid overlaying divs causing gaps at specific screen resolutions? (google trends)

Take a look at my website:

Also, check out my upcoming project here:

I'm almost there with the layout, but when you resize the browser vertically too much, it creates a gap.

I am unable to debug resolutions higher than mine (1280x800), and I suspect something else breaks in the opposite direction.

Update: Could the size of the photo be causing the issue? Zeitgeist uses an 800x800 square image, while I use a rectangle?

The problem might also lie in errors within the structure of my HTML code (this layout is challenging for me).

<section class="bodySection">
  <div id="body-wrapper-left" class="">
    <div id="me"></div>
    <div id="pattern"></div>
  </div>
  <div id="body-wrapper-right"> </div>
  <div class="clearfix"></div>
</section>
<!--end of bodySection--> 

or my CSS:

html, body, #body-wrapper, .bodySection {
    height: 100%;
}
#body-wrapper-left {
    position: relative;
    width:35%;
    height: 100%;
}
#body-wrapper-left #me {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background: url('http://designobvio.us/portfolio/img/Me.jpg') repeat-y;
    z-index: 1;
    -o-background-size:auto 100%;
    -webkit-background-size:auto 100%;
    -moz-background-size:auto 100%;
    background-size:auto 100%;
    -webkit-transition: all 0.20s ease-out;
    -moz-transition: all 0.20s ease-out;
    -o-transition: all 0.20s ease-out;
    transition: all 0.20s ease-out;
}
#body-wrapper-left #pattern {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background: url('http://designobvio.us/portfolio/img/sliderBG.png') repeat;
    z-index: 2;
}
#body-wrapper-right {
    position: absolute;
    height: 100%;
    right:0;
    top:0;
    min-width:65%;
    width:65%;
    background:#fff;
    z-index:9;
}

It seems like there may be a specific min-height or min-width value affecting the layout. Can anyone help pinpoint where and what adjustments I need to make to achieve uniform widths and heights similar to Google Zeitgeist's design?

Answer №1

If you're looking to achieve a full background image in CSS, consider utilizing the background cover option available in CSS3.

#element {
background: url(http://designobvio.us/portfolio/img/Me.jpg) center center;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
width: 50%;
height: 100%;
position: absolute;
}

For an example implementation, check out: http://jsfiddle.net/B7W2K/20/

Note that this method may not be compatible with older browsers.

Answer №2

The reason for the gap you're noticing is because of the vertical scaling behavior of your image instead of horizontal. To resolve this issue, simply modify the code to adjust the scaling like this:

#body-wrapper-left #me {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background: url('http://designobvio.us/portfolio/img/Me.jpg') repeat-y;
    z-index: 1;
    -o-background-size:100% auto; /* changing the statement */
    -webkit-background-size:100% auto;
    -moz-background-size:100% auto;
    background-size:100% auto;
    -webkit-transition: all 0.20s ease-out;
    -moz-transition: all 0.20s ease-out;
    -o-transition: all 0.20s ease-out;
    transition: all 0.20s ease-out;
}

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

When I implement the persist gate in Next.js with Redux, the flex direction automatically adjusts

I'm currently developing an app using next js and redux. An interesting issue has arisen - when I include PersistGate in my _app.js file, the flex direction mysteriously changes from row to column in index.js. There haven't been any modifications ...

Strange behavior exhibited by ngMessage in AngularJS when used with input of type "email"

I recently came across an article on transitioning from using ngModel.$parsers and ng-if to ngModel.$validators and ngMessages by Todd Motto on his blog. Intrigued, I decided to migrate from using ng-if to ng-messages in my code. However, I encountered a s ...

Align text in the center of multiple <td> elements in a table horizontally

I have a schedule table in the form of a timetable. My goal is to have the borders between two or more consecutive tasks removed. I have achieved this. Additionally, I want the text to be centered within each cell of the table. For clarification, refer to ...

Why does tagging P trigger popups in the DIV when the DIV contains another DIV?

JSBIN HTML <p> <div>123</div> </p> CSS p div{ background:#f00; } Encountering an odd issue here. When I input the HTML structure as shown below: <p></p><div>123</div> The CSS code fails to produce ...

Unexpected whereabouts of elements (tables)

I need assistance moving the elements in the red boxes to the blue boxes <table> <tr style=""> <td style="text-align: center; width: 70%;" colspan="2"><img src="pre_header.jpg" alt="" style="width: ...

Row Carousel Share - Horizontal Perspective

Having some trouble getting my carousel to align horizontally with other text in a row – it keeps taking up the full width instead of the 40% I've set. Below, you'll find the code snippet and screenshots for reference. In the screenshot above ...

How can I use the same popup button to open a different link in a new tab?

I have a situation where I am using a button to trigger an ajax html popup. What I want is for the same button, when clicked, to open another page in a new tab. Any assistance would be greatly appreciated. Below is the HTML code I am currently using: < ...

"Drag and drop elements that automatically snap to a grid and move with

I'm trying to create a small, square div that follows the mouse cursor, but I want it to snap to a 3x3 pixel grid. Here is what I have so far: $(document).mousemove(function(e) { window.x = e.pageX; window.y = e.pageY; if(window.x % 9 === 0 ){ ...

Creating an Angular Material card that maximizes vertical space and allows its content to scroll effortlessly

My challenge is creating a material card (mat-card) that occupies all available space on the screen, with scrollable content inside (mat-card-content) because the items within exceed the available space. I attempted to address this issue using the CSS cod ...

What is the method for designing a CSS rule that solely activates when the body/html direction is set to "rtl"?

Our website is available in English at https://www.example.com. We have recently started using the GTranslate service to generate an Arabic version of the site at https://www.example.com/ar/. Upon reviewing the Arabic version, we noticed that GTranslate a ...

Using regular expressions in JavaScript, how can one extract the content along with the HTML tags from within the tags?

Below is the text to be analyzed: how much production in batu The text is displayed with HTML tags where each word is wrapped in a span with a specific style or class. For example: '<span style="">how &nbsp;</span><span style ...

Enhancing React components with dynamic background colors for unique elements

I am encountering an issue while using a map in my code. Specifically, I want to set the background of a particular element within the map. The element I am referring to is "item .title". I aim for this element to have a background color like this: https:/ ...

Is there a way to adjust the margin for a child DIV element using CSS?

Currently, I am working on my website located at www.buildinghunter.com. On the homepage, there are four div elements positioned in the bottom left corner of the page. I am attempting to align two specific divs (id=text-9 and id=text-10) with the other tw ...

JavaScript onClick event not triggering confirmation prompt

I've added an onClick event called goconfirm to a hyperlink as shown below: <a href="http://google.com" onclick="goConfirm('This link is to an external site. You are now leaving mysite.,'href=http://google.com');' target="_bla ...

Gather various input files to attach to FormData

Imagine having a scenario where you have the following form. <form id="testForm"> <input type="file" name="uploads[]"><br/> <input type="file" name="uploads[]"><br/> <input type="file" name="uploads[]"><br/> ...

Go through each row in a table and retrieve the value of a column only if the checkbox

Is there a way to extract only the values in the serial column if the checkbox is checked for that row using jquery? I am currently able to retrieve the serial value, but unsure how to incorporate the checkbox condition. HTML: <table id="usersTable"&g ...

Retrieve unique elements from an array obtained from a web API using angular brackets

I've developed a web application using .NET Core 3.1 that interacts with a JSON API, returning data in the format shown below: [ { "partner": "Santander", "tradeDate": "2020-05-23T10:03:12", "isin": "DOL110", "type ...

When you click on the column header to sort, the corresponding column row changes color in JavaScript

https://i.sstatic.net/4ELuv.jpg When a user clicks on a column to sort, the color of the column changes or highlights the row. In my tablesorter with ascending and descending sorting capabilities, I want the sorted column to change colors for better visib ...

What is the best combination of tools to use for web development: express with jade/ejs, along with html5, css

As I delve into learning node.js/express, a question arises about how jade/ejs, html, and css work in harmony. Allow me to share my understanding: The application logic is implemented in node.js/express A portion of this logic/variables is injected into ...

How to create interactive SVG animations on hover

Currently, I have successfully animated an SVG file using the default svg functions like the following: <animateTransform attributeType="xml" attributeName="transform" type="rotate" from="0 16 30" ...