There really is a problem when it's time to validate by link it shows this error:
Value Error: content Parse Error attr (db)
As in the image:
Thevalueattr
incontent:
wasnotsupporteduntilsometime,buttodayitisalreadypartofCSS3,soitisaBUG link
However, if you try to validate in link it works normally (select More Options > Profile: the CSS level 3 option, otherwise it will use version 2.1) it will validate normally, see the result:
HTMLConsiderations
- nouse
abbr=
,itisdeprecatedinhtml5. - The
db
attributeisinvalid. - Insteadof
db=""
use the data-
attribute that is specific for this type of task.
Now additional information:
- The
<body>
, <head>
, and <title>
tags are missing if it does not validate
HTML and CSS valid
<!DOCTYPE html>
<html>
<head>
<title>Exemplo</title>
<style type="text/css">
table {width:100%; border-collapse: collapse;}
table tr {border: 1px solid #000; padding: 5px;}
table th, table td {padding: 10px;text-align: center;}
@media screen and (max-width: 35.5em) {
table {border: 0;}
table thead {display: none;}
table tr {margin-bottom: 10px;display: block;border-bottom: 1px solid #000;}
table td {display: block; text-align: right; border-bottom: 1px solid #000;}
table td:last-child {border-bottom: 0;}
table td:before {content: attr(data-db);float: left;font-weight: bold;}
}
</style>
</head>
<body>
<table>
<thead>
<tr>
<th>Nome</th>
<th>Data de Nasc.</th>
<th>Salário</th>
<th>Cargo</th>
</tr>
</thead>
<tbody>
<tr>
<td data-db="Nome">Adão</td>
<td data-db="Data de Nasc.">01/01/1980</td>
<td data-db="Salário">R$ 1.250,00</td>
<td data-db="Cargo">Auxiliar de produção</td>
</tr>
<tr>
<td data-db="Nome">Eva</td>
<td data-db="data de Nasc.">01/01/1980</td>
<td data-db="Salário">R$ 2.500,00</td>
<td data-db="Cargo">Gerente</td></tr></tbody>
</table>
</body>
</html>
Validated 100% on:
Tips:
- It's really good to validate CSS and HTML, but it's not that important, there are things like this that work but do not validate, so you'd rather just care if CSS works on all browsers you want, even if it does not validate.
- Many new features are appearing in CSS, not everything will be listed in the validator and these fake issues may appear.
In short, try to validate what you give, but if something fails do not stick to it as long as it works on all browsers your clients use (preferably the most modern ones) then everything will be fine.