The HTML range component is a nonexclusive inline compartment for inline components and substance. It used to gather components for styling purposes (by utilizing the class or id credits), A superior method to utilize it when no other some other semantic component is accessible. length is fundamentally the same as the div tag, yet div is a block-level tag and range is an inline tag. Length tag is a matched label implies it has both open(<) and shutting (>) tag and it is obligatory to close the tag.
- The range tag is accustomed to gathering of inline-components.
- The range tag doesn’t roll out any visual improvement without help from anyone else.
- range is fundamentally the same as the div tag, however div is a block-level tag and length is an inline tag.
Tag is composed like:
<span class=””>Some Text………….</span>
In underneath model guess we need to compose multiple times GeeksforGeeks in three lines with intense, italic, underline, in green tone with textual style family = dispatch new so we need to utilize numerous HTML labels, for example, <b>, <i>, <u>, <font> for each time in each line and we need to make changes need to adjust each tag.
Be that as it may, by utilizing <span> label we can lessen code and HTML Attributes see underneath model will show a similar yield as above model with utilizing <span> tag by applying CSS in a range tag.
As we probably am aware range is an inline label it accepts space as much as required and leaves space for other component let see it in underneath model every one of the four-length component will show in a similar line on the grounds that each label takes just important space and rest of room free for different components.
A span tag can be used to set color/background color a part of a text: In below example inside paragraph applying three times span tag with different style.
Difference Between Div tag and span tag
The div and range tag are two regular labels when making pages utilizing HTML and perform distinctive usefulness on them while div tag is a square level component and length is inline component The div tag makes a line break and of course makes a division between the content that comes after the tag as started and until the label closes with </div>. div tag makes separate boxes or compartments for all components inside this label like content, pictures, sections.
|Properties||Div Tag||Span Tag|
|Space/Width||Contain Whole Width Available||Takes only required Width|
|Examples||Headings, Paragraph, form||Attribute, image|
|Uses||Web-layout||container for some text|
|Attributes||Not required, with common css, class||Not required, with common css, class|
The range tag doesn’t make a line break similar to a div tag, yet rather permits the client to isolate things from different components around them on a page inside a similar line. dodging of the line break, results just that chose text to change, keeping the wide range of various components around them same.
Beneath model will show the contrast among range and div tag while div tag contains entire width and length tag contain just required width and rest parts are free for another component.
Supported Browser: Supported browsers are listed below
- Google Chrome
- Internet Explorer