#CSS styling questions

1 messages · Page 1 of 1 (latest)

modest prismBOT
#

<@&987246964494204979> please have a look, thanks.

#

Here is an AI assisted attempt to answer your question 🤖. Maybe it helps! In any case, a human is on the way 👍. To continue talking to the AI, you can use </chatgpt:1108714622413963314>.

#

To make the top of the red box stick to the top of the page, you can use CSS positioning. Here's an example:

HTML:

<div class="red-box"></div>

CSS:

.red-box {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100px; /* Adjust this value as needed */
  background-color: red;
}

In this example, we set the position property of the red box to fixed, which allows it to stay in a fixed position on the page. Then, we set top: 0 and left: 0 to position it at the top-left corner of the viewport. The width is set to 100% so that it spans across the entire width of the page, and you can adjust the height value as needed.

By applying these CSS styles, your red box should stick to the top of the page even when scrolling.

wanton scroll
#

thx tj bott

#

nvm tj bott didnt help

rose ether
#

Are u using a reset stylesheet?

wanton scroll
#

whats that

#

sry im not really that experinced

rose ether
#

Browsers come with default styling that produces behavior like that

#

Meaning its not letting u place the box fully at the top

#

Look up reset stylesheets, it’ll let u clear away the default browser styling so u can use ur own

wanton scroll
#

alr th

#

x

#

appreciate the help