Home > front end >  If this CSS control respectively in two P label how to write CSS
If this CSS control respectively in two P label how to write CSS

Time:09-16



<style>
# democ ul li p
{
The text - align: left;
The font - size: 5 px;
The line - height: 30 px;
height: 30px;
overflow: hidden;
Padding - left: 3 px;
5 px margin: 0 px;
}
</style>

Aaaa



Bbbb

CodePudding user response:

Li p: NTH - of - type (1) {}
Li p: NTH - of - type (2) {}

CodePudding user response:

# democ ul li p: first - of - type {}//the first
# democ ul li p: last - of - type {}//second or last one

CodePudding user response:

Method are many, you can add a class name to p tags, or is this: the NTH - child () and first - of - type, these two kinds of pseudo class selectors
  • Related