DEV Community

Jazmine
Jazmine

Posted on

Today I learned...

We started on HTML and CSS basics this week! We laid out the basics of HTML by creating a simple rock-paper-scissors webpage.

We began by getting acclimated to the very basics of GitPod and VSCode. Our first HTML lesson consisted of learning the syntax.

<a href="https://github.com/">
   Go to GitHub
</a>
Enter fullscreen mode Exit fullscreen mode

The syntax consists of:

  • The opening tag <a>
  • The closing tag </a>
  • The content in between Go to GitHub
  • Attributes inside the opening tag href=""

And collectively, we call this an element.

  • Elements can have more than one attribute and contain other elements!
  • The element inside is called the child element, while the element outside is the parent element.

We also learned the boilerplate of HTML.

<!DOCTYPE html
<html>
   <head>
      <meta charset="utf-8">
      <title>Document</title>
      <meta name="viewport" content="width=device-width">
   </head>
   <body>
      <!-- content to be displayed to the user -->
   </body>
</html>
Enter fullscreen mode Exit fullscreen mode

Now more on attributes, some only make sense in specific elements. Examples include:

  • href="" is for <a> elements and specifies where to take the user when they click on the link.
  • src="" is for <img> elements and specifies the url of the image to load.
  • for="" is for <label> elements and specifies which input element it is paired with.

Top comments (0)