0

#header {
  width: auto;
  height: 200px;
  background: silver;
  margin: 20 30 0;
}

#logo img {
  height: 160px;
  margin: 16 20 0 15;
  border: 4px double gray;
}

#title {
  margin: -195 570;
  font-family: Cooper;
  text-decoration: underline;
}

#Picture {
  width: 340px;
}

#firstimage img {
  height: 250;
  width: 340;
  margin: 0 20 0 30;
}

#2ndpic img {
  height: 25;
  float: left;
  width: 342;
}
<div id="header">
  <div id="logo">
    <img src="img.jpg" alt="Logo">
  </div>
  <div id="title">
    <h1> Welcome To My Site :) </h2>
  </div>
</div>
<Div id="picture">
  <Div id="firstimage">
    <img src="2nd.jpg" alt="banner">
  </div>
  <div id="2ndpic">
    <img src="3rd.jpg" alt="2ndimg">
  </div>
</div>
</div>

I am trying to show both images same size and align them left right in Picture . Help! these aint working, on <2ndpic> the styling isnt working, its not resizing by width height and is neither margin workin. Help! . By the way i am just learner if i have made any mistakes please point them out and tell me way to correct them, so i can fix them next time. thank you :) and i am learning from Youtube so you can understand.

LinkinTED
  • 16,671
  • 4
  • 27
  • 53
  • You have some syntax errors in your code `

    ` is closed with a ``. You are missing the trailing slash on your image tag ``. And in your CSS you are missing a whole lot of the `px` or `em`, etc....

    – LinkinTED Nov 16 '17 at 14:02
  • Oh okay, Yeah! i just noticed it. Thanks for telling me :) appreciated sir!. Moreover about px or em, i havent yet learnt them. and dont know how are these supposed to be placed. – Shahzad Ahmed Nov 16 '17 at 14:03
  • You need to at least define a unit. Now the width could be 340 pixel, or 340 trees or 340 bicycle... To learn more about the units, read this: https://developer.mozilla.org/en-US/docs/Learn/CSS/Introduction_to_CSS/Values_and_units – LinkinTED Nov 16 '17 at 14:08
  • Damn me! i guess i forgot to define unit in second one, i am being careless i guess! Reading it now. Thanks so much. – Shahzad Ahmed Nov 16 '17 at 14:14
  • Possible duplicate of [What are valid values for the id attribute in HTML?](https://stackoverflow.com/questions/70579/what-are-valid-values-for-the-id-attribute-in-html) – Makyen Nov 16 '17 at 22:40

1 Answers1

-1

Hey you cant access ID's starting with a number like this.

I would recommend renaming it into imgTwo or smth.

If you cant rename it you can access it via:

[id='2ndpic'] {

}
Quentin Albert
  • 312
  • 1
  • 9
  • 1
    If using HTML5, your answer is not accurate.... "*HTML 5 is even more permissive, saying only that an id must contain at least one character and may not contain any space characters.*" Source: https://stackoverflow.com/questions/70579/what-are-valid-values-for-the-id-attribute-in-html – LinkinTED Nov 16 '17 at 14:12
  • I dont know if i am using HTML5 or no. But that fixed my issue. :) thank you so much. – Shahzad Ahmed Nov 16 '17 at 14:15