I want to use the CSS p { hyphens: auto; }
on my site. But I can't edit the html-tag so I can't add the lang
-tag.
If I use <meta http-equiv="language" content="DE">
it doesn't work.
How can I fix this?
Is there another way to "break" words like you do with hyphens
, without using JavaScript or big plugins?
The lang
attribute specifies the language of the element's content. You just need to set the lang
for the parent element. So having
HTML
<div lang="DE">
<p>Dit is paragraaf</p> <!--This is paragraph-->
</div>
CSS
p{ hyphens: auto }
In HTML5, the lang attribute can be used on any HTML element (it will validate on any HTML element. However, it is not necessarily useful).
In HTML 4.01, the lang attribute cannot be used with: <base>
, <br>
, <frame>
, <frameset>
, <hr>
, <iframe>
, <param>
, and <script>
.