CSS Validation issue

jlcpcnc

Baseband Member
Messages
28
Location
United States
PHP:
ul#navigation li {
      display:inline;
      float:left; 
      width:102px;   
      }
      ul#navigation li a {
      display: block;
      float:left;
          color:#000000;
      margin-top: -2px;
      height: 25px;
      width:100px;
      background-repeat:no-repeat;
      background-position:50% 10px;
      background-color:#E7F2F9;
      border:0 solid #BDDCEF;
      -moz-border-radius:0px 0px 10px 10px;
      -webkit-border-bottom-right-radius: 10px;
      -webkit-border-bottom-left-radius: 10px;
      -khtml-border-bottom-right-radius: 10px;
      -khtml-border-bottom-left-radius: 10px;
      text-decoration:none;
      text-align:center;
      padding-top:80px;
      opacity: 0.7;
      filter:progid:DXImageTransform.Microsoft.Alpha(opacity=70);  
    }

I need this to validate and yet keep the information because it allows my navigation bar to function.

Take a look - J & L Custom PC, Bryson City Computer Repair

If I use W3C valid code for this it removes all the styling from the css and leaves me with a crippled navigation bar.

Any advice?
 
Need to be able to right click and view source. Right now you have some browser trick disabling the right click menu.
 
I am going to preface my whole answer with the simple fact that I know very little about PHP Code; what I know of, I have placed together here for your assistance.

Code:
ul#navigation li a { background-color:#E7F2F9;background-repeat:no-repeat;background-position:50% 10px;border:0px solid #BDDCEF;color:#000000;display:block;float:left;height:25px;margin-top:-2px;opacity:0.7;padding-top:80px;text-align:center;text-decoration:none;width:100px; }

<?php
if (substr_count($_SERVER['HTTP_USER_AGENT'], 'W3C') == 0)
    echo "ul#navigation li a { filter:progid:DXImageTransform.Microsoft.Alpha(opacity=70);-khtml-border-bottom-left-radius:10px;-khtml-border-bottom-right-radius:10px;-moz-border-radius:0px 0px 10px 10px;-webkit-border-bottom-left-radius:10px;-webkit-border-bottom-right-radius:10px; }";
?>

The purpose of the extra code is in order to get your Page to check whether the Server request is from the W3C Validator (any version: because the CSS Validator gives a different User Agent String) and if it is then to not display the code which will not validate. It is best, of course, to package this all up into one extra class rather than stick it in the middle of your current class otherwise somebody, somewhere will forget a parenthesis and everything will fall apart.

I cannot stand for the Code itself, but I have done this before in C# and it works perfectly (at the time it was for Facebook OpenGraph Tags, which the W3C Validator does not approve of.

In the end, however, using these kinds of CSS Tags is simply not Cricket, and massively degrading to us all. The purpose of fixing it now, and replying to this Thread is in order than you can get it working now quickly, running Validated and Approved and I recommend the time I saved you trying to fix this problem will be spent making your Navigation Bar work with HTML 5 and CSS 3.
 
Back
Top Bottom