tips on requiring users to scroll to access content on a webpage in HTML

I'm completely new to coding in HTML and CSS, so please excuse any mistakes I may make.

Currently, I am working on a website using HTML and CSS, and I want the user to scroll down in order to view the content that comes after the logo and tagline. When I try to add an image, it appears below the logo which is not what I want. Is there a way to ensure that the user has to scroll down to see the rest of the content?

Thank you for your understanding and help!

Edit: Here is the code snippet:

<!DOCTYPE html>
<html>
<head>
<title>My Website</title>
<meta charset="utf-8" />
<link type="text/css" rel="stylesheet" href="styles.css" />
</head>
<body class="body" style="overflow-y:hidden">
<center>
<div class="main"><br><br><br><br><br><br><br>
<img class="logo" src="logo.png">
<div class="tiles">
<button class="t1"></button>
<button class="t2"></button>
<button class="t3"></button>
<button class="t4"></button>
<button class="t5"></button>
<button class="t6"></button>
<button class="t7"></button>
<button class="t8"></button>
</div>
</div>
</center>
</body>
</html>

CSS:

.body {
background-color: #ffffff;
background-image:url(background.jpg);
}

.logo {
position: absolute;
left: 42%;
top: 25%;
}

.tiles{
position: absolute;
bottom: 20%;
white-space:nowrap
}

.t1 {
background-image:url(tiles/t1.jpg);
height:119px;
width:210px;
border:0px solid #ffffff;
}

.t1:hover{
background-image:url(tiles/t1-1.jpg)
}

Answer №1

Is my understanding correct?

#foo { 
  height: 100px; /* To enable scrolling */ 
  background: #ddd;
  overflow: auto;
} 
<div id="foo">
  <img src="http://sstatic.net/stackexchange/img/logos/so/so-logo-med.png" alt="logo" />
  <p>HELLO,<br>I'm hidden<br><br>Peace.</p>
</div>

Answer №2

One option is to encase your logo within a div element and set its height to occupy 100% of the viewport height.

To implement this, you can use the following HTML structure:

<div class="logo-container">
    <img class="logo" src="logo.png">
</div>

Accompanying CSS style rules would be as follows:

.logo-container{
    height:100vh;
}

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Is it possible to utilize CSS :nth-child (or a similar method) to target groups of elements in HTML, like selecting every fourth node alternately?

Let me give you a bit of background: I'm currently working on creating a layout where the elements flow from left to right in one row, then switch to flowing from right to left in the next row, and so on. To better illustrate what I mean, I have creat ...

Modifying the Scroll Bar's Color within an iframe

Is it possible to customize the color of the horizontal scrolling tab in an iframe? I am curious if this effect can be successfully implemented across all browsers. Your insights on this matter would be greatly appreciated. ...

Achieve seamless alignment of radio group labels alongside radio buttons through the use of only CSS

After using a table to display radio buttons with labels in the past, I am now attempting to achieve the same result using only CSS. Is there a CSS technique that will allow me to position the label text neatly on top of the corresponding radio button? He ...

I'm experiencing difficulty in loading a static HTML page from the app file when using Node.js

I'm currently working on setting up a system where an HTML page is loaded upon request to the app. Although I've managed to get the HTML to load successfully using res.end('') within the server definition, I find this method to be messy ...

Safari and Internet Explorer 9 prioritizing min-height over height in rendering

For testing a website, I am using Safari 5.0.5 and IE9 on Windows. Within the CSS file, the following code is present: #contentarea { background-image:url('../images/img.jpg'); background-repeat: no-repeat; background-position: right to ...

Utilizing the power of CSS' calc() function in ReactJS using react-motion's <Motion/>

I'm currently attempting to utilize calc() within a template string for the following scenario: <Motion defaultStyle={{ y: 0, opacity: 1 }} style={{ y: spring(this.state.navBarOpen ? 0 : `- calc(3.25em + 0.5vw)`), opacity: sp ...

The loading icon appears stuck and does not rotate on iOS version 15.3 and above, but functions properly on versions below 15.3

The loading icon does not spin on iOS versions > 15.3 or 16.1, but it works perfectly fine on lower iOS versions for iPhone and iPad, as well as on Android browsers. Below is the CSS code for reference. I've attempted using webkit for Safari and a ...

What steps can be taken to confirm that a comment posted on a specific post is genuine and related to that post?

Currently, I am immersed in the world of AJAX, PHP, and MySQL. Below is a snippet of my PHP code: if(isset($_GET['postTextComment'])){ // The text of the comment $htpc = htmlspecialchars($_GET['postTextComment']); // ID of ...

Achieving multiple pages and varying sizes (portrait, landscape) using Dompdf

Within one single HTML file, I have a total of six pages that I would like to convert into a PDF using dompdf. The pages are formatted as follows: Page size in landscape orientation, Page size in landscape orientation, Page size in landscape orientation, ...

Maintaining content size while sidebar opens seamlessly

In my interface, there is a sidebar that I reveal on smaller screens. However, when I open the sidebar, I want the content to its right to be pushed as well. The issue with the current implementation is that the width of the content div changes when the si ...

Ways to Adjust the Earth's Position in WebGL Earth

I have been working with this WebGL Earth component for my project, but I am facing difficulty in adjusting the position of the planet on the canvas. My intention was to place the planet at the bottom of the page, but I haven't been able to achieve th ...

The class [AdminController] being targeted does not exist

https://i.sstatic.net/r6c7q.pngI encountered an issue where a user is redirected from login to the admin page (e.g. ), and a 403 error should be triggered if the user is not logged in as an admin. Interestingly, even the admin experiences the same error. ...

What is the best way to extract the frameset from a frame window?

Here is a code snippet to consider: function conceal(frameElem) { var frameSet = frameElem.frameSet; //<-- this doesn't seem to be working $(frameSet).attr('cols', '0,*'); } //conceal the parent frame conceal(window.pa ...

Are there any features in web browsers that support accessibility, such as those designed for sign language?

Many web browsers currently share the user's preferred language with the websites they visit (e.g. in JavaScript: navigator.language || navigator.userLanguage). However, what if a user's native language is sign language, or if they need a simple ...

Interested in extracting an HTML table from a Form element within a Python Flask application?

So, in my Flask application, I need to retrieve all the content within a table element. <form action="#"> <table > <tr> <th><input type="text" id="txtName"/></th> ...

Creating intricate HTML divs dynamically using JavaScript

I am currently facing an issue with appending divs to an element in my HTML. The problem arises from an icon embedded in one of the div attributes, and it seems to be causing a syntax error. When I append the div, the formatting is incorrect and the HTML c ...

What is the significance of using single quotation marks to enclose the 'raw' key in Tailwind?

While reviewing the Tailwind documentation on custom media queries, I came across an interesting option to create a fully custom breakpoint using the 'raw' key. After adding this to my configuration file, I noticed that when I saved the file, Pr ...

How to apply background-color to a div element with ng-repeat directive?

Hey there, I'm dealing with the following code: angular.module("myApp", []).controller("myController", function($scope) { $scope.boxList = [{ color: 'red' }, { color: '#F8F8F8' }, { color: 'rgb(50, 77, 32) ...

Guide: Transform Bootstrap 4 Inline Checkboxes into Stacked Format When Screen Size Is Altered

The new layout of checkboxes and radio buttons in Bootstrap 4 really caught my attention. However, I am looking for a way to switch between "stack" and "inline" based on the screen size. Although size tagging has been added for various elements, I haven&ap ...

Apply bold formatting to the HTML text only, leaving the EJS variable untouched beside it

https://i.sstatic.net/X36eG.png Is there a way to format the text for "Guest signed up" and "Guests attended" in bold while keeping the values normal? Here is my current code: <li class="list-group-item">Guests signed up: <%= guestSignu ...