28220 sujets

CSS et mise en forme, CSS3

Bonjour,

Dans une stylesheet j'ai :

#content {
	padding: 0;
	clear: both;
}

#container {
...
}

table.calendar {border: 0; font-family: "Trebuchet MS", "Courier New", Courier, monospace;}
table.calendar td, th {text-align: center; border: 0}
table.calendar th {height: 10px; font-size: 9pt; background-color: rgb(255, 255, 0);}
table.calendar td {width: 24px; height: 12px; font-size: 9pt; background-color: rgb(255, 255, 210);}
table.calendar .calendar-month {font-weight: bold; margin-top: 3px; font-size: 12pt; text-align: center}
table.calendar .calendar-month a {text-decoration: none}
table.calendar .calendar-prev, table.calendar .calendar-next {font-weight: normal;}
table.calendar th {color: green; text-align: center;}
table.calendar td.linked-day {font-size: 9pt; background-color: rgb(255, 255, 160);}

table.prevnext {width: 100%; margin-top: .3em;}
table.prevnext td {
	font-size: smaller;
}
table.prevnext td a {text-decoration: none}


Je génére en PHP un tableau avec la class 'calendar' qui se trouve (le tableau) dans mon div #content qui lui même se trouve dans mon div #container.

Mais ma class 'calendar' ne s'applique pas à mon tableau Smiley sweatdrop

Comment faire...
Merci de votre aide...
Salut,

Test :
#content table.calendar

Sinon, un exemple en ligne ça serait pas mal pour qu'on se rende mieux compte et qu'on puisse tester plus facilement Smiley cligne
Merci pour cette réponse très rapide Smiley smile
Pour l'instant je suis encore en local !

Le #content, je dois le mettre partout !

#content table.calendar #content .calendar-prev, #content table.calendar #content .calendar-next {font-weight: normal;}


ou seulement au début ?
Je vous joins la partie PHP avec les Class CSS pour les TABLE car cela ne fonctionne toujours pas ! Comment faire pour que ma class 'calendar' soit prise en compte dans mon DIV #content ?

Si quelqu'un peut m'aider !

function generate_calendar($year, $month, $days = array(), $day_name_length = 3, $month_href = NULL, $first_day = 0, $pn = array()){
    $first_of_month = gmmktime(0,0,0,$month,1,$year);

    $day_names = array(); 
    for($n=0,$t=(3+$first_day)*86400; $n<7; $n++,$t+=86400) 
        $day_names[$n] = ucfirst(gmstrftime('%A',$t)); 

    list($month, $year, $month_name, $weekday) = explode(',',gmstrftime('%m,%Y,%m,%w',$first_of_month)); 
    $weekday = ($weekday + 7 - $first_day) % 7; 
    $title   = htmlentities(ucfirst($month_name)).' / '.$year;  

    @list($p, $pl) = each($pn); @list($n, $nl) = each($pn); 
    if($p) $p = '<span class="calendar-prev">'.($pl ? '<a href="'.htmlspecialchars($pl).'">'.$p.'</a>' : $p).'</span> ';
    if($n) $n = ' <span class="calendar-next">'.($nl ? '<a href="'.htmlspecialchars($nl).'">'.$n.'</a>' : $n).'</span>';
    $calendar = '<table class="calendar">'."\n".
        '<caption class="calendar-month">'.$p.($month_href ? '<a href="'.htmlspecialchars($month_href).'">'.$title.'</a>' : $title).$n."</caption>\n<tr>";

    if($day_name_length){ 
        foreach($day_names as $d)
            $calendar .= '<th abbr="'.htmlentities($d).'">'.htmlentities($day_name_length < 4 ? substr($d,0,$day_name_length) : $d).'</th>';
        $calendar .= "</tr>\n<tr>";
    }

    if($weekday > 0) $calendar .= '<td colspan="'.$weekday.'"> </td>'; 
    for($day=1,$days_in_month=gmdate('t',$first_of_month); $day<=$days_in_month; $day++,$weekday++){
        if($weekday == 7){
            $weekday   = 0; 
            $calendar .= "</tr>\n<tr>";
        }
        if(isset($days[$day]) and is_array($days[$day])){
            @list($link, $classes, $content) = $days[$day];
            if(is_null($content))  $content  = $day;
            $calendar .= '<td'.($classes ? ' class="'.htmlspecialchars($classes).'">' : '>').
                ($link ? '<a href="'.htmlspecialchars($link).'">'.$content.'' : $content).'</td>';
        }
        else $calendar .= "<td>$day</td>";
    }
    if($weekday != 7) $calendar .= '<td colspan="'.(7-$weekday).'"> </td>'; 

    return $calendar."</tr>\n</table>\n"; }