1

I came across this web-app page from Udacity's website - http://assignments.udacity-extras.appspot.com/courses/html-css/samples/style-1.html . Where in the CSS section , the following code has been provided -

body {
    margin: 0;
}
#content {
    max-width: 948px;
    margin: 0 auto; 
}

h1 {
    background-color: #f8981C;
    color: white;
    font-size: 48px;
    font-family: Helvetica;
    text-align: center;
    padding: 20px;
    margin: 0;

}

.row {
    display: flex;
    flex-direction: row-reverse;
    height: 100%
}

p {
    color: grey;
    font-size: 24px;
    font-family: Helvetica;
}

.image > img {
    border: 6px black dotted;
    margin-left: 20px;
}

For the following HTML page -

<!doctype html>
<html>
  <head>
    <title>Favorite App</title>
    <link rel="stylesheet" type="text/css" href="style-1.css">
  </head>
  <body>
    <div id="content">
      <div>
        <h1 id="banner">My Favorite App</h1>
      </div>
      <div class="row">
        <div class="image"><img src="app.png">
        </div>
        <div class="description">
          <p>
          Some description here.
          </p>
        </div>
      </div>
    </div>

  </body>
</html>

Now , all the content has is under the tag with id content & while styling in CSS , #content has been used ? Why so ? How is it different from .row ? What would happen if we use .content instead of #content ?

Aal Ver
  • 21
  • 2

1 Answers1

0

You can't use .content instead of #content. . sign is for classes and # for id-s.

Mcload
  • 288
  • 8
  • 18