Ask coding questions

← Back to all posts
How do you put text to the top, left corner in css?
Coder2404 (361)

I need to know this for my website..

Answered by programmeruser (575) [earned 5 cycles]
View Answer
Comments
hotnewtop
programmeruser (575)

Try this:

#text {
  left: 0;
  top: 0;
}

Now make sure your text has a id of text:

<p id="text">I am located at the upper right corner!</p>

(not related, but are you https://forum.snap.berkeley.edu/u/gacha-girl?)

NateRiver0 (95)

body {
padding:0;
margin:0;
}
#header {
height: 100px;
float:left;
}

.help_header {
float:right;
}

(: found this on https://stackoverflow.com/questions/31212187/how-to-make-text-appear-at-the-top-left-corner
if i helped please press the check

NateRiver0 (95)

@Coder2404
oh well! wish you good luck on your personal project!

Coder2404 (361)

Thanks @therealebraheem do you mind if we became friends?

Coder2404 (361)

I just realized I never had 6 cycles @therealebraheem where did it come from?
(Not like I’m complaining)

NateRiver0 (95)

@Coder2404
i just liked all of your replies

Coder2404 (361)

Why did you like all of my replies? @therealebraheem

NateRiver0 (95)

@Coder2404
what do you mean by that

Coder2404 (361)

I mean can you please tell me why you liked my replies @therealebraheem ?
You don’t have to if you feel uncomfortable.

NateRiver0 (95)

@Coder2404
i wanted you to have more ? ?????????

Coder2404 (361)

Why would you ever do that for me? @therealebraheem

Coder2404 (361)

Ok just nevermind, talk to you tomorrow! @therealebraheem

Coder2404 (361)

@therealebraheem Do you know how to make a sidebar?

Coder2404 (361)

@therealebraheem Hey how are you, I’m good, how about you?

NateRiver0 (95)

@Coder2404
are you gonna respond please

NateRiver0 (95)

want to make a project pls
@Coder2404

NateRiver0 (95)

@Coder2404ugh sorry my little sister keeps spamming!!!
how are you. coder2404?

Coder2404 (361)

@therealebraheem fine, you can can help with a project, but why were you not responding before?

Coder2404 (361)

@therealebraheem it’s, okay, I’m NOT mad 😀

Coder2404 (361)

@therealebraheem just don’t spam me next time
I literally have more than 50 messages in my notifications, LOL

Coder2404 (361)

@therealebraheem um, here is my schedule of my school days
8:50-9:00 I can talk to you
9:00-10:15: Math
10:15-10:30 I can talk to you
10:30-11:10: Technology
11:10-11:25:I can talk to you
11:25-12:15: Reading
12:15-1:00:I can talk to you
1:00-1:50:Writing
1:50- End of day :)

Coder2404 (361)

@therealebraheem why are you not responding..😔😔😔

Coder2404 (361)

@therealebraheem What language do I use? HTML and CSS.Not really JavaScript :p

Coder2404 (361)

@therealebraheem are you there?😔😔😔😔

NateRiver0 (95)

@Coder2404
hey, sorry i dont wanna talk that much anymore, from the start i just wanted to answer your question.

Coder2404 (361)

@therealebraheem then why did you spam me yesterday
(But I’m NOT mad)

NateRiver0 (95)

@Coder2404
im not gonna respond anymore

Coder2404 (361)

@therealebraheem is this your school?
Leota Middle School
19301 168th Ave NE, Woodinville, WA 98072

NateRiver0 (95)

your on a apple device?

NateRiver0 (95)

you live in brooyklyn right??

acli26 (0)
.topcontainer {
position: relative;
}

.text {
position: absolute;
left: 0;
top: 0;
}
RYANTADIPARTHI (6006)

Solution

here's how you do it.

<body>
  <div id="header">
     <p class='help_header'>text text text</p>  
  </div>
</body>
body {
padding:0;
margin:0;
}
#header {
height: 100px;
float:left;
}

.help_header {
float:right;
}

like that. The top is HTML, and the bottom is css.
That should work.

here's a link for more info.

https://stackoverflow.com/questions/31212187/how-to-make-text-appear-at-the-top-left-corner

EpicGamer007 (1606)

make it position fixed then set top: 0 and left: 0.

Coder2404 (361)

How do you exactly do that? @EpicGamer007

EpicGamer007 (1606)

@Coder2404 css... create something called style.css then link it to the html. then access the element and add the styles

Coder2404 (361)

I haven’t learned a lot so I needed a lot of help. @tussiez

Coder2404 (361)

@tussiez (Sorry if I’m annoying) but can you show me how to do it?
You are my friend anyway...