Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS is there another way Re: is there another way

#77754
Makeshift
Member

you can fix this using jQuery by putting an inline level element like a span within a block level element like a div or h2.

Html:

Code:

aurel

CSS:

Code:
h2 { padding: 60px; height: 114px; }

jQuery:

Code:
$(function(){
$(‘h2’).each(function(){
$(this).width($(‘span’, this).width())+120; //add paddingx2
});
});