Jump to content

How do I set margin to all the child tags?


nadavvin

Recommended Posts

<style type="text/css">div {  margin-left: 10px;}div div {  margin-left: 5px;}div div div {  margin-left: 0px;}</style>

Link to comment
Share on other sites

There's the universal selector, a.k.a. the start selector. Like this:

#myclass * {margin-left:5px;}

This will apply the style to all childs (descendants) of #myclass, no matter what element are we talking about. divs, ps, spans, you name it.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...