Quantcast

Jump to content


Photo

webpage centering


  • Please log in to reply
12 replies to this topic

#1 Kido

Kido
  • 1046 posts

Posted 03 May 2011 - 05:43 PM

Wasn't really sure if I should put this here or in the gfx thread but I figured more people would see it here.

Anyways. What's the code to center a webpage on your screen?

For example. All the pet pages at sunnyneo are shifted to the left but I want them to be in the center of my screen when I look at them. How would I do that? o.0

The lookup I'm editing is this one: http://sunnyneo.com/...mples.php?id=12

Which is the last one on this page: http://www.sunnyneo.com/petpages.php

Any help would be great! :D

#2 Rooshy

Rooshy
  • 254 posts

Posted 03 May 2011 - 05:45 PM

< center > ... </ center >

Like that?
I feel like I'm not understanding your question, that answer seems way too generic. D:

Alternatively, http://www.sunnyneo....al.php#aligning may help.

Edited by Rooshy, 03 May 2011 - 05:49 PM.


#3 Neoquest

Neoquest
  • 1760 posts


Users Awards

Posted 03 May 2011 - 05:50 PM

< center > ... </ center >

Like that?
I feel like I'm not understanding your question, that answer seems way too generic. D:

Alternatively, http://www.sunnyneo....al.php#aligning may help.


That would do it, but if you are trying to get it really precise you'll need to use CSS.

#4 Rooshy

Rooshy
  • 254 posts

Posted 03 May 2011 - 05:53 PM

That would do it, but if you are trying to get it really precise you'll need to use CSS.


Ah, he mentioned 'HTML' code in his title, so that's why I posted that.

For css, I believe you'd just edit the, 'align:left;' stuff to center.

Edited by Rooshy, 03 May 2011 - 05:53 PM.


#5 Neoquest

Neoquest
  • 1760 posts


Users Awards

Posted 03 May 2011 - 05:59 PM

I know, but as you said, it's such a general question I wasn't sure how he wanted it.

#6 Kido

Kido
  • 1046 posts

Posted 03 May 2011 - 06:49 PM

basically I just want the whole thing to be in the center of any screen I happen to be using (of varying resolution)

the < center > ... </ center > thing might work but where do I put it? :S Sorry. Really noob at this stuff.

#7 Neoquest

Neoquest
  • 1760 posts


Users Awards

Posted 03 May 2011 - 08:26 PM

If you want the <center></center> thing then just put it between all your content like this:

Spoiler


So it's just covering everything. If you're still confused just put a <center> tag at the top before you write anything else and it'll work.

#8 huevoquilmes

huevoquilmes
  • 245 posts

Posted 04 May 2011 - 04:35 AM

Im gonna splash out a bit from what neoquest said.  Html works with tags. These are some reserved keyword inside "<keyword>
/br You have 2 type of tags. opening and closing tabs(closing have a / at the begining).  The keyword to make text bold, for example is "b" ... so, whatever part of text I have after the opening "<b> and closing "</b> will be bold.

/br For example...   The tree "<b>" is loosing "</b>" all its leaves.   The tree and all its leaves will have normal format, and is loosing will be bold. 
/br You can apply the same principle to what neoquest said, you have to use "<center>"  and "</center>"  tags.
/br  Hope it helps, any other question just ask

/p PS: you dont need to put the "" around the tags. I did because it wouldnt show if I didnt

Edited by huevoquilmes, 04 May 2011 - 04:40 AM.


#9 Rooshy

Rooshy
  • 254 posts

Posted 04 May 2011 - 06:28 PM

Spoiler


That should center everything. Tell me if it doesn't work. D:

#10 Noitidart

Noitidart
  • Neocodex Co-Founder

  • 23214 posts


Users Awards

Posted 04 May 2011 - 06:33 PM

The usual way to do things like this is using the css margin property like mentioned above. You go style="margin:0 auto;"

#11 huevoquilmes

huevoquilmes
  • 245 posts

Posted 05 May 2011 - 05:56 AM

The usual way to do things like this is using the css margin property like mentioned above. You go style="margin:0 auto;"



there's no arguing with that.. but maybe learn how to do that with CSS just for a userlookup isnt worth it.. if you do have the time to learn it though...go for it

#12 Backslash

Backslash
  • 47 posts

Posted 05 May 2011 - 04:28 PM

The center tag is deprecated, and is outdated. If you want validated HTML you'll need to use CSS text-align:center;

#13 Noitidart

Noitidart
  • Neocodex Co-Founder

  • 23214 posts


Users Awards

Posted 05 May 2011 - 04:34 PM

The thing with text-align center is that it centers the text as well, unless that's what you want. Or you can set text-align to center for outtermost div and set the align to left for the inner divs if you want to bypass the text centering.


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users