Jump to content

Recommended Posts

No matter what i do i cant get my icon div to be the same height as the rest of the divs in the row.

 

My code is:

 

<div class="forum_row">
<div class="icon">
<p class="icon">
SOME TEXT
</p>
</div>

 

and my css is:

 

div.forum_row {
width: 99.3%;
display:inline-block;
height:auto;
}

div.icon {
width:4%;
height:inherit;
float:left;
margin-top:5px;
margin-right: 5px;
border:1px solid #888;
background: #b0bde2;
-moz-border-radius-topleft:5px;
-moz-border-radius-topright:5px;
-webkit-border-top-left-radius:5px;
-webkit-border-top-right-radius:5px;
-moz-border-radius-bottomleft:5px;
-moz-border-radius-bottomright:5px;
-webkit-border-bottom-left-radius:5px;
-webkit-border-bottom-right-radius:5px;
}

p.icon {
height:100%;
}

 

but the icon div is never the full height of the forum row. In needs to be as there are other divs inside forum_row div which are variable in height and can push the forum div beyond its normal height. So i need the icon div to go with it.

 

Any ideas?

Link to comment
https://forums.phpfreaks.com/topic/219579-div-height/
Share on other sites

I wouldn't personally go for equal heights, with variable width columns. Its plain nasty with CSS and divisions alone, and way more complicated, then just throwing in a table and be done with it. Nevertheless, you may want to read: Equal Height Columns

 

Avoid using fancy stuff like display:inline-block; I've experimented a lot with the display property, with my early layouts. It rarely works as you intend, and the rules are sometimes a bit to exotic. May be better with IE8, but then you might be looking for display:table; or something like that.

 

I'd much rather use a hack currently, but i haven't really worked with that type of layout for some time. I tend to work around stuff, until i got a real reliable approach.

 

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/219579-div-height/#findComment-1140531
Share on other sites

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.