WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] IE minimum width fix -IE expressions problem? (6 posts)

  1. 21stproject
    Member
    Posted 8 years ago #

    So after investing time into finding out how to solve this problem I stumbled across a good solution, even uses em's. It works outside my blog, but for some reason it refuses to apply in my blog.

    The code (from http://www.svendtofte.com/code/max_width_in_ie/);

    p {
    border:1px solid red;
    width:expression(
    document.body.clientWidth > (500/12) *
    parseInt(document.body.currentStyle.fontSize)?
    "30em":
    "auto" );
    }

    I'm attempting to apply this to ".post p" from K's default theme (as the base theme code.)

    I even dropped the .post out, and styled all my p's this way, the IE expression doesn't execute, the css comes out, see the p’s with a red border..

    Is there something in wordpress that would prevent the expression from working? Any special places you're supposed to put it?

  2. 21stproject
    Member
    Posted 8 years ago #

    Any ideas?

    Oh and when I meant K's base theme code I didn't mean to say that I'm using the same structure.

    My blog has three columns a header and footer. Only the content in the middle is fluid.

    I tried pasting the code in different themes, nothing, the expression doesn't register

  3. 21stproject
    Member
    Posted 8 years ago #

    Sigh, I really don't want to keep bumping this, but even a solution that tells me how to execute the javascript outside the css file would be helpful. I really am cluless with this one.

    If anyone can just tell me whether wordpress would accept the javascript in the css that would be helpful. I don't know where to go from here if I'm not sure what the problem is.

  4. FireMotion
    Member
    Posted 8 years ago #

    Hmm, it's a first that I heard of this expression() thing. Anyway, this is not a specific WordPress thing, but html/css/browser issue.

    I'm assuming you're putting the p { something } code in your css file. Try putting it in your template's header (try putting it in header.php):
    <style>
    p { your code }
    </style>

    I hope this helps, and good luck with it.

  5. 21stproject
    Member
    Posted 8 years ago #

    I did try that, I was sure I mentioned it when posting here but I didn't I guess, putting it in the header does nothing.

    Still get the red border and nothing else.

    Works everywhere but in my blog.

    The issue is driving me insane

  6. 21stproject
    Member
    Posted 8 years ago #

    I finally figured out what was wrong, the width was wrong and that's why it looked like nothing was going on.

    It works now. Happiness.

    Unfortunately the javascript renders my css invalid.

    It works if you place it in the css file or the header, but in either case the css file is just not good enough for W3C.

    The joy. The heartache.

Topic Closed

This topic has been closed to new replies.

About this Topic