Front End Interview Flashcards
(157 cards)
What did you learn yesterday/this week?
Open Ended, Practice Answering
What excites or interests you about coding?
What really excites me about coding is the inherent puzzle-solving nature of it. It’s like tackling a complex puzzle where anything feels possible if you can figure it out. The thrill of finally uncovering the cause of a slippery bug is immensely satisfying. Moreover, I enjoy the creative aspect of coding, particularly in creating tactile and beautiful interfaces and animations. It’s this combination of logical problem-solving and the opportunity to express creativity that keeps me engaged and passionate about coding.
When building a new web site or maintaining one, can you explain some techniques you have used to increase performance?
Lazy Loading: For resources that are not immediately needed, I make use of lazy loading. This includes images, scripts, or components, which are loaded only when they are about to be displayed.
Optimizing Images: I ensure that images are compressed and optimized for the web. This involves choosing the right file format, using responsive images, and employing tools like ImageMagick or services like TinyPNG to reduce file sizes.
Content Delivery Network (CDN): Utilizing a CDN helps in distributing static assets across multiple servers geographically. This minimizes latency and accelerates content delivery to users.
Performance Monitoring: Regularly monitoring the application’s performance using tools like Google Lighthouse, WebPageTest, or browser developer tools helps identify areas that need improvement.
Responsive Design: Ensuring that the web application is responsive and adapts well to various screen sizes not only improves user experience but can also positively impact performance. Responsive design often involves using a single set of HTML and CSS for all devices, rather than creating separate versions for desktop and mobile. This can result in fewer HTTP requests because there’s less need to download different sets of assets for different devices.
Caching Strategies: Implementing caching mechanisms, both on the client side (browser caching) and server side (HTTP caching), is crucial. This reduces redundant requests and speeds up subsequent page loads.
Browser Rendering Optimization: I pay attention to the critical rendering path, optimizing the order in which assets are loaded to ensure that the most important content is displayed as quickly as possible.
What is a recent technical challenge you experienced and how did you solve it?
Open Ended, Practice Answering
What is the critical rendering path?
The critical rendering path is the sequence of steps browsers take to convert HTML, CSS, and JavaScript into rendered pixels on the screen. Optimizing the critical rendering path is crucial for improving page load times and providing a faster, more responsive user experience. Here are the key stages in the critical rendering path:
- HTML Parsing and DOM Construction:
The browser parses the HTML document to create the Document Object Model (DOM), a tree-like structure representing the structure of the webpage. This process is called HTML parsing. The DOM is crucial for rendering and manipulating the content on the page.
- CSS Parsing and Style Computation:
As the browser encounters CSS stylesheets, it parses and constructs the CSS Object Model (CSSOM). The CSSOM contains information about the styles applied to elements on the page. The browser then combines the DOM and CSSOM to create the Render Tree, a tree structure that represents the visual hierarchy of the page.
- Layout (Reflow):
The browser calculates the layout of elements on the page, determining their position and size. This process is often referred to as reflow. Changes to the layout trigger recalculations, making it a computationally expensive operation.
- Paint:
The browser paints the pixels on the screen based on the information from the Render Tree and layout calculations. This process is known as paint. The painted pixels make up the visual representation of the webpage.
- Composite:
Finally, the browser combines the painted layers to create the final rendered image on the screen. This process is called composite.
Optimizing the critical rendering path involves minimizing the time spent in each of these stages. Here are some strategies to achieve this:
- Reduce the Number of Requests: Minimize the number of HTTP requests by combining and minimizing CSS and JavaScript files. This reduces the time spent in downloading resources.
- Prioritize Critical Resources: Load critical resources, such as stylesheets and scripts needed for above-the-fold content, as early as possible to speed up rendering of the initial view.
- Async and Defer Loading: Use the async and defer attributes for script tags to control when JavaScript is executed. This helps avoid blocking the HTML parsing and rendering process.
- Optimize CSS and JavaScript: Minify and compress CSS and JavaScript files to reduce their size. This speeds up the download and parsing process.
- Avoid Render-Blocking Resources: Identify and optimize resources that block rendering, such as large images or synchronous JavaScript that delays the rendering process.
Explain what the DOM is
The DOM, or Document Object Model, is a programming interface for web documents. It represents the structure of a document as a tree of objects. Each object corresponds to a part of the document, like elements, attributes, and text content. It allows us to interact with and manipulate the content, structure, and style of a web page using JavaScript.
Can you share some recent SEO techniques you’ve used?
Sure thing! Lately, I’ve been big on semantic HTML, making sure our content structure is clear for search engines. Also, optimized metadata is key – crafting catchy titles and descriptions with our target keywords.
Responsive design is a must for mobile-friendly vibes, and optimizing images, not just for looks but also for search engines. Oh, and speeding things up with page load tricks – code splitting, CSS and JS minification, you know the drill.
Adding structured data markup for that extra search engine love and keeping our URLs clean and keyword-friendly. Internal linking helps guide search engines through our content, and regular updates keep things fresh. And, of course, solid keyword research to know what users are looking for.
It’s all about keeping things user-friendly while speaking the language search engines love!
What actions have you personally taken on recent projects to increase maintainability of your code?
One big move in our Vue lobby redesign was breaking down complex components into smaller, reusable ones. This modular approach makes it easier to understand, update, and troubleshoot.
I’ve also been keen on keeping a consistent coding style across the project, using Vue’s style guide. It might seem minor, but it makes collaboration smoother and the codebase more cohesive.
Documentation is another hero in my toolkit. I make sure to document not just the how, but also the why behind certain design decisions. It’s a lifesaver for future developers – or future me!
Implementing Vuex for state management has been a game-changer. It centralizes the state logic, making it easier to track and manage, especially as the casino lobby gets more complex.
All these efforts might add a bit to the initial development time, but they pay off big time in the long run by making the codebase more robust and maintainable.
Talk about your preferred development environment.
I’m a big fan of Visual Studio Code. The extensions and ecosystem it offers are a game-changer for Vue development. The Vetur extension, in particular, makes Vue.js development a breeze with features like syntax highlighting, IntelliSense, and template validation.
For version control, I rely on Git, and platforms like Bitbucket for collaborative projects.
As for terminals, I often use the integrated terminal in VS Code. It’s convenient, and I can run commands without switching between windows.
For versioning and dependency management, npm does the job well, especially when working with Vue CLI for project scaffolding.
Overall, a lightweight and efficient setup with VS Code at the center has been my go-to for a while now. It strikes the right balance between functionality, ease of use, and community support.
Which version control systems are you familiar with?
I’m well-versed in Git, which we use for day-to-day version control tasks like committing, pushing, and pulling changes. I’m comfortable navigating Git repositories, managing branches, and resolving merge conflicts.
In our collaborative workflow, I’m familiar with using Bitbucket for pull requests and code reviews. Bitbucket complements it by providing a user-friendly interface for collaboration and code management.
Can you describe your workflow when you create a web page?
Absolutely. Here’s a simplified overview of my workflow:
I start by setting up the project using Vue CLI or a similar tool. This involves creating the project structure, configuring dependencies, and establishing a version control repository.
Planning and Wireframing:
Before diving into code, I often sketch out a rough wireframe of the page layout and structure. It helps me visualize the components and overall design.
Vue Component Creation:
I break down the page into Vue components. Each component is responsible for a specific part of the UI, promoting reusability and maintainability.
Styling with CSS and Vuetify:
I use CSS and possibly a component library like Vuetify to style the components. Vuetify’s pre-built components and responsive design elements save time and ensure consistency.
Adding Interactivity with Vue.js:
I leverage Vue.js for dynamic and interactive elements. Directives, event handling, and data binding allow me to create a responsive and engaging user experience.
API Integration:
If the page requires data from an API, I set up API calls using tools like Axios. Vue’s lifecycle hooks, such as mounted, are handy for fetching data when the component is ready.
Optimizing for Performance:
I optimize the page for performance by considering aspects like lazy loading, code splitting, and image optimization. This ensures a smooth user experience, especially on slower connections.
Version Control with Git and Bitbucket:
Throughout the process, I commit changes regularly using Git. For collaborative projects, I create branches for features or bug fixes and use Bitbucket for pull requests and code reviews.
Documentation:
I document the code, especially complex logic or decisions, to make it easier for other developers (or future me) to understand the implementation.
Review and Deployment:
Before deployment, I conduct a thorough review, checking for code quality, responsiveness, and cross-browser compatibility. Continuous integration tools can automate this process.
Deployment:
Finally, I deploy the web page to the production environment, ensuring that it aligns with our deployment strategies and doesn’t disrupt the live application.
This workflow allows for a systematic and collaborative approach to web development, combining planning, coding, testing, and deployment in a structured manner.
If you have 5 different stylesheets, how would you best integrate them into the site?
Great question. Here’s how I would approach integrating five different stylesheets into a site:
Bundle and Minify:
I’d first concatenate and minify the individual stylesheets into a single, optimized file. This reduces the number of HTTP requests, improving page load times.
Organize Styles:
Before bundling, I’d organize the stylesheets based on their purpose. For example, separate global styles, component-specific styles, and third-party library styles. This maintains a clear and modular structure.
Load Asynchronously or Defer:
To avoid render-blocking, I’d load non-critical stylesheets asynchronously or defer their loading until after the initial page render. This can be achieved using techniques like the async attribute for <link></link> tags or JavaScript to dynamically load styles.
Conditional Loading:
Depending on the use case, I might conditionally load certain stylesheets only for specific pages or components. This can be achieved through dynamic imports or server-side logic.
Maintainability:
Lastly, I’d document the purpose of each stylesheet and any conventions used for styling. This documentation aids in future development and makes it easier for other team members to understand and contribute to the codebase.
Can you describe the difference between progressive enhancement and graceful degradation?
Certainly. Both progressive enhancement and graceful degradation are strategies in web development to ensure a good user experience across different devices and browsers, but they approach it in different ways:
Progressive Enhancement:
Definition: Progressive enhancement starts with a basic, universally accessible version of a web page and then progressively adds more advanced features or enhancements based on the capabilities of the user’s device and browser.
Approach: The core functionality and content are delivered to all users, regardless of their device or browser capabilities. Then, additional enhancements, such as advanced styling, interactivity, or features, are layered on top for users with more capable devices and browsers.
Key Idea: It focuses on building a solid foundation that works everywhere and then enhances the experience for users with modern browsers or devices.
Graceful Degradation:
Definition: Graceful degradation, on the other hand, starts with a fully-featured and visually rich version of a web page designed for the latest browsers and devices. It then ensures that the page still functions reasonably well, albeit with fewer features or a simpler design, on older browsers or less capable devices.
Approach: The primary design and functionality are created for the latest technologies. If a user’s device or browser doesn’t support certain features, the experience gracefully degrades to a simpler but still functional version.
Key Idea: It focuses on delivering the best experience possible for users with modern technologies and gracefully handling the limitations of older technologies.
How would you optimize a website’s assets/resources?
Optimizing a website’s assets is crucial for improving performance and user experience. Here’s how I would approach it:
Image Optimization:
Compress and resize images without compromising quality. Use modern image formats (WebP) where supported. Lazy loading images is also effective in reducing initial page load times.
Minification and Compression:
Minify CSS, JavaScript, and HTML files to remove unnecessary characters like whitespace and comments. Additionally, enable server-side compression (gzip or Brotli) to reduce file sizes during transmission.
Browser Caching:
Leverage browser caching to store static assets locally on the user’s device. This reduces the need to download the same resources on subsequent visits, improving load times.
Code Splitting:
Implement code splitting to break down large JavaScript bundles into smaller, more manageable chunks. Load only the code required for the current page, enhancing performance.
Async and Defer Loading:
Use the async and defer attributes for script tags to control when JavaScript is executed. This prevents scripts from blocking the rendering of the page, especially for non-critical functionality.
Content Delivery Network (CDN):
Utilize a CDN to distribute assets across multiple servers globally. This reduces latency and ensures faster delivery of content to users, especially those geographically distant from the server.
Critical CSS and Fonts:
Inline critical CSS to ensure faster rendering of above-the-fold content. Asynchronous loading or utilizing the font-display property for web fonts can prevent them from blocking page rendering.
Reduce HTTP Requests:
Minimize the number of HTTP requests by combining and optimizing assets. Use CSS sprites for multiple small images and consider using icon fonts or SVGs instead of individual image files.
Prefetching:
Implement resource prefetching for critical assets that will be needed on subsequent pages. This reduces the perceived load time when users navigate to other parts of the site.
Responsive Design:
Design with a mobile-first approach to ensure that assets are appropriately sized for different devices. Use media queries and responsive images to adapt to various screen sizes.
Monitor and Analyze:
Regularly monitor website performance using tools like Google PageSpeed Insights, Lighthouse, or WebPageTest. Analyze the results and make adjustments based on performance bottlenecks.
How many resources will a browser download from a given domain at a time?
What are the exceptions?
Browsers usually follow a limit of six concurrent connections per domain to manage resource downloads efficiently. This means that, by default, the browser will fetch up to six resources simultaneously from the same domain. However, there are some exceptions and considerations:
Subdomains: Browsers often treat subdomains as separate entities, allowing an additional set of six concurrent connections. For instance, if you have a main domain like example.com and serve images from img.example.com, it may open six connections for each.
HTTP/2: With the adoption of HTTP/2, browsers can multiplex multiple streams over a single connection, reducing the impact of the six-connection limit. This is especially beneficial for modern websites that utilize HTTP/2.
Domain Sharding (deprecated): In the past, developers used domain sharding to overcome connection limits by spreading resources across multiple domains. However, this practice is now considered outdated, and newer technologies like HTTP/2 have made it less necessary.
Connection Pooling: Browsers may use connection pooling to reuse existing connections for subsequent requests, optimizing resource retrieval by efficiently managing multiple connections.
These considerations are essential when optimizing website performance, ensuring that the browser can fetch resources in a way that aligns with network and server constraints.`
Name 3 ways to decrease page load (perceived or actual load time).
Optimize Images:
Compress and resize images to reduce their file sizes. Use modern image formats like WebP when possible. Implement lazy loading to defer the loading of images until they are about to be viewed, which significantly improves initial page load times.
Minify and Bundle Code:
Minify CSS, JavaScript, and HTML files to remove unnecessary characters, reducing file sizes. Additionally, bundle and concatenate files to reduce the number of HTTP requests. This not only speeds up the initial load but also benefits subsequent page views due to cached resources.
Prioritize Critical Rendering Path:
Streamline the critical rendering path by prioritizing the loading of essential resources for above-the-fold content. This includes inlining critical CSS to ensure that the initial view is styled quickly. Consider asynchronous loading of non-essential scripts or deferring their execution until after the initial rendering.
Implementing these strategies helps in optimizing both perceived and actual page load times, contributing to a faster and more responsive user experience.
If you jumped on a project and they used tabs and you used spaces, what would you do?
In such a scenario, I would prioritize consistency to maintain a clean and cohesive codebase. Here’s how I would approach it:
Follow Existing Convention:
I would adhere to the existing code convention, which in this case is using tabs. Consistency within the codebase is crucial for readability and collaboration.
Configure Editor Settings:
I would configure my code editor to use tabs instead of spaces for this particular project. Most modern code editors allow users to customize indentation settings on a per-project basis.
Respect Team Norms:
I would discuss the indentation style with the team and understand the reasons behind their choice. If there’s a strong preference for tabs, I would respect that and adapt to the team’s norms.
Automated Formatting:
To avoid manual formatting conflicts, I might suggest incorporating a code formatter, such as Prettier or ESLint, into the project. This ensures consistent formatting automatically and helps prevent style-related issues during code reviews.
In essence, the key is to prioritize consistency and effective collaboration within the existing project norms. It’s crucial to communicate with the team, understand their preferences, and find a solution that maintains a unified and readable codebase.
Describe how you would create a simple slideshow page.
Certainly! Let’s break it down:
HTML Structure:
I’d start with the basic HTML structure, setting up a container for the slideshow and including image elements for each slide. Each slide is wrapped in a div with a common class, and I’ve added navigation arrows for the user to manually navigate through the slides.
CSS Styles:
In the CSS, I’ve styled the slideshow container to be centered on the page and defined the basic styles for the slides. I’ve added styles for the navigation arrows to make them visible and positioned them on the sides of the slideshow.
JavaScript Logic:
For the JavaScript part, I’ve set up a simple logic to handle the slideshow. The showSlides function hides all slides and displays the current one based on the slide index. The changeSlide function is called when the user clicks on the navigation arrows, updating the index accordingly.
Automatic Slideshow:
I’ve included a setInterval function that automatically changes the slide every 3 seconds, creating a basic automatic slideshow effect.
Initial Display:
Finally, I make sure to call showSlides initially to display the first slide when the page loads.
This is a straightforward setup that can be expanded upon based on specific requirements. For instance, you could add captions, customize transitions, or fetch slides dynamically from a server. The code provides a foundation that can be built upon to create a more feature-rich slideshow experience.
If you could master one technology this year, what would it be?
I would choose to master data visualization, particularly diving into libraries and frameworks like D3.js or Chart.js. The reason behind this choice is my genuine interest in exploring the power of visual representation in conveying complex data insights.
Data visualization plays a crucial role in making information more accessible and understandable. It’s not just about presenting numbers; it’s about telling a compelling story through visuals. Whether it’s interactive charts, graphs, or dynamic dashboards, the ability to translate data into meaningful visuals is a skill that I believe can bring immense value to any project.
I haven’t delved deeply into data visualization yet, but the potential to unlock new insights and improve decision-making processes excites me. With the increasing emphasis on data-driven approaches in various industries, mastering data visualization would not only align with current trends but also open up exciting possibilities for creating impactful and user-friendly applications.
Explain the importance of standards and standards bodies.
Standards and standards bodies play a pivotal role in the world of software development and technology for several reasons:
Interoperability:
Standards provide a common set of rules and specifications that ensure interoperability between different systems, software, and devices. This is crucial for creating a cohesive and interconnected digital ecosystem.
Compatibility:
Standards enable compatibility between various technologies and platforms. Developers can rely on standardized protocols and formats, reducing the likelihood of conflicts and ensuring that software and hardware components work seamlessly together.
Innovation and Collaboration:
Standards encourage innovation by providing a foundation upon which developers can build. When everyone follows the same standards, it fosters collaboration and the exchange of ideas, leading to the creation of more robust and versatile technologies.
Market Growth:
Standardization accelerates market growth by creating a level playing field. When products adhere to common standards, it becomes easier for consumers to adopt new technologies, fostering competition and driving advancements in the market.
Security and Reliability:
Standards often include best practices for security and reliability. Adhering to established standards helps developers implement robust security measures and build reliable systems, reducing vulnerabilities and enhancing overall system integrity.
Regulatory Compliance:
Standards bodies often work closely with regulatory authorities to establish guidelines and regulations. Adhering to these standards ensures that software developers comply with legal requirements and industry regulations, mitigating risks and ensuring ethical practices.
Long-Term Maintenance:
Standards contribute to the long-term maintainability of software and systems. When technologies follow established standards, it becomes easier to update, upgrade, or replace components without disrupting the entire ecosystem.
Global Collaboration:
Standards bodies facilitate global collaboration by bringing together experts from around the world to define and refine standards. This international collaboration ensures that standards are comprehensive, unbiased, and applicable across diverse environments.
In essence, standards and standards bodies provide a foundation for a reliable, interoperable, and innovative technological landscape. They are a cornerstone of the software development process, promoting consistency, compatibility, and the overall advancement of the industry.
What is Flash of Unstyled Content? How do you avoid FOUC?
A Flash of Unstyled Content (FOUC) occurs when a web page briefly renders with unstyled or default styles before applying the intended styling. This phenomenon is often noticeable during the initial loading of a web page and can lead to a less-than-optimal user experience.
To avoid FOUC, here are some strategies:
Properly Organized Stylesheets:
Ensure that your stylesheets are organized and loaded in a logical order. Critical styles, especially those for above-the-fold content, should be loaded first to style the essential parts of the page before less critical styles.
Inline Critical CSS:
Inline critical CSS directly within the HTML for above-the-fold content. This way, the essential styling is applied immediately, mitigating the impact of FOUC during the initial page load. Tools like Critical CSS or critical path CSS generators can assist in this process.
Preloading Stylesheets:
Use the preload attribute to hint to the browser that certain stylesheets are crucial for rendering the page. This allows the browser to fetch and prioritize these stylesheets, reducing the likelihood of FOUC.
Optimize Loading Order:
Optimize the loading order of scripts and stylesheets. Scripts that manipulate the DOM or apply styles should be deferred or loaded asynchronously to prevent them from blocking the rendering of the page.
Responsive Design:
Implement a responsive design approach, ensuring that your styles adapt well to various screen sizes. This helps prevent layout shifts that might occur if the styles are applied after the initial rendering.
Media Queries:
Use media queries to apply styles based on the user’s device characteristics. This allows you to tailor the styling for different screen sizes and resolutions, avoiding unnecessary layout adjustments.
Browser Caching:
Leverage browser caching for your stylesheets. Once a user visits your site, the stylesheets can be cached locally, reducing the need to download them again on subsequent visits and decreasing the chances of FOUC.
By employing these strategies, you can minimize the occurrence of FOUC and ensure a smoother and more visually consistent user experience during the loading of your web pages.
Emily, could you explain what ARIA is and how it helps make websites accessible? Also, what about screen readers?
ARIA stands for Accessible Rich Internet Applications. It’s like this extra layer of information we add to our HTML to help out folks using assistive tech, especially screen readers. ARIA makes sure dynamic stuff on our site, like interactive buttons or single-page app elements, gets properly interpreted and described by those assistive tools.
And speaking of screen readers, they’re these awesome tools that turn digital text into spoken words or Braille. They’re a game-changer for users with visual impairments, helping them navigate and understand what’s on a webpage.
I’d make sure I’m using semantic HTML, you know, giving elements like buttons or navigation a proper meaning. Then, I’d sprinkle in some ARIA roles and attributes for that extra context.
Focus styles are crucial too. When you’re tabbing through a site, it’s essential to know where you are. So, I’d make sure all interactive stuff has a clear focus style.
And let’s not forget descriptive text for things like images. Gotta use the alt attribute to give a brief, meaningful description. Oh, and keyboard navigation—everything on the site should be reachable and usable just with a keyboard.
Finally, regular testing, especially with real users who rely on assistive tech, keeps things in check. It’s like making sure your site is a welcoming place for everyone who visits.
Explain some of the pros and cons for CSS animations versus JavaScript animations.
CSS Animations:
Pros:
Ease of Use: CSS animations are super straightforward. You can define them in your stylesheets using keyframes, and they’re easy to understand and implement.
Performance: Generally, CSS animations tend to be more performant, especially for simpler animations. Browsers can optimize them well, and you don’t need to worry about scripting overhead.
Hardware Acceleration: CSS animations often leverage hardware acceleration, making them smoother and more efficient, especially for transitions like opacity or transforms.
Cons:
Limited Control: While CSS animations are great for simple transitions, they might feel limiting if you need more complex, interactive animations. Controlling them dynamically based on user interactions can be a bit challenging.
Browser Compatibility: Some older browsers may not support the latest CSS animation features, so you might need fallbacks or consider alternative approaches for broader compatibility.
JavaScript Animations:
Pros:
Full Control: With JavaScript, you have complete control over animations. You can create intricate, dynamic animations based on user interactions or specific events, offering a lot of flexibility.
Interactivity: JavaScript animations shine when it comes to interactive animations. You can respond to user input, create complex sequences, and tie animations directly to your application logic.
Cross-browser Compatibility: JavaScript animations are more likely to work consistently across different browsers, making them a safer bet for intricate animations in complex projects.
Cons:
Performance Overheads: While modern browsers have become more efficient, complex JavaScript animations can still introduce performance overhead, especially on less powerful devices.
Learning Curve: Working with JavaScript animations might have a steeper learning curve, especially for beginners. It involves understanding the DOM, managing states, and handling various events.
Code Maintainability: Complex JavaScript animations can sometimes lead to more code, potentially making it harder to maintain and debug compared to a concise CSS animation.
So, it really depends on the context. For simple, performant transitions, CSS animations are fantastic. But when you need dynamic, interactive animations, JavaScript gives you the power and control you might be looking for.
What does CORS stand for and what issue does it address?
CORS stands for Cross-Origin Resource Sharing. It’s a security feature implemented by web browsers that helps control how web pages in one domain can request and interact with resources on another domain.
The issue CORS addresses is related to security and preventing malicious activities that could occur if web pages were allowed to make unrestricted requests to different domains. Without CORS, a script on one domain might be able to make requests to another domain on behalf of a user, potentially leading to security vulnerabilities and unauthorized access to sensitive data. CORS sets up a set of rules and headers that both the client and server must follow, allowing secure communication between different origins while protecting user data and privacy.
, take up the full width, start on a new line, and stack vertically. They're great for structural elements. On the flip side, inline elements, like or , only take up as much width as necessary, and they don't force a new line. They're handy for smaller, inline content like text or links. So, block-level elements give you that full-width, new-line treatment, while inline elements are more about fitting in with the text flow.