hanhdao11 / prj-rev-bwfs-dasmoto

0 stars 0 forks source link

div usage #3

Open franfranfranfran opened 6 years ago

franfranfranfran commented 6 years ago

good idea to use divs to help structure the content on the page. remember that divs are meant to surround elements and group them together. right now you have several div elements nested within text elements. here's an example of how you might want to use a div -

<div class="item">
    <h2 id="brushes">Brushes</h2>
    <h3>Hacksaw Brushes</h3>
    <p>Made of the highest quality oak, Hacksaw brushes are known for their weight and ability to hold paint in large amounts.
       Available in different sizes. <span class="price">Starting at $3.00 / brush.</span></p>
    <img src="https://s3.amazonaws.com/codecademy-content/courses/freelance-1/unit-2/hacksaw.jpeg"/>
</div>

in the above example, the div is used with a general 'item' class to surround the entire brush item section. a unique 'brushes' id is used on the uniquely styled h2 element. i also changed the price div to a span, which allows the text to stay on the same line with the surrounding paragraph text.

hanhdao11 commented 6 years ago

ohh, I see, I didn't know about "span", now I get more the div part, also didn't have clear if I could id anywhere inside the div like above. Perfect, thanks.