0
Why is <span> being used in this example?
<!DOCTYPE html> <html> <head> <title>My Blog</title> <link href="https://fonts.googleapis.com/css?family=Handlee" rel="stylesheet"> </head> <body> <!-- My Skills section start --> <div class="section"> <h1><span>My Skills</span></h1> <ul> <li>HTML</li> <li>CSS</li> <li>JavaScript</li> </ul> </div> <!-- My Skills section end --> </body> </html>
2 ответов
+ 3
I don't really see any reason. The only thing I can think of is if the person were to come back later and add more text to the <h1> tag, they could do so while also adding a class to the span tag inside so that the text "My Skills" could be styled differently than the other text in the h1 tag.
+ 3
Well, <span> can be used how other reference in the css:
HTML
<div class="oneclass">
Hello <span> how are you </span>
</div>
CSS
.oneclass span
{
font-size: 10px;
}
And with that modify especify more of your code.
You can see more in my codes