Skip to content Skip to sidebar Skip to footer

My Divs Do Not Seem To Be Nesting Properly

See code below and this fiddle: http://jsfiddle.net/u42mnobz/ My divs do not seem to be nesting properly. I am trying to change the margins on the divs contained within the section

Solution 1:

Much like in your other question - https://stackoverflow.com/a/27410448/1592915 - I think you're confusing <hr> tags for something they are not. They provide a horizontal like this:


They don't wrap anything, so you would want to style the classes of actual wrapping divs (e.g. <div id="service_types_section">... would be addressed as #service_types_section { ... } in css).

Also you can address .box1 that's inside different divs by increasing specificity, e.g.

#service_types_section .box1 {
  ...
  some css rules
  ...
}

#fresh_tech_section .box1 {
  ...
  some other css rules
  ...
}

Here's a good article to get familiarized with specificity.

Solution 2:

Your html isn't well formatted.

  • the paragraph tag <p style="text-align:left">Choosing a new Point of Sale doesn't have a closing tag
  • the paragraph tag <p>Taking advantage has a </td> at the end
  • none of your <img> tags has a closing '/'
  • add a closing <body> and <html> tag

Try to fix this first and see if it solves some of your problems.

Post a Comment for "My Divs Do Not Seem To Be Nesting Properly"