The main DIV is not adjusting to accommodate all the content within it

Although this question may have been raised countless times, I have not been able to find a satisfactory answer despite searching through numerous posts.

Below is the code snippet in question:

.feedCard {
  display: block;
  margin-left: 227px;
  margin-top: 17px;
  width: 78%;
  height: 100%;
  min-height: 115px;
}
.facebookPost {
  display: block;
  width: 100%;
  height: 25px;
  background-color: #3b5998;
  text-align: left;
  padding-top: 5px;
}
.postContent {
  display: block;
  height: 100%;
}
.postLabel {
  color: #FFF;
  margin-left: 8px;
}
.postLabel a {
  color: #FFF;
  text-decoration: none;
}
.postStamp {
  color: #FFF;
  margin-right: 8px;
  float: right;
}
.postTextHolder {
  width: 100%;
  height: 100%;
  margin-top: 11px;
}
.postText {
  margin-top: 10px;
  margin-left: 5px;
}
.feedPostUserIcon {
  width: 75px;
  height: 75px;
  float: left;
  margin-left: 5px;
  margin-top: 0px;
}
<div class="feedCard">
  <div class="facebookPost">
    <span title="view on facebook" class="postLabel"><a href="facebook.com">facebook</a></span>
    <span class="postStamp">Posted at 11:42 AM on 1/18/17</span>

    <div class="postContent">
      <div class="postTextHolder">
        <img class="feedPostUserIcon" src="images/image.png">
        <span class="postText">filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler </span>
      </div>
    </div>
  </div>
</div>

The main DIV is stuck at its minimum height and does not expand to accommodate additional text.

On a related note: Is there a way to improve the appearance of wrapped text? It appears too close to the image and looks unattractive. Any suggestions would be welcomed.

Answer №1

At times, I find myself filled with self-loathing.

I mistakenly placed the "post content" DIV inside the "facebook post" DIV when it should have been positioned below.

Below is the corrected code for your reference:

            <div class="feedCard">
                <div class="facebookPost">
                    <span title="view on facebook" class="postLabel"><a href="facebook.com">facebook</a></span>
                    <span class="postStamp">Posted at 11:42 AM on 1/18/17</span>
                </div>
                <div class="postContent">
                    <div class="postTextHolder">
                        <img class="feedPostUserIcon" src="images/image.png">
                        <span class="postText"> ... </span>
                    </div>
                </div>
            </div>

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

Display a <div> based on the database query for the portal field

I am new to JavaScript and have been successfully using the code below with a checkbox. function showAddress() { var objectAddress = document.getElementById("objektadresse"); var addressToShow = document.getElementById("adresseeinblenden"); addr ...

How to utilize jQuery to highlight active anchor tag in an ASP.NET environment

I am attempting to modify the color of a list item when an anchor tag is clicked using jQuery. When I call a C# function from the code-behind on clicking the anchor tag, if I include "return false" in the jQuery code as shown below, the color changes but t ...

Issue with Bootstrap checkbox buttons not rendering properly

I'm attempting to utilize the checkbox button feature outlined on the bootstrap webpage here in the "checkbox" subsection. I copied and pasted the html code (displayed below) from that page into a jsfiddle, and checkboxes are unexpectedly appearing in ...

Ways to ensure that the height of a div remains consistent across all scenarios

https://i.sstatic.net/6LY1C.png Below is the code snippet, which utilizes bootstrap. I need to set a fixed height for a div that is populated dynamically from a database. The goal is to maintain the height of the div regardless of the content length. If ...

Learn the trick to making specific words appear bold in Select2 by changing the font style

I'm currently working with select2 version 4.0.1, and I have a requirement to modify the font for specific words. In particular, I want to display codes AK and HI in a different/bolder font style, similar to the example below: <select id="select2" ...

Finding out which element is currently in focus in Internet Explorer 11 requires a few simple steps

Is there a way to determine which element is going to receive focus when the focusout event is triggered in Chrome and IE 6-10, or when the blur event is triggered in Firefox? $(input).focusout(function (event) { "use strict"; cons ...

Floating container leads to delays

My goal is to create a div that changes when I hover over it. However, when I move my mouse into the div, there seems to be some lagging and the content does not appear clearly. Below is the HTML and CSS code I have used: .unshow-txt:hover, .unshow-txt: ...

Customizable page layout with fixed width that adjusts based on content

I am looking to enhance the design of my website by updating its template. I want the content to be displayed within a fixed width centered div. While there are plenty of examples on the web for this, I want to ensure that existing text and tables in my ...

Is it possible to nest Twig variables within other Twig variables?

While developing a website for a reggae backing band, I encountered an issue on the 'booking' page where I have a form. Upon submitting the form, I conduct checks to ensure all required fields are filled in and to verify if any errors occurred. ...

Experiencing Problems with Firefox Height?

Check out my current project on Codepen - it's a clock: http://codepen.io/www139/pen/MaxGyW Here's what it's supposed to look like: https://i.sstatic.net/tOMKh.png If you're using FireFox, you might notice that it looks different comp ...

Tips for organizing ng-repeat information according to a condition of true or false

Apologies if this question has already been addressed, but I have not been able to find a solution. I am attempting to organize an ng-repeat based on the selection of radio buttons, but I am struggling with hiding and showing items within the ng-repeat. ...

Is it possible to utilize HTML as a platform for interfacing with a C/C++ program?

As I work on a new product with USB interface, I need to create a control app for it. However, my GUI programming skills are limited, so I have thought of using a local web page within the app's installation directory as the interface for the program. ...

Updating Tailwind CSS to accommodate older web browsers by converting modern rgba() notation to be browser-compatible

I am facing a challenge with Tailwind CSS v3+ as it builds colors into the rgb space/color notation that is not compatible with an older browser (Safari 11) that my web app now needs to support. For example, rgb(163 160 158 / var(--tw-bg-opacity) The iss ...

navigating to the start of a hyperlink

I'm having issues with scrolling to anchors and encountering 3 specific problems: If I hover over two panels and click a link to one of them, nothing happens. When I'm on section D and click on section C, it scrolls to the end of section C. ...

What is the best way to design a multi-submit form without the need for page refreshing?

I am interested in creating a form with multiple questions where users can click "next" for each question without the page reloading. For instance Click on "Begin" On this page, there is no reload when choosing a radio option and clicking "next". How ca ...

Transforming brand logos through hover on image maps

Despite finding numerous posts addressing this issue, I am still encountering problems with my code: <div id="product_tabs_description_tabbed_contents" style="display: block;"><img style="margin-left: -10px; opacity: 1 !important;" src="{{media u ...

Presenting tailored information within a structured chart

Working on my angular project, I have a table filled with data retrieved from an API. The table includes a status column with three possible values: 1- Open, 2- Released, 3- Rejected. Current display implemented with the code snippet <td>{{working_pe ...

Issues with the loading and display of Bootstrap Carousels

Hey there! I'm facing an issue with implementing a Bootstrap carousel on my website. Despite trying out several examples from Bootsnip and even the one from the official Bootstrap website, the carousel slides are not working as expected. Any ideas on ...

The div is not completely encased by the fieldset

I have utilized fieldset to generate a titled border around a div. Here is the code snippet: <div class="form-group col-xs-12"> <fieldset class="field_set col-xs-12"> <legend style="font-weight:bold;font-size:20px"> ...

What is the meaning of a "hook" in the world of HTML?

During a recent interview, a developer asked me about the "hooks" Angular uses with HTML. I admitted that I was not familiar with the term "hook," despite my extensive experience in web development over the past two decades. While I have some ideas of what ...