Jump to content

Recommended Posts

Hi,

I have one one span with id="imgPart" and div with id="infoPart".

I am using span to show img and div to display text,

If info is more (height is more than img height) page looking good but if text is short than other divs are coming up with img level.

 

I would love to adjust the height of div with height of span(containing ) img.

 

thx in advance

 

Link to comment
https://forums.phpfreaks.com/topic/267043-span-n-div-height-prob/
Share on other sites

spans are inline elements, meaning they do not obey the box model  IMO you have things backwards and you should be using the span for the text  either way, you can force a span to follow the box model and accept sizing properties by setting its display to block

thx for ur reply

 

My code is

 


<h4 class="blogTitle">

<span style="float: right; width:auto;height:auto;">7</span>

<a href="blogPage.php?srNo='.$row['srNo'].'">Title</a>

</h4>

<div id="blogBody">

<span style="float: left; padding:0px 10px 5px 0px;"><img src="C:\Users\Desktop\New folder\img\2.jpg"/></span>

<div id="blogText">This is info</div>

</div>

<div id="jump-link"><a href="blogPage.php?srNo='.$row['srNo'].'"> See more...</a></div>

<div id="blogFooter">

<div id="blogFooterLine1">

<span class="postAuthor">POSTED BY:</span>

</div>

</div>


 

In above code i wanted to display img and div "blogText" side by side and div "jump-link" should be below img but i am case everything is right hand side of img

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.