These HTML tags are all well and good, but where do we put them?
You can integrate CSS directly into HTML5 tags to be much faster. For very simple pages, you don’t need to create a separate .CSS stylesheet. If it’s just to apply a single line of style to a tag, you don’t need to put the CSS in the HTML document — you can integrate it directly onto a tag.
Keep in mind that this solution exists but should be reserved for occasional use, for example to define a style on a single element that only appears on one page of your site.
Example:
<h1 style="font-style: bold;">Titre de l'article 1</h1>
<h1>Titre de l'article 2</h1>In this example, you use two level 1 headings. They will both be displayed larger than the rest of your page text. However, the first one will be bold while the second will only use the default style, so it will not be bold.
This style should therefore be used with caution, as the text may not follow the style of your site. And above all, this type of coding does not allow you to easily update the presentation of your site. Use this technique for small pages or for very specific cases.
Let’s do another example:
<body>
...
<div style="background-image:url(images/fond.jpg); border-color: #849460; border-style:solid;
border-width: 2px; border-radius: 10px; width:300px; margin:auto; text-align:left; padding-left:80px;">
Contenu de votre élément
</div>
...
</body>In any case, it is best to identify the relevant tags using names in order to apply distinct rules to them. We will see this with internal stylesheets.






0 Comments