This is not the first time that I am entering into this problem and I do not have a chance to do something right.
Here's the problem:
I have 2 divisions, each of them has a title. Depending on the length of the title, the headline may have to fit on 2 lines or not, all this is generated by a CMS, so there is no way of telling that one of them will have 2 lines or one at a time ( So I can not separate them with one class if they have 1 line or 2)
Here is a juicy part: I want the titles in those two divisions to stand. The height of the line will not do this because there is always the possibility of being at 1 or 2 rows, and the display: Table-cell + vertical-align: Medium is not compatible with IE7.
The way to create those titles and will it work in every browser?
Edit: There is a picture of this situation that I try to explain:
Edit # 2: Here's a code sample to make my example. We want to focus them both.
Edit # 3:
After the reply to Mikhailwei, I came up with this code, which works.
$ (document). Ready (work () ($ ("container-div"). (Function () {$ (this). Child ('div'). CSS ('top', string ($ (this). Height () height () / 2) + 'PX')}}}}
(window); var div1 = $ ('# Div1 '); div1.css (' top ', string (w.height () / 2 - div1.height () / 2) +' px ')}}
Div> div1 "onload =" div1onload callback () "& gt; & lt; / div & gt;
For the broader, like other divas, you will need to modify the CSS status attribute for the title (such as status: full ) to work.
Comments
Post a Comment