Basics for First Job Interview as a Web Developer

Tharushi Chamalsha
5 min read6 days ago

--

Starting a career as a web developer is both exciting and challenging. As you prepare for your first job interview in this dynamic field, it’s crucial to have a solid foundation in the core technologies that power the web: HTML, CSS, and JavaScript. In this article series, I will discuss some basics you need to freshen up your knowledge before an interview.

HTML Basics

What is HTML?

HTML, which stands for HyperText Markup Language, is the standard markup language used to create and design documents on the World Wide Web. This is NOT a programming language. It provides the basic structure (building block) of web pages, which can be enhanced and modified by other technologies such as CSS (Cascading Style Sheets) and JavaScript. HTML uses a series of elements, represented by tags, to define the content and layout of a web page. These elements include headings, paragraphs, links, images, lists, and more.

Structure of an HTML document

An HTML document is structured with a <!DOCTYPE html> declaration followed by an <html> tag. Inside the <html> tag, there are two main sections: the <head> section, which contains meta-information, and the <body> section, which contains the actual content of the page.

Now let us go through the HTML structure,

1. <!DOCTYPE html> refers to the version of HTML, HTML5.

2. Every HTML file must start with a <html> tag.

3. <head> section contains meta-information about the document, such as its title, character set, and links to stylesheets and scripts.

4. <body> section contains the actual content of the web page, including text, images, links, and other media.

What are HTML tags and elements?

HTML tags are the building blocks of HTML and are used to define elements. An element in HTML typically consists of a start tag, content, and an end tag. Basically, HTML elements can be classified into two types: inline and block elements.

  • Inline Elements do not force the content to start on a new line; they only take up as much width as necessary, allowing other elements to sit beside them. Examples of inline elements include <span>, <img>, and <a>.
  • Block Elements, on the other hand, take up the full width available and always start on a new line, ensuring that the content following them is pushed to the next line. Examples of block elements include heading tags <h1> to <h6>, <p>, <header>, and <footer>.

Additionally, all these tags can have multiple attributes within them to provide additional information or functionality. Attributes are written inside the opening tag and are used to configure the element or adjust its behavior in various ways.

What are Semantic HTML Elements and Why are They Important?

Semantic HTML elements are those that clearly describe their meaning in a way that both the browser and the developer can understand. These elements give structure to the HTML document and improve the accessibility and readability of the code.

Examples of Semantic HTML Elements:

  • <header>: Represents the introductory content or a set of navigational links for a section or page.
  • <nav>: Defines a set of navigation links.
  • <article>: Represents a self-contained piece of content that could be independently distributed or reused.
  • <section>: Defines a section in a document, such as a chapter, header, footer, or any other sections of the content.
  • <aside>: Represents content that is tangentially related to the content around it (like a sidebar).
  • <footer>: Defines the footer for a section or page, typically containing metadata about the document, links, and copyright information.
  • <main>: Represents the dominant content of the <body> of a document.

Importance of Semantic HTML Elements:

  1. Improved Accessibility: Screen readers and other assistive technologies can better understand and navigate the content, providing a better experience for users with disabilities.

2. Better SEO (Search Engine Optimization): Search engines can better understand the structure and content of your web pages, which can lead to improved search rankings.

3. Enhanced Readability and Maintainability:Developers can read and understand the code more easily. It becomes clearer what each part of the HTML document is supposed to do.

By using semantic HTML, you not only make your web pages more accessible and easier to manage but also enhance the overall user experience and performance of your site.

What are HTML Attributes?

HTML attributes provide additional information about HTML elements. They are always included in the opening tag and usually come in name/value pairs like name=”value”. Attributes modify the default functionality of an element or specify additional properties for the element.

CSS Basics

CSS, or Cascading Style Sheets, is a stylesheet language used to describe the presentation of a document written in HTML or XML. CSS controls the layout, colors, fonts, and overall visual appearance of web pages, enabling developers to separate content from design.

Selectors

Selectors are used to target HTML elements that you want to style. Common types include:

Element Selector: Targets elements by their tag name.

Class Selector: Targets elements by their class attribute.

ID Selector: Targets a single element by its ID attribute.

Attribute Selector: Targets elements based on attributes.

Properties and Values

Properties are aspects of the element you want to change (e.g., color, font-size), and values are the settings you apply to those properties.

ex:

h1 {
color: green;
font-size: 24px;
}

Box Model

The box model describes the rectangular boxes generated for elements in the document tree and consists of margins, borders, padding, and the content area.

  • Content: The actual content of the box, where text and images appear.
  • Padding: Clears an area around the content. The padding is transparent.
  • Border: A border that goes around the padding (if any) and content.
  • Margin: Clears an area outside the border. The margin is also transparent.

Layout

CSS provides several ways to control the layout of elements on the page, including:

  • Flexbox: A layout mode designed for one-dimensional layouts.
  • Grid: A powerful layout system for two-dimensional layouts.
  • Positioning: Control how elements are positioned using static, relative, absolute, fixed, and sticky.

Responsive Design

Ensure your web pages look good on all devices by using media queries and responsive units.

CSS is essential for creating visually appealing and user-friendly websites. Mastering the basics of CSS allows you to style your web pages effectively and ensure a consistent look and feel across different devices and browsers.

Cheers !!

--

--