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;
    	}

 

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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