- 1
How do I combine css with html
2 Réponses
+ 2
Also you can write the css directly inside html file using <style> tag. For example:
<!DOCTYPE html>
<html>
<head>
<style>.my-class { color: red; } </style>
</head>
<body>
<p class="my-class">This text will be red colored</p>
</body>
</html>
+ 1
In <head> tag of html you have to link "css" file using <link rel="stylesheet" href="yourcss.css">
In html you can add classes and IDs to every component if you need. In css you can get access to them by "." for classes and "#" for IDs