HTML CSS JavaScript
HTML CSS JavaScript
HTML is used to create webpages but does experience limitations when it comes to fully
responsive components. Therefore, HTML should only be used to add text elements and
structure them within a page. For more complex features, HTML can be combined with
cascading style sheets (CSS) and JavaScript (JS).
An HTML file can link to a cascading style sheet or JS file -- usually at the top of the document
with a specified file path -- which will contain information about which colors to use, which
fonts to use and other HTML element rendering information. JavaScript also allows developers
to include more dynamic functionality, such as pop-ups and photo sliders, in a webpage. Tags
called class attributes are used to match HTML elements to their corresponding CSS or JS
elements.
For example, if a user wants the color of a certain amount of text to be red, they can write code
in the CSS file with an accompanying class attribute that turns text red. Then they can place the
associated class attribute on all the pieces of text they want to be red in the HTML sheet. The
same basic method applies to JS sheets, with different functions.
Separating information about how a page is structured, the role of HTML, from the information
about how a webpage looks when it is rendered in a browser is a software development pattern
and best practice known as separation of concerns.
HTML 4.01 was released in 1999, at a time when the internet was not yet a household name,
and HTML5 was not standardized until 2014. During this time, HTML markup drifted from the
job of simply describing the document structure of webpage content into the role of also
describing how content should look when a webpage displays it.
As a result, HTML4-based webpages often included information within a tag about what font to
use when displaying text, what color should be used for the background and how content should
be aligned. Describing within an HTML tag how an HTML element should be formatted when
rendered on a webpage is considered an HTML antipattern. HTML should generally describe
how content is structured, not how it will be styled and rendered within a browser. Other markup
languages are better suited to this task.
One major difference between HTML4 and HTML5 is that the separation of concerns pattern is
more rigorously enforced in HTML5 than it was in HTML4. With HTML5, the bold <b> and
italicize <i> tags have been deprecated. For the paragraph tag, the align attribute has been
completely removed from the HTML specification.