За последние 24 часа нас посетили 36899 программистов и 1670 роботов. Сейчас ищут 998 программистов ...

стиль ссылки во внейшний файл css

Тема в разделе "HTML и CSS", создана пользователем Perez, 7 июн 2012.

  1. Perez

    Perez Активный пользователь

    С нами с:
    24 апр 2012
    Сообщения:
    22
    Симпатии:
    0
    Адрес:
    Санкт-Петербург
    Подскажите как засунуть вот стиль ссылки во внешний файл CSS

    В файле html он выглядит вот так (например):
    <style type="text/css">
    a:link {text-decoration: none; color: blue;}
    a:visited {color: green; }
    a:active {text-decoration: none; color: #FF0000; }
    a:hover {text-decoration: underline; color: yellow; }
    a.cl2:link {text-decoration: none; color: yellow;}
    </style>

    а текст самого файла выглядит (например) вот так:

    .cl1 {
    font-family: Verdana, Geneva, sans-serif;
    background-color: #CCC;
    color: #00C;
    font-size: 10px;
    font-weight: bold;
    }

    я уже и вот так пытался (придумывал всякое):

    A.cl5 link {text-decoration: none; color:#000000};
    A.cl5 visited {text-decoration: none; color:#000000};
    A.cl5 active {text-decoration: none; color:#F00};
    A.cl5 hover {text-decoration: none; color:#F00};

    Не получается... Помогите!
     
  2. igordata

    igordata Суперстар
    Команда форума Модератор

    С нами с:
    18 мар 2010
    Сообщения:
    32.408
    Симпатии:
    1.768
    а откуда ты взял cl5? почему ты по пути потерял двоеточие?

    Код (Text):
    1. .cl1 {
    2.  font-family: Verdana, Geneva, sans-serif;
    3.  background-color: #CCC;
    4.  color: #00C;
    5.  font-size: 10px;
    6.  font-weight: bold;
    7. }
    8. a:link {text-decoration: none; color: blue;}
    9. a:visited {color: green; }
    10. a:active {text-decoration: none; color: #FF0000; }
    11. a:hover {text-decoration: underline; color: yellow; }
    12. a.cl2:link {text-decoration: none; color: yellow;}
     
  3. Perez

    Perez Активный пользователь

    С нами с:
    24 апр 2012
    Сообщения:
    22
    Симпатии:
    0
    Адрес:
    Санкт-Петербург
    Двоеточие не поставил, думал, что оно только внутри скобок {} ставится...
    И точки с запятой за скобки вынес зачем-то я...

    Теперь всё работает! igordata, спасибо!


    a:link {text-decoration: none; color:#000000;}
    a:visited {text-decoration: none; color:#000000;}
    a:active {text-decoration: none; color:#F00;}
    a:hover {text-decoration: none; color:#F00;}