Vous êtes sur la page 1sur 2

Hemant Singh

hemant.s@smallbizexpress.com Assignment

+919008719352(M)

1. Why do we use <div> tag over table tag? 2. What are different DOCTYPE we make use of in a web page development?

Ans. 1 The table tag is meant for listing tabular data. It is not optimized to build structure. Moreover, the table-based layout contains more code than the div-based version. And maintaining a website, structured using a table, is very difficult. When we make use of table based layout, its hard to separate the contents from the design. And because of the excess code in webpage development, the development and maintenance cost keeps growing. This results in larger file sizes and longer download times.

Whereas, the <DIV> tags solves most of the issues. The <div> tag defines a division or a section in an HTML document. It is used to group block-elements to format them with styles. It is often used together with CSS to layout a webpage. The div tag is a block-level element that defines a section within a document. Divs are thus suitable for building the structure of Web pages. The div tag is also used to describe content that cannot be properly described by other more semantic tags.The div element isnt visual like the table element. Everyone knows what a table looks like, but divs are not as obvious. The <DIV> tags are more flexible to use. The biggest problem with div tags is that they are used too often. Every extra div the developer adds makes the code harder to read. More lines of code lead to longer download times, and so on. This all rings of the code smell we get from table-based layouts. Overusing div tags is as bad as having a table-based layout, except that it is more flexible with media. Divs should only be used to build structure and as placeholders for design elements when no other block-level elements can describe the content. The div tag is for logical groupings of elements.

Ans. 2 As per standards each HTML/XHTML document requires a document type declaration. The "DOCTYPE" begins the HTML/XHTML document and tells a validator which version of HTML to use in checking the document's syntax. The <!DOCTYPE> declaration must be the very first thing in your HTML5 document, before the <html> tag. WE CAN DIFFERENTIATE AMONG THE TYPES AS: 1. STRICT 2. TRANSITION 3. FRAMESET

Hemant Singh

hemant.s@smallbizexpress.com

+919008719352(M)

STRICT : It emphasizes structure over presentation. o The Deprecated elements and attributes (including most presentational attributes), frames, and link targets are not allowed in HTML 4 Strict. o XHTML 1.0 Strict. XHTML 1.0 Strict is an XML version of HTML 4 Strict. TRANSTIONAL : o HTML 4 Transitional includes all elements and attributes of HTML 4 Strict but adds presentational attributes, deprecated elements, and link targets. o XHTML 1.0 Transitional is an XML version of HTML 4 Transitional. FAMESET: o HTML 4 Frameset is a variant of HTML 4 Transitional for documents that use frames. o XHTML 1.0 frameset is an XML version of HTML 4 Framest.

Vous aimerez peut-être aussi