Personal Portfolio Pls Help!

I’m having trouble keeping my text in the welcome section as you can see next:

I’ll leave my CSS code next:


* {
  margin: 0;
  padding: 0;
}


html {
  box-sizing: border-box;
  font-size: 62.5%;
  scroll-behavior: smooth;
}


.welcome-section {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-color: #2D572C;
  height: 100vh;
  width: 100%;
  
}

.welcome-section > p {
  font-size: 3rem;
  font-family: "Courier New";
  text-align: center;
}

.welcome-section > h1 {
  font-size: 7rem;
  font-family: "Courier New";
  text-align: center;
}

.nav {
  display: flex;
  justify-content: flex-end;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: black;
}

h2 {
  text-align: center;
  font-size: 2rem;
  
}


Please help me, I don’t know what I’m doing wrong or why does it do that :sob:

Hi, I’m not able to test on my computer but I suspect that css declaration at the top of

*{
Margin: 0;
Padding:0;
}

Also affects your section tags. So write a css rule for the section tag and give the margin and padding e.g. 20px to test what changes you’ll get.

1 Like

I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (’).

1 Like

Yes! That worked! Thank you so much!!!

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.