answersLogoWhite

0


Best Answer

A div is a block element. This means that if you use a div, unless you float objects next to it using CSS, the div will be alone on a line. A span is an inline element. This means that unless you use line breaks next to it or change it to a block element using CSS, the span will be on the same line as whatever is next or before to it in the code.

For example:

This is a

<div>element</div>

text is above and below but not beside

This is a <span>element</span>, text is before and after on the same line.

User Avatar

Wiki User

7y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the difference between the Div and Span tag?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Which is the inline analog of the div tag?

The inline analog of the &lt;div&gt; tag is the &lt;span&gt; tag.


What is the difference between DIV and TABLE?

The TABLE tag is used to store tabular content and as such has child tags such as TR (for table rows), TD (for table cells), TH (for table headers), etc. The DIV tag is used simply to encompass a block for styling or structural reasons, it is similar to the SPAN tag but it a 'block' element as oppose to an 'inline' element (which SPAN is).


How do you make a specific element have different styles than those set for its general element type?

You can counter the styles declared for the general element type. For example, if the earlier CSS declared "background-color: #FF0000;" for all "div" elements, but you want a specific "div" tag to have a different background color, you can add "background-color: #00FF00;" as a declaration to that specific "div" tag. A live example: ---- div { background-color: #FF0000; } This division will be green, not red! ----


What is the different between table tag and div tag in HTML?

The table tag is used to create a table, which is a type of block-level element. The div tag is used to create a generic block element. The main difference is that tables are best-suited for tabular data, and divs are best-suited to presentation of non-tabular data.


Is the 'div' tag part of HTML or XHTML?

The "div" tag is part of both languages.


How can you construct website using div tag?

The &lt;div&gt; tag defines a division or a section in an HTML document. The &lt;div&gt; tag is used to group block-elements to format them with CSS.


How many types of div tag?

Several depending on your need. W3schools has examples of all of the attributes of the div tag.


Can you create div in textarea in HTML?

No you can't. While you can put div tags inside textarea tags, as anything in the textarea is treated only as text, the browser will ignore the div tags and they will show as text only and so have no impact. So if you do want sections for text, you would have to look at other ways of doing it, like having several text areas with different formatting.


What does a div tag do when using Dreamweaver CS3 xhtml and CSS?

The division tag is a "div" and is used to divide a page into sections. A div tag can be used to style a section, and style one or more sections differently than other sections.


What does the prefix div mean?

&lt;DIV&gt; is not a prefix, it is a tag. A DIV element is a container for other HTML elements and is used for positioning and structuring content in the document


Which tags are used in HTML for dividing a page into sections?

DIV tag can be used for dividing the pages and wrapping them. Placing the div tag outside, you can do whatever work inside a section.


What is web design using HTML in div style?

Div tags are elements of web pages. You cannot make a web page using solely a div tag. You would need to do something like: &lt;html&gt; &lt;head&gt; &lt;title&gt;Your HTML Document&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;div&gt;web page information goes here&lt;/div&gt; &lt;/body&gt; &lt;/html&gt; But there is no real reason to use the div tag except if you want to assign a style to it, in which case you would need to add a style sheet in between the &lt;head&gt; and &lt;/head&gt; tag or add a style property to the div tag. You can learn more about web page design by visiting the links provided below.