Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Assign one property to child of a class

Tags:

css

I've a class named entry that contains different parts of post article of my web site. Something like below:

<div class="entry">
 <div id="author-box-single">
  <div class="author-box">
   <div class="at-img">
   </div>
  </div>
 </div>

 <h1></h1>
 <p></p>
 <h2></h2>
</div> <!-- End of entry -->

As you see it contains many divs and headlines and etc. How can I assign one property, for example padding-right: 10px to all childs of entry?

like image 214
ata Avatar asked Mar 09 '23 17:03

ata


1 Answers

* sign means everything. > means direct children. For example:

.entry > * {
    padding-right: 10px;
}

will assign property to every direct child.

.entry  * {
   padding-right: 10px;
}

will assign property to everything inside it.

You can use div instead of *

.entry > div {
 padding-right: 10px;
}

will assign to all direct <div> children.

like image 118
Begmuhammet Kakabayev Avatar answered May 05 '23 18:05

Begmuhammet Kakabayev