Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
78
rated 0 times [  81] [ 3]  / answers: 1 / hits: 19087  / 11 Years ago, thu, november 28, 2013, 12:00:00

i have requirement where i need to display text and button in one box.
i have placed button tag inside span which has text and button



  inside span tag
+-------------------+
| text here |
| |
| <button> tag here |
+-------------------+


my question is the right approach having button inside span. as just learned span is inline element and it can have only text, images etc..



What is the difference between HTML tags <div> and <span>?


More From » jquery

 Answers
46

You can of course use CSS to render the span as a block element, or even an inline-block if that is what you need.


.yourSpanClass {
display: block;
}

.yourSpanClass {
display: inline-block;
}

Though, i'd advice you to simply use a div if you have access to the HTML.


Supported browsers: http://caniuse.com/inline-block


[#74010] Wednesday, November 27, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
natalyah

Total Points: 371
Total Questions: 90
Total Answers: 105

Location: The Bahamas
Member since Wed, Apr 12, 2023
1 Year ago
;