Why wont my position code work?


#1

im trying to position text but it wont react to any code..

Code:

HTML

<p style="text-align; right: 175px">Nationalgarde</p>

CSS

p {
    text-align: relative;
    right: 175px;
}

#2

Your inline styling isn't same as your external styling of the paragraph element for the text-align. It's incomplete.

Also, if you're using the external which looks fine, hope you linked that sheet?


#3

Yea the are both linked. thank you for a response.

I'v changed them and they still seem to have no change.

HTML:

<p style="text-align: relative; right: 175px">

CSS

p {
    text-align: relative;
    right: 175px;
}

#4

You didn't close your paragraph tag also.

<p style="text-align: relative; right: 175px"></p>


#5

I Did here is the full code:

<p style="text-align: relative; right: 175px">Words go here</p>


#6

Rather than use text-align, try position . But at right: 175px, I don't think it will display on your screen.


#7

Ok its works. Position seemed to have done the trick. Thank you for your time and help


#8

You're welcome.

Have fun coding! :slight_smile:


#9

i know, problem is already solved. but take a look at the possible values for text-align, might be useful.

Paragraphs are block level elements (just like div, heading (h1..h6), and more), and left, right, bottom and topic do not work on static element (block elements have a static position by default), either make the paragraph have a relative position (which you did) or use margin, but that of course depends on the rest of your code and the ultimate goal


#10

Ok is see, thank you for informing me :slight_smile: