/  Technology   /  Difference Between HTML and CSS

Difference Between HTML and CSS

 

The HyperText Markup Language (HTML) is the most commonly used markup language for web pages. The HTML code is the basic building block of a web page. A web browser reads the HTML document and assembles it into a visual or audible web page. A Cascade Style Sheet (CSS) describes the appearance and formatting of a document written in a mark-up language. The CSS language is widely used to style HTML-based web pages.

What is HTML?

HTML is a markup language and not a programming language. In HTML, markup tags, also known as HTML tags, are used to describe web pages. HTML documents describe web pages and contain HTML tags as well as plain text. HTML tags are easily identifiable in HTML documents because they are enclosed within angle brackets (e.g. <HTML>). 

An HTML document is generally tagged in pairs, with one tag being the start tag (e.g., b>) and the other being the end tag (e.g., /b>). Web browsers (e.g. Internet Explorer, Firefox, etc.) display HTML documents as web pages by reading HTML documents. HTML tags are used by the browser to interpret the content of the page, but are not displayed by the browser themselves. Images, objects, and scripts written in languages such as JavaScript can be embedded in HTML pages. HTML can also be used to create interactive forms.

What is CSS?

The CSS specification defines how HTML elements should be displayed on a page. Originally, HTML was not intended to contain tags for formatting a document, but rather to define its content. But, the introduction of tags like <font> in HTML 3.2 made life very challenging for web developers. When creating large web sites, adding font and color information to each page became a tedious process.

 CSS was developed by the World Wide Web Consortium (W3C) as a solution to this problem. Using HTML 4.0, all formatting can be removed from the HTML document and stored in a separate CSS file. As a result of CSS, the content of a document can be separated from the presentation of that document, including its layout, colors, and fonts. Multiple web pages could share the same formatting, reducing complexity and repetition of structural content. As well, CSS can allow the same markup page to be presented in different styles by allowing the reader to choose a different style sheet to override the one specified by the author. In today’s world, CSS is widely used and supported by all browsers.

Difference Between HTML and CSS

The main difference between HTML and CSS is that HTML is a markup language used to specify the content of a web page, whereas CSS is a style sheet language used to specify the layout of a web page. Although HTML is capable of specifying the formatting of a web page, using CSS would be more effective, since it would allow for the separation of content from presentation and ensure consistency across the entire site.

Leave a comment