HTML4 strict: border=“0” is deprecated, how to replace it


Tags: html,css

Problem :

Checking my HTML with Amaya I detected that my navigation symbols (i. e. chapter forward) with border="0" are marked as deprecated. How to overcome this restriction? I don't want that my chapter forward symbol to be represented as link.

Example: <a href="...URL..."><img alt="chapter forward" src="../images/chforw.gif" border="0"></a>

I've tried CSS img {border:none }, but this disable the link representation in all circumstances.



Solution :

Gives a class to your element, for example

<a...><img class="vroum" alt="chapter forward" src="../images/chforw.gif"></a>

Then your CSS rule can be clean and specific to those elements :

.vroum {border:none }

Bonus (the whole point of CSS) : you'll be able to change the styling of all those elements without having to change the HTML everywhere.


    CSS Howto..

    How to remove strange border from css-animated clip-path?

    :hover feature , How to approach the same result as js code by using css

    How set a page to maximum and minimum sizes via css

    how to use variables when setting CSS properties in Jquery?

    Image div showing in Safari, Chrome and IE but not in Firefox

    How to make hover using jquery without CSS?

    How to make scrollbars appear when DIV doesn't have enough room but keep DIV centered?

    How is does Jquery display a tooltip on this span element?

    How to Highlight a list item after user clicks on link

    How to center align text over CSS shape?

    HTML/CSS: how to force text within a tag to be styled with font-style: italic !important;

    How can I remove frame like background in twentysixteen theme

    how do I give partition in the
    tag?

    How to make the width property to work as auto in css

    How to position div at the bottom of a page

    How to define class in CSS

    How to include a custom CSS file in TYPO3

    How do I add curved corners to menu in css

    How to find a div / panel in repeater and apply css?

    How to add visual indicator of focus for Radio Button for Firefox

    How can I get width and height of big image after displaying it on html-page?

    How to change CSS according to user Operating System

    How to hide the “body” statement in css and javascript

    How to write bootstrap media queries

    How is CSS/HTML Rendered In Browsers?

    How do I create a navigation system like that of Lowes.com [closed]

    How to scroll with large pages with jQuery onepage-scroll plugin?

    How to use CSS absolute position inside a scrollable div element

    How to use css image sprites in this code?

    How to override\edit Zurb Foundation base CSS styles?