HTML and CSS - these are the differences
Related Videos: HTML/CSS/JavaScript - What is the Difference? - Jonas Schmedtmann (May 2024).
HTML and CSS are closely related - but what's the difference? In the past, homepages were created entirely in HTML. Today, the so-called "Cascading Style Sheet" separates the design from the structure that is created in the "Hypertext Markup Language" (HTML).
HTML - the language for structure and content
Create a homepage, bring the content to your page via HTML. Texts, images and structures, such as a table, are integrated using HTML files. HTML takes on various tasks.
- In an HTML file, you first declare the document type. This indicates which HTML version you are using.
- In the following head area - the head - you specify technical details, for example which CSS file it is linked to. You can also define the title that appears in the browser tab here.
- The HTML body comprises the content of a website. All text and images that you add to your homepage end up here. You structure the texts in paragraphs and headings of different hierarchies.
- For example, you can format a headliner with the highest priority with the command
to the first order heading. You structure further headings with the commands
.
, etc. These commands are directly related to the CSS file defined in the HTML head.
CSS - shape and color of your homepage
Unlike HTML, the CSS file does not bring dynamic content to your website. You use it to determine how a browser displays text and images. You also use CSS to design the basic structure of your homepage.
- Margins, backgrounds and footers or headers are created in a cascading style sheet. For example, for a blog, split the page into two columns; one for posts and one for links, widgets or fixed information.
- You also use the CSS file to define fixed text formatting. Have headlines in an HTML file
and
defined, they initially remain unchanged. Now give these commands a form in CSS, for example, set for
the font size 16 and for
14 firm.
You can also create a homepage without CSS files. The advantage of CSS, however, is that you can change the design of your entire homepage with just one change. If you want to enlarge the headings, the format is sufficient