Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

Carl Taggett
Carl Taggett
10,319 Points

Questions about Object.

Swap out <img src=”img/love-at-first-bite.gif alt=”Love at First Bite”> tag with the correct HTML markup to instead bring in an love-at-first-bite.svg, located in the same “img” folder.

Ive tryed everythign but the one that works cant seem to get it right Im not sure what im doing wrong?

CSS changes to img, object and did the same thing ad the video>

9 Answers

Melissa Bornbach
Melissa Bornbach
6,675 Points

I know this was a while ago, but in case anyone is having the same challenges I had with this, here is the full code I used that passed the code challenge:

      <object data="img/love-at-first-bite.svg" type="image/svg+xml">
        <a href="img/love-at-first-bite.svg">
          <!--[ if lte IE 8 ]-->
          <img src="img/love-at-first-bite.gif" alt="Love at First Bite">
          <!--[ end if ]-->
        </a>
      </object>

(Above is case sensitive)

Omh MG
Omh MG
19,233 Points

You're awesome. Thanks. Was having a lot of issues with this.

Julian Ptak
Julian Ptak
30,920 Points

You are awesome with a capital "A". Awesome sauce. True awesome sauce. Thanks so much.

Thank you :)

Thanks Melissa

Gabriel Rosario
Gabriel Rosario
23,602 Points

Is just define the object data="" with the "img/" folder first, also in the img src="". Like this:

<object data="img/love-at-first-bite.svg" type="image/svg+xml"> <img src="img/love-at-first-bite.gif" alt="Love at First Bite"> </object>

the type="image/svg+xml" is important to include!!!

Hi, I am struck in this...Not able to figure out what is the problem in this.... <object data="img/love-at-first-bite.svg" type="img/svg+xml" class="chart" > <a href="img/love-at-first-bite.svg" > <!--[ if lte ie8 ]--> <img src="img/love-at-first-bite.gif" alt="Love at first bite"> <!--[ end if ]--> </a> </object>

James Barnett
James Barnett
39,199 Points

What code do you have so far?

James Barnett
James Barnett
39,199 Points

Remember: File names are case sensitive

Here's a hint, check the data attribute.

I have the same problem. I am inputting this syntax

<link rel="stylesheet" href="styles.css" type="text/css">
<link href="//fonts.googleapis.com/css?family=Nunito:400,300,700" rel="stylesheet" type="text/css">

</head> <body> <div class="container"> <div id="intro"> <div class="grid_4"> <h1>We're kicking taste buds in to high gear with our featured avocado chocolate cupcake from the west to the east coast.</h1> </div> <div class="grid_2 omega"> <object data="img/love-at-first-bite.svg"></object> </div> </div>

        <div id="featured-cupcakes" class="grid_12">
            <div class="grid_2">
                <h2>Bacon Me Crazy</h2>
                <img src="img/bacon-medium.jpg" alt="Bacon Me Crazy" class="cupcake">
            </div>
            <div class="grid_2">
                <h2>Jalapeno So Spicy</h2>
                <img src="img/lime-medium.jpg" alt="Jalapeno So Spicy" class="cupcake">
            </div>
            <div class="grid_2 omega">
                <h2>Avocado Chocolate</h2>
                <img src="img/avocado-medium.jpg" alt="Avocado Chocolate" class="cupcake">
            </div>
        </div>
</div>

</div> <div class="grid_2 omega"> <object data="img/love-at-first-bite.svg"></object> </div> </div>

Carl Tagett use lowercase l at the first "link/reference" love-at-first-bite.svg and add the > to the second line :)

Thanks for all the help from u all . It really helped me to pass this quiz.......

I agree with Magnus.. I used the first code, change Love to love and added > and it passed. Attention to detail I guess. :)

Carl Taggett
Carl Taggett
10,319 Points
<object data="img/Love-at-first-bite.svg" type="image/svg+xml" class="chart">
<a href="img/love-at-first-bite.svg"
<!--[if lte IE 8]-->
<img src="img/love-at-first-bite.gif" alt="Love at first bite">
<!--[endif]-->
</a>
</object>

I have delete the line for the other image completely and dropped this in.

and in the CSS i put ,object next to the image. Its said "check the syntax?

Not sure where I went wrong watched the video 5 times.

Damian Sefton
Damian Sefton
7,198 Points

I've not got this working yet but you are missing a '>'.

<a href="img/love-at-first-bite.svg"

Try not using the fallback for IE8 or below for this. Although it is great practice I think it's messing up the code interpreter.

Also,remember that you are inserting an SVG into the html markup; not creating a link that is clickable from the image. I would just use the <img> tag that is provided and swap it out with the

<img src="img/love-at-first-bite.svg">

Should look something like this:

 <object data="" type="image/svg+xml" class="chart">
<img src="">

<object data="img/love-at-first-bite.svg" type="image/svg+xml" class="chart"> <img src="img/love-at-first-bite.svg" >

Leyla Movahedi
Leyla Movahedi
6,549 Points

Thank you!!! This worked for me also.