Jump to content

increase padding by 5 every 30 charactures ?


ricky spires

Recommended Posts

hello.

 

i would like to increase css padding by 5px every time there is 30 charactures in the text. how can i do this ?

 

this is what i have but its not any good .

 

$length = (strlen($article->title));
$padding = 5;

    	for ( $counter = 2; $counter <= 10; $counter += 10) {
    	$amount = $padding * $counter;
    	}

 

 

I don't think it would be such a good idea, because CSS is cached and won't be changed every time they visit a page with the same CSS.

 

If you really want to do it anyways:

http://php.net/manual/en/function.strlen.php

http://php.net/manual/en/function.file-put-contents.php

ok.

 

so is there another way. i.e everytime the line of text goes on to another row increase the padding by 5px

 

Could you show us the HTML and explain exactly what you want it to do?

 

CSS shouldn't be dynamically changed depending on the content in the html page, because it's cached by the browser, but the later versions of CSS allows you to do quite a lot of stuff. You also got JavaScript.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.