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 trialrobert chisholm
Courses Plus Student 4,152 Pointsremoving images for 650px stress point for iphone
Hi all
I am doing the course and i am on responsive websites using CSS to remove the img from div-intro
I have put this code but states wrong I have included a copy can anyone tell me if this syntax is correct?
@media screen and (max-width : 705px) {
intro-img {
display: none;
}
.grid_1, .grid_2, .grid_3, .grid_4, .grid_5, .grid_6{ width:100%;
}
Its the intro-img that i want to remove when resizing to 650px etc
9 Answers
robert chisholm
Courses Plus Student 4,152 Pointssorry all i have the px wrong...here is the query
Add the appropriate CSS within the same media query that will force the “love at first bite” illustration to disappear.
Your code from each task should be added to the code written in the previous task.
@media screen and (max-width : 705px) {
.grid_1, .grid_2, .grid_3, .grid_4, .grid_5, .grid_6 { width:100%; }
this is the syntax i was using
intro-img {
display: none;
}
I dont understand should this be within the second bracket after setting responsive flow for gid 1 through 6?
Guil Hernandez
Treehouse TeacherHi Robert,
Make sure that you first specify intro
as an ID selector followed by the img
selector. Hint: Hyphen isn't necessary.
robert chisholm
Courses Plus Student 4,152 PointsHi Guil
Thanks for your response
Im doing stage for of the Smells Like Bakin' tutorial and this is the code i have got in but its not right
@media screen and (max-width : 705px) {
intro-img{display:none;}
.grid_1, .grid_2, .grid_3, .grid_4, .grid_5, .grid_6 { width:100%;}
or would it be
@media screen and (max-width : 705px) { .grid_1, .grid_2, .grid_3, .grid_4, .grid_5, .grid_6 { width:100%;}
then
intro-img{display:none;}
robert chisholm
Courses Plus Student 4,152 Pointsexcellent it was the second form thank so much for the hyphen tip thanks a million :-)
Guil Hernandez
Treehouse TeacherYou're welcome, Robert. Good job!
johnathanfigueroa2
5,417 PointsWould either Guil, or Robert as kind enough to look over this code:
@media screen and (max-width: 705px){
.grid_1,
.grid_2,
.grid_3,
.grid_4,
.grid_5,
.grid_6 {
width: 100%;
}
.intro img{
display: none;
}
}
and could you please explain what "Make sure that you first specify intro as an ID selector followed by the img selector. Hint: Hyphen isn't necessary." means?
I believe I did that by doing
.intro img{
display: none;
}
James Barnett
39,199 Points@Jonathan -
Remember, in CSS prefix an id selector with a #
.
Here's an example:
html
<div id="awesome"></div>
css
#awesome { /* css */ }
You can read more about using IDs on Shay Howe's Beginner's Guide to HTML & CSS
If you are still confused check out the CSS Foundations course here on Treehouse.
robert chisholm
Courses Plus Student 4,152 Pointsfor Johnathon
when i did it this is how i wrote the code
<pre> @media screen and (max-width: 705px){
intro img{
display: none; } .grid_1, .grid_2, .grid_3, .grid_4, .grid_5, .grid_6 { width: 100%; } .
</pre>
let me now how you get on with it as thats what i did to send command about the image when making responsive for break point on the media for 705px
robert chisholm
Courses Plus Student 4,152 Pointsfor some reason it didnt transfer the #intro img{ display:none;} then the grids within the {}