Target multiple elements in the same div

Hello!

Let's say you have a div where there for example is some text in h2, h3 and p tags. Let's say you want to style the h2's and the h3's the same way. If the div class is "container" - the way I would do it now is:

.container h2, .container h3 {
font-size: 16px;
{

But then I thought, that the ".container" part is there two times.

Is there a smarter way to write it, so that you only write .container once to make the code as short as possible?

Thanks! Smile

CSS selector and list style confusion

Given the following HTML

<ul class="ul-items"> 
              <li><a href="#">Essen, Germany</a></li>
              <li><a href="#">Technical Solutions Engineer</a></li>
</ul>

in the CSS stylesheet i have the folloing CSS :

ul .ul-items li , a {
    list-style-type: none;
}

What does the selector read as
a) select the li and a under the class .ul-items of element ul .
b) select the li under the class .ul-items of element ul , and than select the a tags in the entire document(i guess the 1st answer is correct but just conforming).

Selector confusion

OK CSS selectors .

Now if i have the below code in HTML

<div class="carousel-caption">
 
                <h1>Hello world</h1>
		<p>corp</p>
 
</div>

Now in CSS if i say

div p 

it will select p i assume.

and if i type

div > p

will it still select p ? or will i have to do

div > h1 > p

problem with combining styles

I am working with a Wordpress stylesheet. By the time is gets to me, ul and li have defined with an arrow bullet. For one list I don't want that graphic bullet, and I don't want the indent. this a sample is made to reduplicate the problem.

Question about selectors

I've read alot online about this, but for some reason I just cannot understand this, so if someone could please explain in plan words I would sure appriciate it.

I thought that ex. #nav ul li this one goes for ALL <li> that are children og <ul> that are child of #nav.

But what is the difference between that one and this one : #nav > ul > li ?

If someone could please explain this ( preferbly with a very simple html explanation that would be GREAT Smile

Syndicate content