Error the font element is obsolete use css instead

Исправление ошибок в валидаторе - HTML, CSS HTML, CSS Решение и ответ на вопрос 1691555

0 / 0 / 0

Регистрация: 22.03.2016

Сообщений: 3

1

22.03.2016, 12:22. Показов 2817. Ответов 4


Добрый день,не могли бы подсказать как исправить ошибку в коде.уже много всего прочитал но так и не получается.
Валидатор ругается
Error: The font element is obsolete. Use CSS instead.
From line 153, column 10; to line 153, column 29
↩ <h3><font color=#ff7700>Обраще

выделяя font color

__________________
Помощь в написании контрольных, курсовых и дипломных работ, диссертаций здесь



0



413 / 378 / 220

Регистрация: 18.07.2014

Сообщений: 1,259

22.03.2016, 13:22

2

rybkid, не нужно много всего читать, нужно прочитать на что ругается валидатор
он вам пишет что тэг font устаревший
не используйте его
есть тэг span
цвет текста нужно задавать через css



0



0 / 0 / 0

Регистрация: 22.03.2016

Сообщений: 3

25.03.2016, 10:52

 [ТС]

3

просто не могу понять где то менять,сайт построен на какой то странной cms и в админке написано:
ВНИМАНИЕ! ТЕХНИЧЕСКИМ СПЕЦИАЛИСТАМ: НЕ ВНОСИТЕ ИЗМЕНЕНИЯ НАПРЯМУЮ В HTML-ФАЙЛЫ.
Изменения будут перезаписаны административной системой при правках вносимых из административной системы. Для внесения изменений пользуйтесь данной системой администрирования. При необходимости внесения изменений непосредственно в коды сайта, вносите их в файлы шаблонов, называющиеся как template_*.html, либо в файлы *.incl находящиеся внутри папки /blocks/.



0



413 / 378 / 220

Регистрация: 18.07.2014

Сообщений: 1,259

28.03.2016, 11:59

4

rybkid, попытайтесь выяснить, на какой именно цмс написан сайт
покажите скрин админки
можете выложить ссылку на него



0



0 / 0 / 0

Регистрация: 22.03.2016

Сообщений: 3

22.04.2016, 11:21

 [ТС]

5

Добрый день,вот скрин админки.

Миниатюры

Исправление ошибок в валидаторе - HTML, CSS
 



0



This guide will walk you through how to fix some of the most common problems discovered by UNL WebAudit

    A PDF link was found

    This notice means that WebAudit found a link to a PDF document on your site. The use of PDF documents are discouraged because they do not work well on mobile and are often not built with accessibility in mind. The majority of the time, these PDF documents contain information that would be perfectly suited (and work better) as a web page on your site. Converting PDF content to webpages has the benefits of making the content more accessible, mobile-friendly, and UNL branded. Tools like UNLcms make creating web content a breeze, and even offer tools to create web forms which can easily replace PDF forms.

    Ampersands (&) did not start a character reference

    This HTML error means that an & character was found on your page that was not escaped. The ampersand should always be escaped in HTML documents to prevent browsers from trying to interpret them as the beginning of a character reference such as &amp;

    Ampersands (&) in URLs

    When writing a URL as text in HTML & needs to be written as &amp;

    Anchor element found with a valid href attribute, but no link content has been supplied.

    An anchor tag must be around text or an image, the contents can not be blank.

    <a href="">something must go in here</a>

    Bad value «» for attribute «href» on element «a»: Illegal character in path segment: not a URL code point.

    URLs can not have spaces, replace spaces with %20

    Bad value _ for attribute _ on element _: Expected a digit but saw _ instead

    This error usually means that a percent value was given for an attribute that requires a pixel value. Most HTML height and width attributes require pixel values. Furthermore, the height and width attributes, as well as inline CSS should be avoided in favor of styles in the HTML <head> or in CSS style sheets. Removing presentation from HTML markup will help improve code maintainability. Example: remove width="100%"

    Consecutive hyphens did not terminate a comment

    HTML5 does not allow for consecutive hyphens such as -- to be used inside of a comment. You can fix this by adding a space between hyphens such as - -

    Duplicate ID _

    The id="" must be unique. Rename the id="" for one of the elements.

    Element “link” is missing required attribute “property”

    Place <link> in the <head> instead of the <body>

    Element «style» is missing required attribute «scoped»

    When using <style> in the body, add scoped to the style tag <style scoped>. It is preferred to place <style> in the <head> instead of the <body> when possible.

    Element «thead» not allowed as child of element «table» in this context.

    The element <thead>...</thead> must open and close before the <tbody>...</tbody>. For example:

    <table>
      <thead>
      ...
      </thead>
      <tbody>
      ...
      </tbody>
    </table>
    

    End tag for «body» seen, but there were unclosed elements

    Most likely missing a closing div tag.

    Fieldset does not contain a legend element.

    This means that a form on the page uses a <fieldset> to group form controls, but does not have an associated <legend> element. The <legend> element is used to describe the group of form controls, and is required to help users identify the purpose of the grouped content.

    The following example is not valid because it does not have a <legend> element:

    <form>
       <fieldset>
           <input type="radio" name="accept_agreement" id="yes"> <label for="yes">yes</label>
           <input type="radio" name="accept_agreement" id="no"> <label for="no">no</label>
       </fieldset>
    
       <input type="submit">
    </form>
    

    The following is valid

    <form>
       <fieldset>
           <legend>Do you agree to the terms?</legend>
           <input type="radio" name="accept_agreement" id="yes"> <label for="yes">yes</label>
           <input type="radio" name="accept_agreement" id="no"> <label for="no">no</label>
       </fieldset>
    
       <input type="submit">
    </form>
    

    In UNLcms, the WebForms module allows you create fieldsets to group related form controls. If you use fieldsets with webforms, be sure to give each fieldset a title, which will be used for the fieldset legend when rendered to the user. One thing to note here is that you should not check the box to ‘Hide Label’ under the fieldset options.

    Legends are required so that screen readers and other assistive technology can properly interact with the fieldset element in a form.

    Heading tag found with no content.

    An <h1><h6> tag must be around text, the contents can not be blank or contain something that isn’t text, like an image.

    <h2>text must go in here</h2>

    Iframe element requires a non-empty title attribute that identifies the frame.

    Add title="text describing iframe contents goes in here" inside the iframe tag

    Image missing alternate text

    When adding an image to a page, please be sure to fill out the ‘Image Description’ in the image uploader or include an alt attribute with HTML. Alts help with search engine optimization and are useful for people using assistance devices or opting not to load images.

    Links must have discernable text

    Links must have text. If the link is an image, the image must have alternate text to describe it.

    The following examples are not valid

    <a href="https://unl.edu"></a>
    <a href="https://unl.edu"><img src="unl-logo.jpg" alt="" /></a>

    The following examples are valid

    <a href="https://unl.edu">University of Nebraska-Lincoln Website</a>
    <a href="https://unl.edu"><img src="unl-logo.jpg" alt="N logo. Return to University of Nebraska-Lincoln Website" /></a>

    Moved Permanently (301)

    This notice means that a link was found on your page that is now permanently redirecting to a different web page. After time passes, permanent redirects often turn into broken links because the redirect is no longer maintained. It is a good idea to update these links to the new URL.

    No «p» element in scope but a «p» end tag seen.

    Either a closing </p> tag is missing or the <p> tag contains a block element

    No space between attributes

    For elements with multiple attributes, put a space between them.

    The following example is not valid

    <img src="unl-logo.jpg"alt="University of Nebraska-Lincoln logo" />

    The following example is valid

    <img src="unl-logo.jpg" alt="University of Nebraska-Lincoln logo" />

    Not Found (404)

    This error means that a link was found on your site which no longer works. Broken links can lead to bad user experience, and cause users to look elsewhere for information. It is often possible to tell which link on the page is broken by looking at its URL. If you still can not locate the link, it might be helpful to view the page source in your browser, and search for the last part of the link. In other words if the link is http://www.unl.edu/folder/test.html, search for test.html.

    Saw «»» when expecting an attribute name.

    An attribute has too many quotations.

    The following example is not valid

    <p class="dcf-txt-center"">...</p>

    The following example is valid

    <p class="dcf-txt-center">...</p>

    The relationship between td elements and their associated th elements is not defined. Use either the scope attribute on th elements, or the headers attribute on td elements.

    This error occurs when responsive table code is missing headers="", which contains corresponding row and column id attributes, in the td tags. Consider using the Responsive Table Generator.

    The «type» attribute on the «ul» element is obsolete.

    For lists, type="disc" is obsolete. Use CSS instead: <ul style=»type:disc;»>.
    *Please note that the default setting for lists is ‘disc’. Removing the attribute type="disc" is also valid.

    This element has insufficient contrast at this conformance level. Expected a contrast ratio of at least 4.5:1

    Text or background color is too light or dark. Use a color contrast tool to find values that pass WCAG 2 AA and AAA compliance.

    The «frameborder» attribute on the «iframe» element is obsolete. Use CSS instead.

    Remove frameborder=0 from the <iframe> tag and in the CSS add

    iframe {
    border: none;
    }

    The font element is obsolete. Use CSS instead

    In HTML5, the <font> element is now obsolete. To fix this error, remove the font element and use CSS to change the font instead. The reason for this is that HTML should only contain structural and semantic markup, while presentation should be separated into the CSS layer. This best practice will help ensure that your code is more inter-operable and easier to maintain. Take the following as an example.

    <font size="3" color="red">This is some example text</font>

    The above code could be replaced by:

    
    <!-- Style should be in the head or in a separate style sheet --!>
    <style>
    .font-style-1 {
     font-size: 3em;
     color: red;
    }
    </style>
    
    <!-- the span should be in the body --!>
    <span class="font-style-1">This is some example text</span>
    

    The UNLedu framework dependents are out of date

    This error means that your website does not have the latest includes and assets for the UNLedu Web Framework. Please see our guide on Synchronizing the UNLedu Web Framework for details on how to fix this problem. Every month the UNLedu Web Framework is updated to improve security, accessibility, fix bugs, and/or improve design. It is important to stay up to date because only the latest version of the framework is supported and the use of the latest version is requires by the terms of use.

    The UNLedu framework HTML is out of date

    This error means that your website is not in the latest major version of the UNLedu Web Framework. As with the dependents error, it is required that your website stay up to date with the latest version. Please see our guide on Synchronizing the UNLedu Web Framework for details on how to fix this problem.

    The width attribute on the TD element is obsolete. Use CSS instead

    As with the font element is obsolete error, CSS should be used to apply a width rather than a width attribute.

    Element ‘ul’ not allowed as child of ‘ul’ at this point.

    Double check list nesting. Lists should follow this pattern:

    
    					<ul>
      <li>Beef
        <ul>
          <li>ribs</li>
          <li>roast</li>
          <li>steak</li>
        </ul>
      </li>
      <li>Pork</li>
      <li>Lamb</li>
    </ul>

    Unclosed element ‘div’ / End tag ‘main’ seen, but there were open elements.

    A <div> in the body is not properly closed.

    (Статья написана в 2009 году — на данный момент, некоторые моменты  могли измениться, ищите более актуальные материалы)

    Есть факт, на который мало обращают внимание — валидность кода сайта на соответствие стандартам.
    Никого не собираюсь агитировать тут за советскую власть, сталкивался с разными мнениями, кто-то говорит, что все это чушь и ни на что не влияет, кто-то, как и я, старается придерживаться правил и стандартов. Можно писать слово «пошел» и «пошОл» и вас одинаково поймут, просто мнение о вас у грамотного человека начнет складываться особое, а можно представить другой вариант написания «пошел» и «пош» или «поше» и в первом случае вас поймут, а в двух других я сомневаюсь. Так что проверка вашего html кода на валидность полезна не только с точки зрения проверки на соответствия стандартам, но и с точки зрения поиска незакрытых тегов и пр.. Все это может повлиять на продвижение вашего сайта в Интернете.

    Итак, есть ряд сервисов для проверки валидности кода, но я пользуюсь одним из них — _http://validator.w3.org/, а вы сами себе выберете, что удобно для вас.

    Попробуйте в предложенном мною сайте ввести адрес своего и запустите проверку.
    Не пугайтесь, результат у большинства страшный -) ошибок вал (у меня при первой проверке высыпало что-то около 500 ошибок на одной странице), я потратил часа 4-5 на свой сайт для исправления всех ошибок.

    Результат проверки выдается на английском языке.

    Чтобы вам было удобнее разбирать ошибки советую установить галочку на Group Error Messages by Type, в этом случае все ошибки сгруппируются по типу, поставьте галочку на Show Source и вам будет удобнее сразу просматривать исходный код в котором обнаружена ошибка, другие галочки я проставляю тоже, а вы смотрите как будет удобнее в вам.

    Итак, получив результат ошибок не пугайтесь, большинство ошибок исправляется на раз-два. Вот пример некоторых ошибок, исправив которые, вы снимите скорее всего 70-90% от общего числа.

    1.      теги html следует писать маленькими буквами, знаю, что некоторые редакторы по умолчанию вставляют теги большими буквами (Edit+ точно это делает);

    2.      теги, которые не имеют закрывающего, например br, img, hr и т.д. следуют писать следующим образом <br />, <img />, <hr />;

    3.      тег img обязательно должен содержать атрибут alt и даже если вы не знаете, что туда писать оставьте его пустым alt=””;

    4.      все параметры тегов заключаются в двойные или одинарные кавычки, например width=”88” height=”31” border=”0”

    Остальные ошибки думаю исправите сами, не получится пишите через форму обратной связи и я постараюсь помочь -)

    country wench
     
    Posts: 167
    Joined: February 13th, 2007, 3:37 pm
    Location: Germany

    Hello,

    for days it has been impossible for me to reach a certain website with Firefox (64.0) from my computer.
    I always receive this information:

    Not Found
    The requested URL /search.php was not found on this server.
    ________________________________________
    Apache/2.0.52 (Red Hat) Server at www…..com Port 80

    This is only the case if I try to open the site on my PC.

    On my i-Pad I can open the URL with Firefox.

    On the Computer another browser (which I don’t like) works alright with this address.

    I have tried to go to the website by using the address from my favourites, also by typing it in directly; neither gives me the desired result.

    Thank you.


    LIMPET235
    Moderator
    User avatar
     
    Posts: 39579
    Joined: October 19th, 2007, 1:53 am
    Location: The South Coast of N.S.W. Oz.

    Post

    Posted December 29th, 2018, 3:27 am

    Hi,
    The site in question will be of assistance.
    URL = ?
    What Anti-virus program/s are you running?

    Ancient Amateur Astronomer
    Win-7-HP/Intel® DualCore-2.0GHz/500G HDD/4 Gig Ram/550Watt PSU/350WattUPS/Firefox-20.0-79.0-99.0/T-bird-2.0.0.24/SnagIt-v10.0.1/MWP-7.12.

    (Always choose the «Custom» Install.)



    Grumpus
    User avatar
     
    Posts: 13038
    Joined: October 19th, 2007, 4:23 am
    Location: … Da’ Swamp

    Post

    Posted December 29th, 2018, 8:25 am

    The first link listed address has 30 some errors and 4 warnings which could be responsible if there are requirements on your system which do not parallel what the site deploys.

    Legacy encoding windows-1252 used. Documents must use UTF-8.
    Start tag seen without seeing a doctype first. Expected <!DOCTYPE html>.
    Bad value text/html; charset=windows-1252 for attribute content on element meta: charset= must be followed by utf-8.
    CSS: Parse Error.
    The ___ attribute on the ___ element is obsolete. Use CSS instead. (12) · Hide all · Show all
    The bgcolor attribute on the body element is obsolete. Use CSS instead.
    The text attribute on the body element is obsolete. Use CSS instead.
    The width attribute on the table element is obsolete. Use CSS instead.
    The border attribute on the table element is obsolete. Use CSS instead.
    The align attribute on the td element is obsolete. Use CSS instead. (3)
    The width attribute on the td element is obsolete. Use CSS instead. (3)
    The valign attribute on the td element is obsolete. Use CSS instead. (2)
    The ___ element is obsolete. Use CSS instead. (8) · Hide all · Show all
    The center element is obsolete. Use CSS instead.
    The font element is obsolete. Use CSS instead. (7)
    Element table not allowed as child of element font in this context. (Suppressing further errors from this subtree.)
    End tag font violates nesting rules.
    End tag for body seen, but there were unclosed elements.
    Unclosed element ___. (3) · Hide all · Show all
    Unclosed element font.
    Unclosed element b.
    Unclosed element center.

    Warnings (4) · Hide all warnings · Show all warnings

    The type attribute for the style element is not needed and should be omitted.
    The border attribute is obsolete. Consider specifying img { border: 0; } in CSS instead.
    The type attribute is unnecessary for JavaScript resources.
    Consider adding a lang attribute to the html start tag to declare the language of this document.

    Doesn’t matter what you say, it’s wrong for a toaster to walk around the house and talk to you


    dfoulkes
    User avatar
     
    Posts: 22525
    Joined: June 28th, 2008, 10:31 pm
    Location: Mesquite, Nevada

    Post

    Posted December 29th, 2018, 9:30 am

    Wow… that is a lot of issues with that site… anyway…

    I got to the site with no issues but one thing I do when I close Firefox (at least daily) is that I have it set to clear CACHE. So, you might want to get into settings and clear your cache to see what happens. Options/Privacy and Security… click on Clear History…then Time range to clear Everything and then in the drop-down list just have Cache checked off.…and clear it.

    As you can see she’s (The CAT) always alert and on the prowl for Meoware !!


    country wench
     
    Posts: 167
    Joined: February 13th, 2007, 3:37 pm
    Location: Germany

    Post

    Posted December 29th, 2018, 11:19 am

    Grumpus and dfoulkes:

    Thank you both for your response.

    dfoulkes:

    Just as you do Browsing & Download History, Cookies, Cache, Form & Search History, Active Logins are cleared by me on a daily basis.

    I thought it might have to do with what is stored temporarily on the Computer because on my i-Pad I can reach the site in question without trouble.

    Grumpus:

    Oh my – I am usually quite capable with my electronic devices and on the net, but with this long list of errors and warnings on the link I am completely overwhelmed.

    I will have to ask my grandson whom I see soon, can’t cope with your advice on my own, I am 80 years old on my next birthday (very soon).

    The site owner is an honourable, reliable man and I have used it for years –
    I don’t know what happened there. Other users and participants have no difficulty in reaching the site. It must be at my end.

    Kind regards

    Karen


    Grumpus
    User avatar
     
    Posts: 13038
    Joined: October 19th, 2007, 4:23 am
    Location: … Da’ Swamp

    Post

    Posted December 29th, 2018, 12:04 pm

    Take a look at your preferences /tools/options/General /Language and Appearance/advanced.
    Look at the Fonts for and set it to «Other Writing Systems»
    Check the block «allow pages to choose their own fonts instead of your selections above.
    Set the «Text encoding for Legacy Content» to Other (including Western European)

    My guess is the Windows system may want a different text encoding.
    There may also be some other issues with the obsolete items in the list.

    Doesn’t matter what you say, it’s wrong for a toaster to walk around the house and talk to you


    lasardo
     
    Posts: 182
    Joined: September 9th, 2018, 1:41 pm

    Post

    Posted December 29th, 2018, 1:15 pm

    When I go to that site in any browser it just shows «Red Hat Enterprise Linux Test Page».


    therube
    User avatar
     
    Posts: 21317
    Joined: March 10th, 2004, 9:59 pm
    Location: Maryland USA

    Post

    Posted December 30th, 2018, 8:28 am

    Country is in Germany, where are you lasardo.
    (I know where I am, lost ;-) [in the USA]. And no problem loading the site.)

    This worked from my end,

    https://www.proxyserver.com/germany-proxy-server/

    .

    Fire 750, bring back 250.
    Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14 Pinball CopyURL+ FetchTextURL FlashGot NoScript


    Grumpus
    User avatar
     
    Posts: 13038
    Joined: October 19th, 2007, 4:23 am
    Location: … Da’ Swamp

    Post

    Posted December 31st, 2018, 6:44 am

    Page worked fine this morning with all cookies and trackers blocked.
    Maybe it’s some other issue or the site is blocking certain IPs.

    Doesn’t matter what you say, it’s wrong for a toaster to walk around the house and talk to you


    country wench
     
    Posts: 167
    Joined: February 13th, 2007, 3:37 pm
    Location: Germany

    Post

    Posted January 9th, 2019, 5:06 am

    Just to let you know, the site works again for me. Because I couldn’t do anything myself I waited for about a week trying now and again to connect, then it worked suddenly.

    Thank you everybody for your efforts to help.

    Karen


    Return to Firefox Support

    Who is online

    Users browsing this forum: No registered users and 6 guests

    MozillaZine

    Понравилась статья? Поделить с друзьями:
  • Error the following file has changes staged in the index
  • Error the following 3rd party repositories were detected disable them and refresh your apt cache
  • Error the file is not the image or this file is damaged
  • Error the field hosts is required but was not set
  • Error the evaluation period already expired on this computer