Issue
I want to make a beginner website using HTML, CSS and JS. However, how do you highlight text using CSS tags and stuff? (is it called CSS tags??)
I'm stuck and nothing seems to work on the internet, whatever I find.
I did this:
Trying out <mark>highlighted text<mark> now!
Doesn't work...
Solution
There Are 3 Ways TO Do It:
Way 1: Inline CSS:
<h2 style="background-color:red;">Hi Its Highlited</h2>
Way 2: CSS in head Section:
Your File Will Look Like This:
<!DOCTYPE html>
<html lang="en">
<head>
<style>
h2{
background-color: red;
}
</style>
</head>
<body>
<h2>Hi Its Highlited</h2>
</body>
</html>
Way 3: External CSS:
Your HTML Will Look Like This:
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="CSS_DIRECTORY_HERE">
</head>
<body>
<h2>Hi Its Highlited</h2>
</body>
</html>
Replace CSS_DIRECTORY_HERE With Your CSS File Directory.
Your CSS File Will Look Like This:
h2{
background-color: red;
}
Note: If You Are using Another Tag Like or Any Else, make sure Its A Text Tag. And Replace h2 With That tag.
Answered By - LakshyaK2011
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.