PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Mon Nov 20, 2017 4:14 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Wed Jul 26, 2017 3:26 am 
Offline
DevNet Master

Joined: Wed Oct 08, 2008 3:39 pm
Posts: 4356
Location: United Kingdom
Syntax: [ Download ] [ Hide ]
.grve-container h1
{
margin-bottom: 0px;
}

.grve-container h2
{
margin-bottom: 0px;
}

I'd like to set this margin to the h1, h2 and h3 when they are within the grve-container DIV.

I tried these options but to no avail.

Syntax: [ Download ] [ Hide ]
.grve-container h1, h2, h3
{
margin-bottom: 0px;
}
 


Syntax: [ Download ] [ Hide ]
.grve-container h1 h2 h3
{
margin-bottom: 0px;
}
 


I'm sure there is a way, but I cannot see how you do it.

_________________
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.


Top
 Profile  
 
PostPosted: Wed Jul 26, 2017 4:50 am 
Offline
Moderator
User avatar

Joined: Tue Nov 09, 2010 3:39 pm
Posts: 6391
Location: Montreal, Canada
You've got the right idea
Syntax: [ Download ] [ Hide ]
.grve-container h1,
.grve-container h2,
.grve-container h3
{
  margin-bottom: 0px;
}
 

_________________
Supported PHP versions No longer supported versions


Top
 Profile  
 
PostPosted: Wed Jul 26, 2017 4:57 am 
Offline
DevNet Master

Joined: Wed Oct 08, 2008 3:39 pm
Posts: 4356
Location: United Kingdom
Oh like that! I thought it was separated by the 'inner' element, rather than having to do it with the surrounding one each time. Still less code though. Thanks.
Also, and it is on this very similar subject, what is the difference between:

Syntax: [ Download ] [ Hide ]
.myclass.mychildclass
{
color: #000000
}


...and ....
Syntax: [ Download ] [ Hide ]
.myclass .mychildclass
{
color: #000000
}


I've seen both.

_________________
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.


Top
 Profile  
 
PostPosted: Wed Jul 26, 2017 5:15 am 
Offline
Moderator
User avatar

Joined: Tue Nov 09, 2010 3:39 pm
Posts: 6391
Location: Montreal, Canada
simonmlewis wrote:
Oh like that! I thought it was separated by the 'inner' element, rather than having to do it with the surrounding one each time.

SCSS and SASS do it that way. That might be what you were thinking of.

simonmlewis wrote:
Also, and it is on this very similar subject, what is the difference between:

Syntax: [ Download ] [ Hide ]
.myclass.mychildclass
{
color: #000000
}


...and ....
Syntax: [ Download ] [ Hide ]
.myclass .mychildclass
{
color: #000000
}


I've seen both.

When there's no space, it denotes an element having both classes. When there is a space, it's an element with the child class inside an element with the parent class.

Syntax: [ Download ] [ Hide ]
<div class="myclass mychildclass">This is the first example</div>

<div class="myclass">
  <div class="mychildclass">
    This is the second example
  </div>
</div>

_________________
Supported PHP versions No longer supported versions


Top
 Profile  
 
PostPosted: Wed Jul 26, 2017 5:23 am 
Offline
DevNet Master

Joined: Wed Oct 08, 2008 3:39 pm
Posts: 4356
Location: United Kingdom
I see. thanks. So the top one would be: .myclass.mychildclass

_________________
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.


Top
 Profile  
 
PostPosted: Wed Jul 26, 2017 5:25 am 
Offline
Moderator
User avatar

Joined: Tue Nov 09, 2010 3:39 pm
Posts: 6391
Location: Montreal, Canada
Yes

Example

_________________
Supported PHP versions No longer supported versions


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: Bing [Bot] and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group