Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6746519
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:19:56+00:00 2026-05-26T12:19:56+00:00

I have a HTML code like this: <pre><div class=post style=border-width:1px;border-style:solid> <div class=userpic style=width:70px;float:left> <img

  • 0

I have a HTML code like this:

<pre><div class="post" style="border-width:1px;border-style:solid">
 <div class="userpic" style="width:70px;float:left">
  <img src="XXX"><br>some text
 </div><!-- /userpic -->
 <span class="text"><h4>I'm a heading</h4>Just a few words.</span>
</div><!-- /post --> </pre>

Sometimes the picure loaded in the userpic-div is higher than the text in the text-span. The post-div, however, stays as high as the text in it is. Now I want it to be at least as high as the userpic-div. I tried to do that with jQuery, here is what I thought:

$(document).ready(function() {
   var elements = $('.post');
    elements.each(function(){
    userpic = $(this).children('.userpic');

        if($(this).height() < userpic.height()){
        $(this).height() = userpic.height();
            }
    });

 });

I get no Error (in Chrome) but it doesn’t work.

What have I done wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T12:19:57+00:00Added an answer on May 26, 2026 at 12:19 pm

    You have floated content which pulls it out of the flow. You need to clear the float to resume normal content flow. Try adding <br style="clear: both" /> to your code, just after the more text.

    <pre><div class="post" style="border-width:1px;border-style:solid">
     <div class="userpic" style="width:70px;float:left">
      <img src="XXX"><br>some text
     </div><!-- /userpic -->
     <span class="text"><h4>I'm a heading</h4>Just a few words.</span>
     <br style="clear: both;" />
    </div><!-- /post --> </pre>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say I have jquery code like this: html += '<div class=index>' + item.index +
i have html code block like this <div id=some-div> <a href=# class=link-click>some link text</a>
I have HTML code like this: <div id=paragraph> <pre> <p>First Line in the paragraph
Hello i have an HTML Code like this <div id=top> <div class=panel> <h1>toppanel</h1> <p>Content
I have HTML code like this : <div> <a>Link A1</a> <a>Link A2</a> <a>Link A3</a>
I have html code like this <tr class=odd> <td><b>Reason for Termination:</b></td> <td>this has bunch
I have html code that looks roughly like this: <div id=id1> <div id=id2> <p>some
I have the following HTML / CSS: <table> <tr> <td> <div> <pre> <code> This
I have html like this: <div> <span style=display: inline-block;height:20px>20</span> <span style=display: inline-block;><img src=img/ex.png/></span> </div>
I have code like this: string uriString = @C:\Temp\test.html; Uri uri = new Uri(uriString);

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.