HTML Assessment for interview

Joined
Feb 16, 2024
Messages
5
Reaction score
0
Hello Coding People,

Just a quick message to ask some assistance about HTML online test.

I came across that exercise but I could not solve it. I'm hoping you can help me please.

<!DOCTYPE html>
<html>
<head>
<style>
tags {

</style>
</head>
<body>
<div id="tags">
<span>Recomendation</span>
<span>Travel</span>
<span>Food</span>
<span>Hawaii</span>
<span>Beach</span>
</div>
</body>
</html>

1708113663881.png


What do you I miss here?

Best Regards,

Chris
 
Joined
Jul 4, 2023
Messages
366
Reaction score
41
If you want to refer to the id attribute (of some html element) in your css code, use the # sign.
You can assign several css classes separated by spaces to the html element.
HTML:
<!DOCTYPE html>
<html>
  <head>
    <style>
      #tags span {
        border: 2px solid black;
        padding: 0 10px;
        background-color: yellow;
        font-size: 18px;
      }
      #tags .rounded-edge {
        border-radius: 10px;
      }
      #tags .coral-orange {
        background-color: #ed6d52;
      }
      #tags .green {
        background-color: green;
      }    
    </style>
  </head>
  <body>
    <div id="tags">
      <span class="coral-orange">Recomendation</span>
      <span class="rounded-edge">Travel</span>
      <span class="rounded-edge green">Food</span>
      <span class="rounded-edge">Hawaii</span>
      <span class="rounded-edge">Beach</span>
    </div>
  </body>
</html>
 
Joined
Feb 16, 2024
Messages
5
Reaction score
0
Oh, great! I had no idea that # was required with tags, like containers. And it appears that I did not fully understand how to use the class attribute.

Thank you very much!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top