Go Back   Computer Forums > Web Design | Website Development > Web Programming
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 03-05-2012, 04:56 AM   #1
Baseband Member
 
Join Date: Feb 2012
Location: United States
Posts: 28
Default CSS Validation issue

PHP Code:
ul#navigation li {
      
display:inline;
      
float:left
      
width:102px;   
      }
      
ul#navigation li a {
      
displayblock;
      
float:left;
          
color:#000000;
      
margin-top: -2px;
      
height25px;
      
width:100px;
      
background-repeat:no-repeat;
      
background-position:5010px;
      
background-color:#E7F2F9;
      
border:0 solid #BDDCEF;
      
-moz-border-radius:0px 0px 10px 10px;
      -
webkit-border-bottom-right-radius10px;
      -
webkit-border-bottom-left-radius10px;
      -
khtml-border-bottom-right-radius10px;
      -
khtml-border-bottom-left-radius10px;
      
text-decoration:none;
      
text-align:center;
      
padding-top:80px;
      
opacity0.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?
__________________

jlcpcnc is offline   Reply With Quote
Old 03-08-2012, 03:35 AM   #2
Golden Master
 
setishock's Avatar
 
Join Date: Feb 2005
Location: Setitopia: World's largest open air insane asylum
Posts: 8,981
Default Re: CSS Validation issue

Need to be able to right click and view source. Right now you have some browser trick disabling the right click menu.
__________________

__________________
]
setishock is offline   Reply With Quote
Old 03-08-2012, 06:33 AM   #3
Baseband Member
 
Join Date: Feb 2012
Location: United States
Posts: 28
Default Re: CSS Validation issue

i copied an pasted the source in the OP that is the CSS I am trying to validate.
jlcpcnc is offline   Reply With Quote
Old 03-08-2012, 09:11 AM   #4
Guru
 
Lord Kalthorn's Avatar
 
Join Date: Dec 2003
Location: Britain
Posts: 13,296
Send a message via MSN to Lord Kalthorn
Default Re: CSS Validation issue

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.
__________________
A Knight is sworn to Honour. His heart knows only Virtue. His blade defends the helpless. His might upholds the Weak. His word speaks only truth. His wrath undoes the Wicked.
Lord Kalthorn is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -5. The time now is 11:10 PM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0