• Страница 1 из 1
  • 1
Таблица HTML-цветов для сайта uCoz
adminДата: Четверг, 2010-12-23, 03:15:17 | Сообщение # 1
Нет аватара у admin
Хакер
Администраторы
Сообщений: 151
Репутация: 0
Не на форуме


Открываем блокнот Windows, вставляем в него вот этот код:

Code
<html>

<head>

<title>Таблица цветов html</title>

<style>
a:link{ color: #000000; text-decoration: underline}
a:visited{ color: #000000; text-decoration: underline}
a:hover{ color: #000000; text-decoration: none}
td, body {font-family: verdana, arial, helvetica; font-size:11px;}   
</style>

</head>

<body bgcolor="#EDEDED" text="#000000" link="#000000" topmargin="0" leftmargin="0">

<center>

<script>
// create 6-element array
var hex = new Array(6);

// assign non-dithered descriptors
hex[0] = "FF";
hex[1] = "CC";
hex[2] = "99";
hex[3] = "66";
hex[4] = "33";
hex[5] = "00";

// accept triplet string and display as background color
function display(triplet) {

   // set color as background color
   document.bgColor = '#' + triplet;

   // display the color hexadecimal triplet
   alert('Цифровой код цвета фона = ' + triplet);

}

// draw a single table cell based on all descriptors
function drawCell(red, green, blue) {

   // open cell with specified hexadecimal triplet background color
   document.write('<TD BGCOLOR="#' + red + green + blue + '">');

   // open a hypertext link with javascript: scheme to call display function
   document.write('<A HREF="javascript:display(\'' + (red + green + blue) + '\')">');

   // print transparent image (use any height and width)
   document.write('<IMG SRC="place.gif" BORDER=0 HEIGHT=12 WIDTH=12>');

   // close link tag
   document.write('</A>');

   // close table cell
   document.write('</TD>');
}

// draw table row based on red and blue descriptors
function drawRow(red, blue) {

   // open table row
   document.write('<TR>');

   // loop through all non-dithered color descripters as green hex
   for (var i = 0; i < 6; ++i) {
   drawCell(red, hex[i], blue);
   }

   // close current table row
   document.write('</TR>');

}

// draw table for one of six color cube panels
function drawTable(blue) {

   // open table (one of six cube panels)
   document.write('<TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0>');

   // loop through all non-dithered color descripters as red hex
   for (var i = 0; i < 6; ++i) {
   drawRow(hex[i], blue);
   }

   // close current table
   document.write('</TABLE>');
}

// draw all cube panels inside table cells
function drawCube() {

   // open table
   document.write('<TABLE CELLPADDING=5 CELLSPACING=0 BORDER=1><TR>');

   // loop through all non-dithered color descripters as blue hex
   for (var i = 0; i < 6; ++i) {

   // open table cell with white background color
   document.write('<TD BGCOLOR="#FFFFFF">');

   // call function to create cube panel with hex[i] blue hex
   drawTable(hex[i]);

   // close current table cell
   document.write('</TD>');

   }

   // close table row and table
   document.write('</TR></TABLE>');

}

// call function to begin execution
drawCube();

</script>

<br>

</body>

</html>


Сохраняем как html файл и загружаем через файловый менеджер на свой сайт.
Прикрепления к сообщению: 4285907.jpg (27.0 Kb)


Великий Админ Киберновы
 
  • Страница 1 из 1
  • 1
Поиск: