tags:

views:

49

answers:

2

Here is what I am working on..

http://jsfiddle.net/yfcZN/

what I want is padding of text that is inside of the "P" tag like we do cell padding in "TD" tag

I changed this code line :

text.css({ position: 'absolute', top: '57px' }).hide();

to this:-

text.css({ position: 'absolute', top: '57px', paddingTop: 10px}).hide();

but it's not making no difference..what property is there to achieve what I want ? I only found this "padding" one

[EDIT] thnx all..didn't give single quotes..silly mistake...Could someone please check Mark's comment and my response to it and tell me how can I fix it ?

+1  A: 

Here, this seems to work: http://jsfiddle.net/yfcZN/4/.

Kyle Sevenoaks
+1  A: 

Answer to second question: Change var box = $(this); to var box = $('h2',this);.

Litso
This isn't really working coz as soon as a move my mouse over the text in the text bow that appears, it slides up again..earlier it would stay in place..actually I will be adding links and button inside this text box later so need it to stay..erm..hope its not confusing...but srsly what MArk pointed out IS annoying...how do I solve it ?
Serenity
ah, in that case you have to make sure the `<p>` and the `<h2>` are connected. Now the gap between them makes your mouse leave and re-enter the hover area. I'll try and find a solution, hold on
Litso
You can fix the gap by making the text div touch the h2. That way there's no gap that makes you lose focus of the hover. To keep a white area between the two divs you could use a white border of 10px (or whatever) on top of the text div. http://jsfiddle.net/yfcZN/7/
Litso
Thanks ! it works fine now :D
Serenity