tags:

views:

228

answers:

3

Hey everyone, here is the site in question:

http://www.myvintagesecret.com/

I have a bunch of posts on the front page. The header in in a H2 tag. Beside that, I will sometimes have a div called Clip. I want the title to wrap onto the next line IF there is a .clip div there.

My problem is that IF there is a .clip div AND there is a long enough title, it bumps the .clip div down. I want H3 to wrap and .clip to look like the 1st post.

    .clip {
    width:214px;
    height:275px;
    float:right;
    }

        #content h2 {
    color:#1A1A1A;
    float:left;
    font-size:20px;
    margin-left:30px;
    padding:70px 0 2px 0;
}
A: 

Try this:

#content h2 {
    color:#1A1A1A;
    float:left;
    font-size:20px;
    line-height:180%;
    margin-left:30px;
    max-width:335px;
    padding:70px 0 2px;
}
GaVrA
That works but I want the posts that do not have a .clip div to span the whole length of the post div
Wes
+1  A: 

Why don't you just remove the float:left from the h2?

Edit: and make sure that the clip appears before the h2 in the html...

jeroen
beacuse then the .clip div gets bumped to the next line regardless...
Wes
See my edit, you need to put the clip first, floated right, and the h2 next. That should do exactly what you want.
jeroen
If that dont work maybe you could try with javascript to check if there is element with class "clip" in id of "postheader" and if there is alter css of that h2 with those values i gave... :) Dunno of any other solution... I'll add this to favorites, i must see the answer for this one... ;)
GaVrA
You'll also have to remove the bottom margin from the `h2`, and the `float: left` from the `h2 a`. After that it will work.
mercator
@mercator: thanks for the comment, I didn't look at the source code of the page. Anyway, one right-floated item at the top of the section is really all that is needed. No more floats, javascript, etc.
jeroen
Amazing! Thanks a ton guys :)
Wes
A: 

The best way i can think of atm is to manually add new class to this h2 everytime when title is too long and you are using that .clip <_<

Something like this:

.fix{
    line-height:180% !important;
    width:336px !important;
}
GaVrA
Well, I am doing this dynamically with wordpress so thats not doable...
Wes