HTML and CSS Reference
In-Depth Information
7. Save your changes to the file, and then return to the
lunar.htm
file in your text editor.
Scroll down to the summary table in the body of the document. Add the following to
the table:
a. In the table's title cell, display the text
today:
today
, where
today
is the date from
the
cDay
variable formatted using the writeDate() function.
b. In the
lunarimg
cell, display the lunar image for the date specified by
cDay
. (Hint:
Use the calcMPhase() function to return the phase number of the image.)
c. In the cell next to the
Moon's Age
label, display the text
age
days
, where
age
is
the age of the Moon on
cDay
. (Hint: Use the calcMAge() function.)
d. In the cell next to the
Right Ascension
label, display the text
ra°
, where
ra
is the
right ascension of the Moon on
cDay
. (Hint: Use the calcMRA() function.)
e. In the cell next to the
Declination
label, display the text
dec°
, where
dec
is the
declination of the Moon on
cDay
. (Hint: Use the calcMDec() function.)
f. In the cell next to the
In Constellation
label, display the text
zodiac
, where
zodiac
is the constellation that the Moon resides in on
cDay
. (Hint: Use the
calcMZodiac() function.)
g. In the cell next to the Distance label, display the text
distance
, where
distance
is
the distance from the Earth to the Moon in Earth radii on
cDay
. (Hint: Use the
calcMDist() function.)
h. Scroll down to the figure box. Within this element, insert a script that calls the
function lunar_calendar() for the date specified by
cDay.
8. Go to the
calendar.css
file in your text editor, and then create the styles required for
your lunar calendar. You can use the
calendar.css
file from the tutorial as a model, or
you can create a layout that you choose. Save your changes.
9. Open
lunar.htm
in your Web browser. Verify that the lunar calendar and the Moon
data follow the information shown in Figure 12-39.
10. Return to the
lunar.htm
file in your text editor and modify the value of the
cDay
vari-
able so that it displays the current date rather than December 14, 2015.
11. Submit your completed Web site to your instructor, in either printed or electronic
form, as requested.