current position:Home>Span tag of HTML

Span tag of HTML

2022-01-27 02:31:43 qq60754347077be

span label It's an inline element , Not an exclusive line of labels .

Be similar to a label have access to href Property add link , and span Element cannot , therefore span There's no style .

that span What are elements used for ?

span Elements can be used to Processing information segments , Or rather, Yes In the same line By text “ Combine

Take a chestnut :

       
       
< div > Here is a div label </ div >
  • 1.

here , We just want to be right This div In the tag “div” Add style to these three letters , Other text does not add style , At this time we can use span label .

       
       
< div > Here is a < span >div </ span > label </ div >
  • 1.

This is the time We just need to use CSS The selector found this div Label under span label , Yes span The label can be styled separately . This will not destroy the current DIV The original style of the label .

       
       
div> span {
color: red;
}
  • 1.
  • 2.
  • 3.


copyright notice
author[qq60754347077be],Please bring the original link to reprint, thank you.
https://en.cdmana.com/2022/01/202201270231412721.html

Random recommended