It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming CSS Forum

store the text to the middle

store the text to the middle

Postby spil778 on Wed Dec 30, 2009 8:44 pm

i don't know about that is in the html code but i think that was in the css code to do this so here comes my problem....
HOW can i do so my text is in the middle of the srceen?
if you understand?
spil778
 
Posts: 17
Joined: Sun Oct 04, 2009 7:59 pm

Re: store the text to the middle

Postby rangana on Wed Dec 30, 2009 9:55 pm

Hi spil778,

Good day!

You can center your text with CSS' "text-align" property and defining the "value" - center.

It's like this:
element {
text-align:center;
}

...where "element" is the element to where your textNode is being contained.

However, this will not work for "inline-elements". It would better work with "block-level" elements. Best example would be:
Code: Select all
<p>Text in the center</p>


...and the CSS would appear like:
Code: Select all
p {
text-align:center;
}



On the other hand, to center an element, you can use the "margin:auto;" technique, but I don't want to fill you up with a couple of info as it might confused you.


Hope that helps.
User avatar
rangana
500+ Club
 
Posts: 935
Joined: Wed Feb 27, 2008 5:14 am
Location: Cebu City Philippines

Re: store the text to the middle

Postby spil778 on Wed Dec 30, 2009 10:17 pm

wow i feel dumb now :D
that so fucking logic anyway
thank you very must :D
i can't walk on one of my legs so i've lots of time to making a website :mrgreen:
spil778
 
Posts: 17
Joined: Sun Oct 04, 2009 7:59 pm


Who is online

Users browsing this forum: No registered users and 0 guests