Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Senior Coder
    Join Date
    Nov 2010
    Posts
    1,383
    Thanks
    264
    Thanked 32 Times in 31 Posts

    applying the if IE conditional statement

    Hi i have a problem where FF displays different on doing padding than does IE so i think i need to do the if IE statement.

    I the past i have used the if ie inside of the head before on a html, file but this is going inside a php file.



    Code:
      <!-- for ie this works -->
     <td width="150px" style="padding:30px 0px 0px 30px;">
    
      <!-- for FF this works -->
    
    <td width="150px" style="padding:20px 0px 0px 20px;">
    
    <!-- and so i need to apply this but not sure of the proper placement, 
    do i just put it as is anywhere in the html or does it need to go inside 
    a style anchor or do i need to wrap a style with this.  Just not sure.  -->
    
    <!--[if IE]>
    
    <![endif]-->

    thanks


    i just tried this no good, the content is all over the place lol


    Code:
            <!--[if IE]>
                 <td width="150px" style="padding:30px 0px 0px 30px;">
               <![endif]-->
    
               <!--[if !IE]>
                 <td width="150px" style="padding:20px 0px 0px 20px;">
               <![endif]-->
    Last edited by durangod; 12-11-2012 at 02:53 PM.

  • #2
    Senior Coder
    Join Date
    Nov 2010
    Posts
    1,383
    Thanks
    264
    Thanked 32 Times in 31 Posts
    Got it whoo hooo my if IE was ok, but my IF NOT above was all wrong in syntax. Had no idea has to add the extra wrapping there.
    This below works..

    Code:
               <!--[if IE]>
                 <td width="150px" style="padding:30px 0px 0px 30px;">
                <![endif]-->
    
                <!--[if !IE]> -->
                <td width="150px" style="padding:20px 0px 0px 20px;">                 
                <!-- <![endif]-->

  • #3
    Senior Coder
    Join Date
    Aug 2006
    Posts
    1,267
    Thanks
    10
    Thanked 277 Times in 276 Posts
    Aside from the IE thing, deprecated stuff, ec, this code:
    Code:
    width="150px"
    isn't correct. The correct syntax is:
    Code:
    width="150"
    Dave

  • Users who have thanked tracknut for this post:

    durangod (12-11-2012)

  • #4
    Senior Coder
    Join Date
    Nov 2010
    Posts
    1,383
    Thanks
    264
    Thanked 32 Times in 31 Posts
    oops my bad thanks, old habbits die hard lol..

  • #5
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,640
    Thanks
    0
    Thanked 649 Times in 639 Posts
    IE uses the same padding as all the other browsers when in standards mode - so if it is not then you either don't have a doctype or IE isn't recognising it properly. No browser specific coding is ever required for padding when your page is correctly coded.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •