Чтобы легко понять проблему, предположим, что мы написали этот код:
static void Main(string[] args)
{
string[] test = new string[3];
test[0]= "hello1";
test[1]= "hello2";
test[2]= "hello3";
for (int i = 0; i <= 3; i++)
{
Console.WriteLine(test[i].ToString());
}
}
Результат будет:
hello1
hello2
hello3
Unhandled Exception: System.IndexOutOfRangeException: Index was outside the bounds of the array.
Размер массива равен 3 (индексы 0, 1 и 2), но при попытке получить доступ за пределами границ с помощью (3) он выдает исключение.
CSS:
A.class1 {color:red;}
A.class1:link {text-decoration: none; color: red;}
A.class1:visited {text-decoration: none; color: red;}
A.class1:hover {text-decoration: underline; color: red;}
A.class1:active {text-decoration: none; color: red;}
A.class2 {color:blue;}
A.class2:link {text-decoration: none; color: blue;}
A.class2:visited {text-decoration: none; color: blue;}
A.class2:hover {text-decoration: underline; color: blue;}
A.class2:active {text-decoration: none; color: blue;}
HTML:
<a href="http://www.google.com" class="class1">Google</a>
<a href="http://stackoverflow.com" class="class2">Stackoverflow</a>
Демо: http://cssdesk.com/qukaq
<a href="http://" style="color: red">RED</a>
<a href="http://" style="color: blue">RED</a>
Как видно выше, вы просто вводите style = "color: ###" в href, чтобы установить его так, как хотите, если вы хотите установить каждую отдельную ссылку. :)
Для более общего использования используйте
<a href="http://" class="red">RED</a>
<a href="http://" class="blue">RED</a>
и в вашем состоянии файла CSS
.red {
color: red;
}
.blue {
color: blue;
}
просто задайте имя класса для гипер гиперссылок <a>
и напишите CSS в соответствии с требованиями ur
для примера
CSS
<style>
.red {
color : #f00; text-decoration : none;
}
.green {
color : #0f0; text-decoration : none;
}
.blue {
color : #00f; text-decoration : none;
}
</style>
Разметка:
<a href="#" class="red" > Link0 </a>
<a href="#" class="green" > Link1 </a>
<a href="#" class="blue" > Link2 </a>
a.class1:link
,a.class1:visited
и т. Д. – Felix Kling 25 December 2010 в 19:44a:active
должно быть нижеa:hover
. см. другой jsfiddle.net/huhu/4qbFe/1 – haha 25 December 2010 в 20:47