0

Has anyone try pseudo class styling? Should it be second- or 2nd? third- or 3rd- ? I can 't come up with any thing trying both in code play?

4th Jul 2016, 6:49 AM
Alexis Cheuk Yan Lee
Alexis Cheuk Yan Lee - avatar
10 odpowiedzi
+ 4
To taget any other child than 'first' and 'last', use: :nth-child(n) p:nth-child(2) Selects every <p> element that is the second child of its parent.
7th Jul 2016, 3:36 PM
ZinC
ZinC - avatar
+ 2
Well... if you have a first DIV for your header section and a last DIV for Footer section, PSEUDO-CLASSES will be a good way to aply styles. anyway, you wanna know about the DIV between the first and last DIV that you have in your code, right? If you need to change groups of DIV, try to create a more significant inheritance. Sugestions: 1st div = HEADER => DIV: FIRST-CHILD {arguments} last div = FOOTER => DIV: LAST-CHILD {arguments} 2nd, 3rd, ..., Nth DIV => Use other selectors *div article *article *class *id Realize that PSEUDO-CLASSES are an alternative that provide a more powerful control. My best shot is recomend you this course: <www.mva.microsoft.com/en-US/training-courses/css-jump-start-8474l=DtR0aRXXz_404984382>
6th Jul 2016, 6:04 AM
Kardhyr
Kardhyr - avatar
0
could you be more especific?
5th Jul 2016, 2:26 PM
Kardhyr
Kardhyr - avatar
0
Pseudo-classes are applied in element groups, like DIV, ARTICLE, HEADER, FOOTER, etc. If you wanna aply a style in a part of a content, maybe change the color of a letter or a word, then you will need to use PSEUDO-ELEMENTS. PSEUDO-CLASSES = CONTENT GROUPS PSEUDO-ELEMENTS = AN ESPECIFIC POINT >INSIDE< A GROUP
5th Jul 2016, 2:32 PM
Kardhyr
Kardhyr - avatar
0
what I tried is: using the solo example, there are five <p> within a <div>, the div::first-p , and the div::last-p is okay. but second::p? third-p no. Is there anything wrong in my first question?
6th Jul 2016, 5:24 AM
Alexis Cheuk Yan Lee
Alexis Cheuk Yan Lee - avatar
0
although I don't think there will be situation of having 85 siblings (see this in mozilla), and have the need to modify the 37th, the 53th pseudo elements; theoretically the program should be able to count (not me) the position/numbering of the element group? agree?
6th Jul 2016, 6:39 AM
Alexis Cheuk Yan Lee
Alexis Cheuk Yan Lee - avatar
0
bom dia
18th Jul 2016, 2:57 PM
Lourdes Tavare Lourdes Tavares
Lourdes Tavare Lourdes Tavares - avatar
0
23062019 Though it had been years from my first question, still want to thank for all responses. Pueudo elements , I found an experienced, useful for styling elements where the 'locations' in html are not easily located; or when some little tricky styles are needed, for that elements, out of some generalities.
22nd Jun 2019, 9:52 AM
Alexis Cheuk Yan Lee
Alexis Cheuk Yan Lee - avatar
0
As for the example of DIV: ( from Kardhyr), you should be apply case switch codes. The main point is about the 'notations'. first-element, never use 0th-element! last-element, never nth-element. Must aware that all 'elements' are stored in arrays. I read this somewhere from other tutorials, helped to understand why codes are written in such ways!
22nd Jun 2019, 10:01 AM
Alexis Cheuk Yan Lee
Alexis Cheuk Yan Lee - avatar
- 1
PSEUDO-CLASSES = CONTENT GROUPS PSEUDO-ELEMENTS = AN ESPECIFIC POINT >INSIDE< A GROUP
8th Jul 2016, 9:59 PM
Naz Banoo
Naz Banoo - avatar