In the html basics what is the<span> | Sololearn: Learn to code for FREE!

+3

In the html basics what is the<span>

Please tell me I'm confused

11/28/2019 4:31:11 PM

Nazakat Umrani

16 Answers

New Answer

+6

span is inline element not start new line div is block element start new line

+5

Pls use the search bar before posting to avoid duplicate questions. https://www.sololearn.com/discuss/324298/?ref=app https://www.sololearn.com/discuss/1283863/?ref=app https://www.sololearn.com/discuss/1469413/?ref=app https://www.sololearn.com/discuss/1546568/?ref=app

+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

+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".

+2

🥺Please teach me how to make a button that when you press it everything disappears 🥺

+1

Yes i checked others comment and i found but thanks for your attention that you pay me thanks

+1

I learned css and html full in mimo application but in this app i found many new things so i got confused

+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

+1

+1

The <span> element is an inline element, it can be used to wrap a part of text for styling

+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>

+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>

+1

+1

How GNU GCC is useful for c++ compiler?

+1

If you don't want any break line in your code that time span tag used. <span> doesn't break the line.

+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.