• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need help with CSS

#8
Try this:

PHP Code:
<?php
declare(strict_types=1);
error_reporting(-1);
ini_set('display_errors''1');

//=====================================================
function fred($val) {
  echo '<hr><pre>' ,print_r($valTRUE) ,'</pre></hr>';
}

echo 
$hdr = <<< ____EOT
<!doctype html><html lang="en"><head><title> title </title>
<style>

li   {
  display: inline-block; 
  margin:  0.42em 0 ;
  padding: 0.24em 1.0em;
  background-color: lime;
}

li a {
  background-color: lightgray;
  padding: 0.12em 1.0em 0.12em 0;
  text-decoration: none;
  border-radius: 0.88em;
}
li a:hover {
  background-color: crimson;
  color: snow;
  text-decoration: underline;
}

.bd1 {border: solid 1px #ccc;}
.bga {background-color: aqua;}
.dib {display: inline-block}
.mga {margin: 0 auto;}  
.w88 {width: 88%; }
</style>
</head><body>
____EOT;

$cat = [
[
  'sub1' => 'item1',
  'sub2' => 'item2',
  'sub3' => 'item3',
  'sub4' => 'item4',
],
$cat2 = [
  'sub1' => 'item1',
  'sub2' => 'item2',
  'sub3' => 'item3',
  'sub4' => 'item4',
]
];

fred($cat);

echo 
'<dl class="w88 XXXmga dib bd1 bga">';

  echo '<dt> array ==> $cat1 </b></dt>';

  echo '<dd>';
    foreach($cat as $id => $items) :
      echo '<ul>';
        foreach($items as $id2 => $item) :
          echo '<li>' 
              .   $id2 
              
'<br>' 
              .   '<a href="#' .$id2 .'">' .$items[$id2] .'</a>'
              .'</li>';
        endforeach;  
      
echo '</ul>';
    endforeach;
  echo '</dd>';  

echo '</dl></body></html>'
[Image: screenshot-2019-10-10-11-44-13.png]
Reply


Messages In This Thread
Need help with CSS - by lulab - 10-06-2019, 02:26 AM
RE: Need help with CSS - by John_Betong - 10-07-2019, 01:05 AM
RE: Need help with CSS - by lulab - 10-07-2019, 10:05 AM
RE: Need help with CSS - by jreklund - 10-07-2019, 12:09 PM
RE: Need help with CSS - by lulab - 10-08-2019, 01:38 PM
RE: Need help with CSS - by Wouter60 - 10-09-2019, 10:20 AM
RE: Need help with CSS - by lulab - 10-09-2019, 01:37 PM
RE: Need help with CSS - by John_Betong - 10-09-2019, 09:53 PM
RE: Need help with CSS - by lulab - 10-10-2019, 12:46 AM
RE: Need help with CSS - by lulab - 10-10-2019, 02:10 PM
RE: Need help with CSS - by John_Betong - 10-10-2019, 03:00 PM
RE: Need help with CSS - by lulab - 10-11-2019, 03:46 PM
RE: Need help with CSS - by John_Betong - 10-11-2019, 07:36 PM
RE: Need help with CSS - by lulab - 10-12-2019, 01:53 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.