Help me understand div tags

Help me understand div tags
0.0 0

#1

Tell us what’s happening:

Hello, I am not having trouble with this challenge, rather I am confused about the format of the code provided and just wanted clarification. Towards the end with the lines of code with the div tags, why is there a closing /div tag after /p, and why not just put it with the rest of the closing tags at the bottom? I even adjusted it to make it look like that and it made no visual changes. Am I missing something?

Your code so far


<style>
  h4 {
    text-align: center;
    
  }
  p {
    text-align: justify;
  }
  .links {
    margin-right: 20px;
    text-align: left;
  }
  .fullCard {
    width: 245px;
    border: 1px solid #ccc;
    border-radius: 5px;
    margin: 10px 5px;
    padding: 4px;
  }
  .cardContent {
    padding: 10px;
  }
</style>
<div class="fullCard">
  <div class="cardContent">
    <div class="cardText">
      <h4>Google</h4>
      <p>Google was founded by Larry Page and Sergey Brin while they were Ph.D. students at Stanford University.</p>
    </div>
    <div class="cardLinks">
      <a href="https://en.wikipedia.org/wiki/Larry_Page" target="_blank" class="links">Larry Page</a>
      <a href="https://en.wikipedia.org/wiki/Sergey_Brin" target="_blank" class="links">Sergey Brin</a>
    </div>
  </div>
</div>

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.org/responsive-web-design/applied-visual-design/adjust-the-height-of-an-element-using-the-height-property


#2

<div> tag defines a division or a section in an HTML document.

<div class="cardText">
      <h4>Google</h4>
      <p>Google was founded by Larry Page and Sergey Brin while they were Ph.D. students at Stanford University</p>
</div>

cardText is section of this document . section has start and end when you want to close section need to use </div>


#3

i think i get it. it makes a lot more sense when i read the class names. i.e. class is named “cardText” because it covers the section with the header and paragraph.


#4
> Hopefully the following helps. 
> <Fullcard open>
>     <Cardcontent open>
>         <Cardtext open>
>              h4open h4 close,
>              pOpen p close
>         <Cardtext close>
>         <Cardlinks open>
>             Anchor links
>         <Cardlinks close>
>      <Cardcontent close>
> <Fullcard close>

#5

this was my assumption. thank you!


#6
Is a container, block, or group of content if between opening div tag and closing div tag is related. (class, id, paragraph, heading, link, list, table, etc.)