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 set width and text-align for button with CSS

    How to Change Css coding with a link [closed]

    How to squircle an app icon image with just CSS

    CSS: How to achieve - Two elements to be centered and positioned side by side WITHOUT a third parent container?

    How to change the css of a text input using jquery?

    How should I make this code to display inline

    Is there any tutorial to teach me how to design the sidebar like this website? [closed]

    How to word wrap text in HTML?

    CSS Progress bar is out of place, how to keep it in place?

    How to apply last-child only for first nested li?

    How do I keep an element from pushing another element in CSS?

    How to write multiple css selectors in one line?

    How to create color custom scrollbar in pure css? [closed]

    How can I prevent this plugin from popping up from behind the content area?

    How to move the scrollbar down

    How to make div height fit the content using css

    how to make textarea looks like input[text] on form invalid

    How to enable Stylus url() rewrites

    How can I reduce the spacing between my legend and chart proper in my Chart.JS bar chart, and increase it in the graph area?

    How to align floated elements to the bottom of their container

    How to overcome Selenium CSS parent only CSS selector limitation

    How can I opt out of a CSS style on a case-by-case basis?

    How to display a box of color beside a table row using CSS?

    How to set out css properly?

    How to increase the font size of one word only in the line?

    How to make this menu occupy all the remaining space's width?

    Showing :before but hiding element with CSS only

    links are showing up on each line, instead of inline

    HOW DO I MOVE THIS DIV UP TO BE ALLIGNED WITH THE FORM BOX [closed]

    How to css this?