Allow duplicate definitions
Internet Explorer <= 6 does not handle box model in same way as
others browsers that are better W3C compliant. For this reason, we need
to fix boxes size with a hack such as this one you can find in example
that follow. You can notice the duplicate 'voice-family' and 'height'
properties.
To parse these definitions we need to activate the duplicate option of HTML_CSS.
-
#header {
-
background-color: ivory;
-
font-family: "Times New Roman", Times, serif;
-
font-size: 5mm;
-
text-align: center;
-
/* IE 5.5 */
-
height:81px;
-
border-top:1px solid
#000;
-
border-right:1px solid
#000;
-
border-left:1px solid
#000;
-
voice-family: "\"}\"";
-
voice-family: inherit;
-
/* IE 6 */
-
height: 99px;
-
}
There are two ways :
- global to all functions: set option allowduplicates on class constructor
- local to a function: set argument duplicates to TRUE
For example here, we could wrote either (allow global duplicate) :
-
<?php
-
require_once 'HTML/CSS.php';
-
-
$attr = array('allowduplicates' => true);
-
$css = new
HTML_CSS($attr);
-
-
$strcss = '
-
#header {
-
background-color: ivory;
-
font-family: "Times New Roman", Times,
serif;
-
font-size: 5mm;
-
text-align: center;
-
/* IE 5.5 */
-
height:81px;
-
border-top:1px solid #000;
-
border-right:1px solid #000;
-
border-left:1px solid #000;
-
voice-family: "\"}\"";
-
voice-family: inherit;
-
/* IE 6 */
-
height: 99px;
-
}
-
';
-
$css->parseString($strcss);
-
-
$css->display();
-
?>
or also (duplicate on local call) :
-
<?php
-
require_once 'HTML/CSS.php';
-
-
$css = new
HTML_CSS();
-
-
$strcss = '
-
#header {
-
background-color: ivory;
-
font-family: "Times New Roman", Times,
serif;
-
font-size: 5mm;
-
text-align: center;
-
/* IE 5.5 */
-
height:81px;
-
border-top:1px solid #000;
-
border-right:1px solid #000;
-
border-left:1px solid #000;
-
voice-family: "\"}\"";
-
voice-family: inherit;
-
/* IE 6 */
-
height: 99px;
-
}
-
';
-
$css->parseString($strcss, true);
-
-
$css->display();
-
?>