In the html basics what is the<span> | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

In the html basics what is the<span>

Please tell me I'm confused

28th Nov 2019, 4:31 PM
Nazakat Umrani
Nazakat Umrani - avatar
15 Answers
+ 6
span is inline element not start new line div is block element start new line
29th Nov 2019, 11:04 AM
Fybex
Fybex - avatar
+ 3
It is a inline block element U can use it to style a particular letter in text or a particular text in a sentence or even to insert glyphicons and icons with bootstrap
30th Nov 2019, 7:14 AM
Nwachukwu Chibuzor
Nwachukwu Chibuzor - avatar
+ 3
Imagine that you have a paragraph like this <p>I love my girlfriend</p> if you want to apply a css rule on "girlfriend" and make it red, it's impossible, okay? Because it parent is "p" tag, so if you apply a style on p,or create a class or id attribute in p and apply css rules, the whole text will be concerned. So, if there were a way for you to have an Html tag, that doesn't break up you "girlfriend" text in the next line like p or div tags, but that can embed that peace of text and help apply customized style for it, isn't it a good idea? That where span comes into action. So now we will have this :<p>I love my <span class="myclass" >girlfriend</span></p>. Any style that you'll apply to the class myclass will only modify the embedded text, so "girlfriend".
30th Nov 2019, 10:43 AM
LISANGOLA BONDJALI CHRISTIAN
LISANGOLA BONDJALI CHRISTIAN - avatar
+ 1
Yes i checked others comment and i found but thanks for your attention that you pay me thanks
28th Nov 2019, 4:54 PM
Nazakat Umrani
Nazakat Umrani - avatar
+ 1
I learned css and html full in mimo application but in this app i found many new things so i got confused
28th Nov 2019, 4:54 PM
Nazakat Umrani
Nazakat Umrani - avatar
+ 1
That's i said i learned html in mimo app and their is nothing like that if you click button it'll delete all and i listened about python so i searched that and now I'm learning in this app
28th Nov 2019, 5:54 PM
Nazakat Umrani
Nazakat Umrani - avatar
+ 1
Cv
29th Nov 2019, 3:36 PM
Jamal Jamal
Jamal Jamal - avatar
+ 1
The <span> element is an inline element, it can be used to wrap a part of text for styling
29th Nov 2019, 8:52 PM
Tosin Bams
Tosin Bams - avatar
+ 1
imagine you have an h1 title with 3 words and you want to style one of these words differently. So you can put the word within a span tag, and style it. example: <h1>some <span style="...">page</span> title</h1>
29th Nov 2019, 10:05 PM
Stratos Selas
Stratos Selas - avatar
+ 1
span : element used to color a part of a text: tag is used to group inline-elements in a document. like this : <p>My mother has <span style="color:blue">blue</span> eyes.</p>
29th Nov 2019, 11:33 PM
Ahmed Belkhodja
+ 1
دظدظ
30th Nov 2019, 10:25 AM
عصام طالب
عصام طالب - avatar
+ 1
How GNU GCC is useful for c++ compiler?
30th Nov 2019, 11:38 AM
BEJAWADA NAGABABU
BEJAWADA NAGABABU - avatar
+ 1
If you don't want any break line in your code that time span tag used. <span> doesn't break the line.
30th Nov 2019, 1:27 PM
Saif Anwar Khan
Saif Anwar Khan - avatar
+ 1
Div and Span both are containers that contains other tag elements like img, p, h1, etc. Div is block container, means occupies whole width Space of screen. Next div appears on new line. Span is inline container, means occupies only required space. Next span appears on right side.
30th Nov 2019, 2:14 PM
Shubham Sharma
Shubham Sharma - avatar