Jump to content

Maths in CSS?


Aureole

Recommended Posts

Padding and margin are indeed for this BUT they don't quite work as Aureole wants them to.

 

Unfortuately you simply have to bite the bullet and if you use height 100% accept that any padding or margin will 'break' any layout where the boxes have borders and elements outside the document flow are present...

 

its rare I find a GOOD use for %height!

Link to comment
Share on other sites

  • 2 weeks later...

Yes there is a way to do it. You can use php to go into the file and edit the parameters and then send the finished text to the browser and get it all to work. This would be dificult and a waste of time.

 

As an alternative solution you can set a container div and then have multiple divs in the CSS. Then depending on the necessary parameters call a div according to that.

 

Like

<div id="container">

    <div id="<?php echo $parameterdiv; ?>">
    Content... content...
    </div>


</div>

Link to comment
Share on other sites

  • 2 weeks later...

Yes there is a way to do it. You can use php to go into the file and edit the parameters and then send the finished text to the browser and get it all to work. This would be dificult and a waste of time.

It isn't that hard to have PHP pass through a css file. The hardest thing I've found about it is finding an IDE that can different from *.php and *.css.php masks so the highlighting doesn't collide (I ended up using *.phtml for PHP/CSS files, though some hosts might not have the extension defined for PHP). The main thing to keep in mind when using PHP with CSS is to make sure the browser knows that its mimetype is CSS, by using:

header("Content-Type: text/css");

 

Of course, this won't exactly help you with your percentage dilemma. Kinda off-topic...

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.