Ask coding questions

← Back to all posts
HTML HELP: how to i enter a banner to the top of my web page?
AngelTorres4 (2)

how to i enter a banner to the top of my web page?

Answered by a5rocks (821) [earned 5 cycles]
View Answer
Comments
hotnewtop
a5rocks (821)

You can use a <div> element and make either an id or a class called banner. Then in your main.css file, just add something like this: (assuming you are using an id as banner)

#banner {
  background-color: #ffffff;
  width: 100%;
  /* If you want it to stay at the top: */
  top: 0;
  position: fixed;
}

at least... I think that will work

Geocube101 (623)

You can also use the <nav> element, which creates a bar at the top of the page

katyadee (1273)

Hey there! Make sure you're always providing enough context to your posts so our community can better help you.