0

What is the difference between these two classes?

 2 years ago
source link: https://www.codesd.com/item/what-is-the-difference-between-these-two-classes.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

What is the difference between these two classes?

advertisements

I don't know how they are different in css

something
{
   //some properties
}

something >.somethingelse
{
   // something else's properties
}

something
{
   //some properties
}

something .somethingelse
{
   // something else's properties
}

I don't know why there is such a > in the second case. Should there also be a < for use too ?


The > indicates that direct children somethingelse are found under something. Otherwise descendants will be found at all levels.

So using this following example:

<div class="something">
    <div class="somethingelse">
        <div class="somethingelse">
        </div>
    </div>
</div>

For the > example only the outer somethingelse div will take effect. For the example without > both divs will have the style applied.

< might imply a parent selector (ie apply a style to the direct parent of a matching class). I'm not aware of this existing yet, but theres an interesting post on it a csstricks here.

Related Articles

What is the difference between these two class definitions?

var gem = function() { }; function gem() { }; It looks to me they are the same. but I know there must be some difference between those two? Anyone knows which one is better?The first is an anonymous function that is part of an assignment expression.

What is the difference between these two statements:

I am new in C programming and I wondered what is the difference between these two declarations: const int a; and int const a; Both are well accepted by the compiler.There is no difference. Both are same. int and const both are declaration specifiers

What is the difference between these two methods for pause / resume threads?

I have a multithreaded application which is used to extract data from a website. I wanted to be able to pause and resume multiple threads from the UI. After searching on the web I came to know about two approaches that I can use to control (pause/res

What is the difference between these two selectors using ": not"?

What is the difference between these two selectors? input:not([type="radio"][type="submit"]) input:not([type="radio"]):not([type="submit"]) Will an <input> tag that has no type attribute be selected? I've read

What is the difference between these two JavaScript inheritance methods?

Today I wasted hours in a weird bug while developing ember I confidently ignored the Ember extend way App.SomeModel = DS.Model.extend() and somehow turned into my prefer way class App.SomeModel extends DS.Model() My second way just didn't work. So I

What is the difference between these two ways to launch in Java?

What is the difference between these two ways of casting in Java? (CastingClass) objectToCast; CastingClass.class.cast(objectToCast); The source of Class#cast(Object) is as follows: public T cast(Object obj) { if (obj != null && !isInstance(obj))

What are the differences between these two statements?

#import "ViewController.h" @interface ViewController () { NSString *string; } @end @implementation ViewController{ NSString *string; } - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a

What is the difference between these two statements (asp.net/c#/entity framework)

IEnumerable<Department> myQuery = (from D in myContext.Departments orderby D.DeptName select D); var myQuery = (from D in myContext.Departments orderby D.DeptName select D); What is the difference between these two statements above? In my little asp

What is the difference between these two SQL queries?

This question already has an answer here: ANSI vs. non-ANSI SQL JOIN syntax 8 answers What are the differences between these two SQL queries? Query #1: select mytab.name, mytab.age, films.title, films.author from films, mytab where films.id = mytab.i

What is the difference between these two expressions in an anonymous Scala function?

This seems like a minor issue since there is a simple work-around, but what is the difference between these two expressions? List(1, 2, 3).sortBy(_) List(1, 2, 3).sortBy(x => x) The first gets a compiler diagnostic missing parameter type for expanded

What is the difference between these two ways to save data in CakePHP

What is the difference between these two ways of saving data in CakePHP $this->request->data['User']['status'] = 'Active'; $this->User->saveField('status', 'Active'); $this->request->data['User']['status'] = 'Active'; It means you will c

What is the difference between these two cases of adding a string?

I noticed that when I initialized a string, the compiler reported an error that I was not expecting. For example: #include <iostream> #include <string> using namespace std; int main() { string s1 = "Hello", s2 = "World!"; /

What are the differences between these two questions?

The title speaks for itself. The first query - SELECT * FROM table _t WHERE (id1, id2, id3, id4) <> (x1, x2, x3, x4) The second query - SELECT * FROM table_t WHERE NOT (id1 = x1 AND id2 = x2 AND id3 = x3 AND id4 = x4) What are the differences betwee

What is the difference between these two pieces of Python code?

What is the difference between these two pieces of code? The first one returns a list of tokens as expected but the second piece of code seems to just return a list with 1 item. Variables sentences = load_parsed_example_sentences() # list of sentence

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK