Toon posts:

css javascript laten overrulen

Pagina: 1
Acties:

Verwijderd

Topicstarter
Ik heb in dreamweaver een calendarjavascript in een layer gezet, nu wil ik de opmaak via css aanpassen, lettertype past zich wel al aan via css maar lettergrootte niet ongeacht of ik de size op xxsmall of small zet. Hoe kan ik css laten overrulen?

<div id="Layer3" style="position:absolute; width:200px; height:115px; z-index:3; left: 84px; top: 153px;" class="datum">
<script
LANGUAGE="JavaScript" class="datum">
<!--//Begin

monthnames = new Array(
"January",
"Februrary",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December");
var linkcount=0;
function addlink(month, day, href) {
var entry = new Array(3);
entry[0] = month;
entry[1] = day;
entry[2] = href;
this[linkcount++] = entry;
}
Array.prototype.addlink = addlink;
linkdays = new Array();
monthdays = new Array(12);
monthdays[0]=31;
monthdays[1]=28;
monthdays[2]=31;
monthdays[3]=30;
monthdays[4]=31;
monthdays[5]=30;
monthdays[6]=31;
monthdays[7]=31;
monthdays[8]=30;
monthdays[9]=31;
monthdays[10]=30;
monthdays[11]=31;
todayDate=new Date();
thisday=todayDate.getDay();
thismonth=todayDate.getMonth();
thisdate=todayDate.getDate();
thisyear=todayDate.getYear();
thisyear = thisyear % 100;
thisyear = ((thisyear < 50) ? (2000 + thisyear) : (1900 + thisyear));
if (((thisyear % 4 == 0)
&& !(thisyear % 100 == 0))
||(thisyear % 400 == 0)) monthdays[1]++;
startspaces=thisdate;
while (startspaces > 7) startspaces-=7;
startspaces = thisday - startspaces + 1;
if (startspaces < 0) startspaces+=7;
document.write("<table border=0 bgcolor=white ");
document.write("bordercolor=black><font color=black>");
document.write("<tr><td colspan=7><center><strong>"
+ monthnames[thismonth] + " " + thisyear
+ "</strong></center></font></td></tr>");
document.write("<tr>");
document.write("<td align=center>Su</td>");
document.write("<td align=center>M</td>");
document.write("<td align=center>Tu</td>");
document.write("<td align=center>W</td>");
document.write("<td align=center>Th</td>");
document.write("<td align=center>F</td>");
document.write("<td align=center>Sa</td>");
document.write("</tr>");
document.write("<tr>");
for (s=0;s<startspaces;s++) {
document.write("<td> </td>");
}
count=1;
while (count <= monthdays[thismonth]) {
for (b = startspaces;b<7;b++) {
linktrue=false;
document.write("<td>");
for (c=0;c<linkdays.length;c++) {
if (linkdays[c] != null) {
if ((linkdays[c][0]==thismonth + 1) && (linkdays[c][1]==count)) {
document.write("<a href=\"" + linkdays[c][2] + "\">");
linktrue=true;
}
}
}
if (count==thisdate) {
document.write("<font color='FF0000'><strong>");
}
if (count <= monthdays[thismonth]) {
document.write(count);
}
else {
document.write(" ");
}
if (count==thisdate) {
document.write("</strong></font>");
}
if (linktrue)
document.write("</a>");
document.write("</td>");
count++;
}
document.write("</tr>");
document.write("<tr>");
startspaces=0;
}
document.write("</table></p>");
// End -->
</script>
</font></div>

[ Voor 86% gewijzigd door Verwijderd op 21-12-2002 19:49 . Reden: script toegevoegd ]


Verwijderd

Volgens mij zit je fout ergens anders... Als ik het zo snel zie wordt er namelijk geen font grootte gedefiniëerd in het Javascript :)

Verwijderd

Topicstarter
heb ik al geprobeerd toe te voegen maar verandert niets.. gewoon toch een <font size= 6px> toevoegen?

en verder staat de fontsize in de css gedefinieerd

[ Voor 25% gewijzigd door Verwijderd op 21-12-2002 19:57 ]


  • Tim
  • Registratie: Mei 2000
  • Laatst online: 23-07 15:18

Tim

ik denk dat je fout eerder in de CSS zit dan in het javascriptje.. post die ook eens?

Verder is <font size=6px> niet geldig (probeer font zowiezo te vermijden, aangezien het niet meer in de standaard zit)

Verwijderd

gewoon al die vieze font tags eruit slopen en alles defineren in je stylesheet.
HTML:
1
2
3
4
5
6
7
<style type="text/css">
td {
   font-family: verdana, arial, sans-serif;
   font-size: 10px; /* 6 pixels is veel te klein!! ga nooit lager als 8 pixels */
   color: #ff0000;
}
</style>


Waar het evt. ook nog aan kan liggen, wordt in dit topic besproken, probeer je functie eens af te sluiten met document.close() zoals door crisp wordt aangeraden.

[ Voor 4% gewijzigd door Verwijderd op 21-12-2002 20:11 . Reden: punt komma ]


Verwijderd

Topicstarter
HTML:
<style type="text/css">
<!--
.datum {
font-family: Arial, Helvetica, sans-serif;
font-size: 8px;
color: #666666;
}
.today {
font-family: Arial, Helvetica, sans-serif;
font-size: xx-small;
color: #999999;
letter-spacing: normal;
text-align: justify;
white-space: normal;
}
-->
</style>


[hoe doe dat overigens dat het mooi in zo'n "kladblok" wordt gepost]

[ Voor 23% gewijzigd door Verwijderd op 21-12-2002 20:48 ]


  • 2
  • Registratie: November 2000
  • Laatst online: 31-03 13:52

2

Verwijderd schreef op 21 december 2002 @ 20:46:
[hoe doe dat overigens dat het mooi in zo'n "kladblok" wordt gepost]
http://gathering.tweakers.net/forum/faq
Pagina: 1