Where is span




















Operations software. Connect your favorite apps to HubSpot. See all integrations. We're committed to your privacy. HubSpot uses the information you provide to us to contact you about our relevant content, products, and services. You may unsubscribe from these communications at any time. For more information, check out our privacy policy. Written by Jamie Juviler WebsiteJamie. As it turns out, a lot. Span elements give designers and developers tight control over the styling and formatting of their web pages and content.

In HTML, the span tag is a generic inline container element. Span tags usually wrap sections of text for styling purposes or for adding attributes to a section of text without creating a new line of content. A div, the other generic HTML element, is block-level and creates a new line on the page. See the example below for some various examples. Inline CSS should be avoided, as it makes it more difficult to make page-wide style changes.

Span can accommodate other attributes, too. This helps search engine indexing and instructs text-to-speech programs to pronounce these words differently. In the below example inside paragraph applying three times span tag with a different style.

CSS is the foundation of webpages, is used for webpage development by styling websites and web apps. Skip to content. Change Language. Related Articles. Table of Contents.

Save Article. Improve Article. Like Article. Then you should be able to start using it in your coding projects. The span tag is just like a div, which is used to group similar content so it can all be styled together. But span is different in that it is an inline element, as opposed to div , which is a block element. Also, keep in mind that span itself does not have any effect on its content unless you style it.

There are two major uses of the span tag — styling and manipulating a particular text with JavaScript. If you want to makes some particular text or any other content different from the rest, you can wrap it in a span tag, give it a class attribute, then select it with the attribute value for styling.

In the examples below, I change the color , background-color , and font-style of some text by wrapping it in a span tag.



0コメント

  • 1000 / 1000