display: block not doing anything on span element | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 4

display: block not doing anything on span element

Okay so i have a program that has a <span> element rendered by CSS: .whatever-the-spans-class-is { font-weight: bold; display: block; } it seems like it should work. does the display need another css value set for it to work, or are there css values that disable display: block to work? thanks in advance

29th Jun 2018, 6:40 PM
privrax.
privrax. - avatar
13 Answers
+ 8
Hello, privrax. ! Do not forget that the <span> tag is a container. So in which tag do you use the <span> ?
29th Jun 2018, 6:54 PM
Alexander Sokolov
Alexander Sokolov - avatar
+ 5
What are you trying to achieve: 1. Make text go through a whole block 2. Make text invisible
29th Jun 2018, 6:52 PM
Agent
Agent - avatar
+ 4
remember <Span> tag is a container for values
7th Sep 2018, 6:13 PM
Ryan Matsangaise
Ryan Matsangaise - avatar
+ 3
Homayoun Aghaei no, because thats not the real code. The actual project I’m working on is much bigger.
8th Jul 2018, 3:14 AM
privrax.
privrax. - avatar
+ 2
Alexander Sokolov I want text in the span. So should I have: <span class=“someclass> <p>blah blah blah</p> </span> ?
30th Jun 2018, 2:38 AM
privrax.
privrax. - avatar
+ 2
Agent Im tryint to do the former.
30th Jun 2018, 2:44 AM
privrax.
privrax. - avatar
+ 2
The HTML <span> tag is used for grouping and applying styles to inline elements. There is a difference between the span tag and the div tag. The span tag is used with inline elements whilst the div tag is used with block-level content.
8th Sep 2018, 6:50 PM
Hemang Parmar
Hemang Parmar - avatar
+ 1
privax try this on html <span>Text for test</span> <span>Text for test 2 </span> then: enter this on css span{display:block;} block makes the text to not continue on same line
5th Jul 2018, 1:31 PM
Homayoun Aghaei
Homayoun Aghaei - avatar
+ 1
Homayoun Aghaei yes but its not working.
6th Jul 2018, 4:21 PM
privrax.
privrax. - avatar
0
why? it's very simple code
6th Jul 2018, 11:44 PM
Homayoun Aghaei
Homayoun Aghaei - avatar
0
For what it is for you?
7th Sep 2018, 7:08 AM
Arkadiya
0
what is span?
7th Sep 2018, 3:48 PM
Józef Woziwoda
Józef Woziwoda - avatar
0
yes, what is span?
7th Sep 2018, 4:24 PM
Joseph Sobi Sobrino
Joseph Sobi Sobrino - avatar