+ 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
13 Answers
+ 8
Hello, privrax. !
Do not forget that the <span> tag is a container. So in which tag do you use the <span> ?
+ 5
What are you trying to achieve:
1. Make text go through a whole block
2. Make text invisible
+ 4
remember <Span> tag is a container for values
+ 3
Homayoun Aghaei no, because thats not the real code. The actual project Iām working on is much bigger.
+ 2
Alexander Sokolov I want text in the span. So should I have:
<span class=āsomeclass>
<p>blah blah blah</p>
</span>
?
+ 2
Agent Im tryint to do the former.
+ 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.
+ 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
+ 1
Homayoun Aghaei yes but its not working.
0
why? it's very simple code
0
For what it is for you?
0
what is span?
0
yes, what is span?