Height:100% causing overflow problems;

LIVE CODE
I want the maincontent div with class="mc" to only occupy the bottom 10% of the screen. This way, users can see more of the background image while still being able to read the article title.

To achieve this, I set the height of .mc to 100% and positioned it at the bottom of the viewport using CSS.

CSS

.mc { 
    height:100%; 
    width:100%; 
    background:#fff; 
    z-index:1; 
    position:absolute; 
    bottom:-90%;
}

However, the problem arises when the content exceeds 100% height, causing it to disappear. I attempted using min-height but it made the issue worse. Check out the LIVE CODE for a demonstration of the problem.

or

Error message (you can see the cutoff point from the box-shadow();)


Desired Look

HTML

<article class="mc">
<section class="cc">
    <div class="margin_wrapper">
        <header>
            <hgroup>
                <h1 class="at">rocking grass out styles for everyone.</h1>
                <h2 class="ast">The you mice structure for to of almost ability an trying the when designer
                    dissolute that constructing in quickly distinct...</h2>
            </hgroup>
        </header>
        <h3 class="title_header">the good</h3>
        <p>...</p>
        <h3 class="title_header">the bad</h3>
        <p>...</p>
        <h3 class="title_header">the ugly</h3>
        <p>...</p>
    </div>
</section>
<aside></aside>

Answer №1

To position the text container below the image, you can utilize a negative top margin or combine it with position: relative for optimal positioning:

margin-top: -10%;

Alternatively, you can use:

position: relative;
top: -10%;

This approach will create a space below the content equal to the repositioned amount.

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

Steps for implementing a custom markup trigger with prettyPhoto:

Recently, I encountered an issue with my table view: https://i.sstatic.net/Fji2F.png Upon clicking the td, it should open the PrettyPhoto Lightbox In the default PrettyPhoto setup, the html trigger looks like this: <a href="images/fullscreen/2.jpg" ...

Design an unordered list containing a text input field and a clickable button

I need assistance with creating a feature where text input is converted into a list when a button is clicked. Here's what I currently have: <!doctype html> <html> <head> <meta charset="UTF-8"> <title>3-2</title> & ...

Utilizing version 4 of Bootstrap to create a visually appealing full

I am currently using the latest version of bootstrap, but I have encountered an issue with my sidebar being too short and not reaching full height. You can view the problem here: Is this problem caused by my CSS or is it a bootstrap issue? And how can ...

PHP Implementing real-time dynamic categories

I am working on a project where there are multiple items listed with unique IDs. Each item has corresponding data with the same ID. I want to use JQuery, JScript, and PHP to display options based on the ID of the selected item in real-time. Below is a snip ...

Can the sidebar be positioned after the div on an HTML page?

Is it possible for the sidebar to remain static until it is reached by scrolling on the page? I want it to be positioned below the Jumbotron and then stick to the left and top when scrolling down. Currently, it's overlapping everything and adjusting z ...

Steps for arranging text in a dropdown list option

How can I format 3 words in a dropdownlist option so they are aligned properly? eg. <option value="1">ABCDE - ALPHA</option <option value="2">1234 - NUMERIC</option> <option value="3">ABC123 - ALPHANUMERIC</option> I woul ...

Adding extra space on a Bootstrap 4 flex container with full height

I need help creating a fixed div with 100% height and vertically centered alignment using Bootstrap 4. I've achieved everything except adding padding. When I try to add padding to the child div, the content overflows off the screen. I even attempted ...

Using inline SVG as a background in a select element with Firefox for custom styling

I've been working on creating a customized select tag with an inline SVG background using -webkit-appearance: none in my CSS. For reference, here is the JSFiddle link: http://jsfiddle.net/sucrenoir/yHR53/5/ select { font-size: 30px; border: ...

Continue scrolling once you reach the fixed-positioned div

live demo html <div class="one"></div> <div class="two"></div> <div class="three"></div> <div class="four"></div> css .container{ margin: 0; padding: 0; ...

Tips for maintaining row position while zooming your browser above 100% with Bootstrap

I am experiencing a small issue with the bootstrap grid system. I have set up a row with two sections using col-md-6. However, when I zoom in my browser to over 100%, the Close label and input move to the next line. I want them to stay in the same place re ...

The button is obscured by the dropdown menu

Here is the code snippet I am working with: HTML <nav class="navbar bg-dark navbar-dark"> <div class="container-fluid"> <div class="navbar-header"> <a href="#" class=&quo ...

Eliminating border styles alters the overall appearance of the page

I'm encountering an issue with my HTML/CSS code here: CSS * { padding: 0; margin: 0; border: none; outline: none; } #container { margin: 10px auto 10px auto; width: 960px; background-color: #dddddd; border: solid 1px black; } #contai ...

Resize images in PHP and MySQL with precision without distorting the image

I'm looking for a solution to resize images on upload without deforming them. The current code uploads the image and stores it in the database, but I need to add resizing functionality. I'd prefer not to use JavaScript, but if necessary, please i ...

How do I directly display a variable in index.html using node.js?

Is there a way to retrieve user inputs from the index.html file, process them in Node.js, and then display the result back on the index.html page instead of redirecting to a new page? Form Handling with Express var express = require('express'); ...

What is the process for adding unique colors to the background of a PdfPCell?

I have a snippet of iTextSharp code that sets the background of a cell in a PDF file to green: PdfPCell cellSec2 = new PdfPCell(parSectionHeading2); cellSec2.BackgroundColor = BaseColor.GREEN; The issue I am encountering is that "BaseColor.GREEN" produce ...

Position the image between two div containers in the center of the screen, ensuring it is responsive and does not overlap with any text

I've been working on trying to position an image between two divs on my webpage. So far, I've managed to place the image there but it's not responsive (only displays correctly at a width of 1920) and ends up overlapping the text in both divs ...

Insert HTML content into an iframe with a callback function

We are receiving information from the backend server and need to transfer it to an iframe. In order to accurately set the height of the iframe to match the content, we must wait for the content to be loaded into the iframe. However, this process may not ha ...

Is there a way to modify the text color in HTML and CSS without utilizing the color attribute?

For my website, I chose to use a customizable template for the navigation bar. I am looking to modify the color of the underline of the text without changing the actual text color itself. Since the underlining feature and the text need to be in the same se ...

Creating a sophisticated form design with multiple input fields using DIV elements in HTML

I am looking to create a multi-column form layout that allows each row to have a different number of fields. My initial approach was using tables and the colspan attribute within td tags for layout structure. However, I have learned that using tables for l ...

Manipulating content with JavaScript in Internet Explorer using the outerHTML property is a powerful

Encountering an Issue with outerHTML in IE Browser If I try the following: txt = "Update Complete!"; msg = sub.appendChild(d.createElement("p")); msg.outerHTML = txt; It works without any problem. However, if I use: txt = "1 Error:<ul><li> ...