Tribute Page very confused id=? title=?

<!DOCTYPE html>
  id=title Sigmund Freud
<h1> Sigmund Freud </h1>                 
<h2> Father of Modern Psychology </h2>
id=main  "Sigmund Freud"
<img src= https://cdn.britannica.com/29/59229-050-F6C36BC9/Portrait-Sigmund-Freud

this is what i have so far… it looks good on the page but it is not passing the test, when i try to do it with "Sigmund Freud it doesn’t show up on the page…

you should be using the id as attribute of an html element
put like that it doesn’t have any sense

1 Like

Hi emtpchris,

I just finished my tribute page project. This is what I did to pass…
<div id="title"> <h1>TITLE OF YOUR PAGE</h1></div>

Hope this helps!

1 Like

even i dont understand why u need the id attribute for these elements? even thou adding id attributes to the elements, should we also modify or add anything in the id property in the css file?

Hello @textabdulhere and welcome to forums!

Rather than responding to an old topic feel free to create a new one with your questions.

Adding an id allows you to do a couple things. One is that you can call it out in your css to style that element only. The difference between this and class is that class can be assigned to multiple elements. Only one element should have an id. So let’s say you have some elements, we’ll go with <img> ‘s and they have a class of class=“images”. Now in your css you styled all of the images using the class (Maybe you centered and re-sized them) but maybe there’s one particular image that you want to have a border or maybe each image should have a different border color. Well if you change the class they all change. So in this case you could style them individually using their id.

Also an id is what is used for an internal link using the <a> element. So to jump to that section you need to have an id associated you it.

Hope that helps.

 <title>My Page</title>

title tag is usually in head part. The title element represents the document’s title or name.

Remember this ,we declare the Id and Classes in opening tag of our element.Understands the main difference between the Id and Class. We can use the same class name multiple times in whole website but id is unique identity. example : #mobile_menu and class : .common-banner

The main reason for the ids on the HTML is for the tests. The tests need to have known expected ids it can use to check for the challenge requirements.

You are free to use them in the CSS for styling, but I would suggest using classes instead. Using ids for CSS is less flexible and often ends up causing issues in the long run, especially in larger longing running projects, i.e. real large sites developed and maintained over long periods of time.